Posted by: Jeffrey Blyseth Feb 22 2007, 08:20 PM
When
I set object.isVisible(true); it takes a moment before the object
appears. Do I need to do something else to force the object to appear
immediately?
Thanks
Posted by: Petit Feb 23 2007, 12:29 AM
QUOTE(Jeffrey Blyseth @ Feb 22 2007, 09:20 PM)

When I set object.isVisible(true);
Hmm, sounds a bit strange to me. Are you sure you use the isVisible() method?
That is used to check if an Object3D is visible.
It takes no arguments, but returns a Boolean indicative of the objects visibility.
You should use setVisible( true ), which takes a Boolean argument and changes the visibility.
On
the other hand, if that is in fact what you do, it may be possible that
you have to trick the rendering engine to update, by making a fake
movement of the camera, like camera.rotateY(0);
For some changes we have to make such a fake movement to force an update.
Not very elegant, but in some cases a very effective work around.
Posted by: Jeffrey Blyseth Feb 23 2007, 01:41 AM
QUOTE(Petit @ Feb 22 2007, 04:29 PM)

You should use setVisible( true ), which takes a Boolean argument and changes the visibility.
On
the other hand, if that is in fact what you do, it may be possible that
you have to trick the rendering engine to update, by making a fake
movement of the camera, like camera.rotateY(0);
For some changes we have to make such a fake movement to force an update.
Not very elegant, but in some cases a very effective work around.
Yes,
I mistyped that, I am using setVisible(boolean), I tried the camera
trick you mentioned but it didn't work, I still get a gap (I'm turning
off visibility of an mc at the same time attempting to turn on
visibility of the object). I'm going to make sure I am not making a
mistake in my own logic before I try to look into the possibility of
the engine having a problem.
Thanks for the input
Posted by: Jeffrey Blyseth Feb 23 2007, 02:24 AM
Hi Petit,
I found that I could get the "immediate" response I wanted in this way.
I
have an mc that I've drawn as a bitmap and added as the skin to a
plane. When the user interacts with my mc, I'm hiding the plane
(object.setVisible(false)
.
When the user clicks something in my mc, I hide the mc and then turn on
the plane.setVisible(true) and then send it a RotationInterpolator.
This is the gap I was referring to, my mc dissappears and then there's
a second before the plane becomes visible and starts turning. I've
solved that by setting both my mc visibility=false and
object.setVisible(true) in the onProgressEvent of the Interpolator. In
this way I get a seemless transition.
But wait
There's more:
If
I set the easing on my RotationInterpolator to easingIn, the onEnd
event fires before the rotation is actually complete and I get a left
over artifact of the object on the screen that is about half way
rotated. If I set easingOut, I don't get that artifact... Really
confused on this one.
EDIT: Even if I set the easing to default
(linear) I still get the artifact, It seems like the onEnd is firing a
bit before the screen render is actually done... Any ideas?
Just
to clarify this a bit more, it only gets stuck if I call
setVisible(false) for an object in the Interpolation endEvent for that
object. If I don't attempt to turn off visibility the object
Interpolation completes without a problem.
Posted by: Petit Feb 23 2007, 11:25 AM
QUOTE(Jeffrey Blyseth @ Feb 23 2007, 03:24 AM)

Hi Petit,
I found that I could get the "immediate" response I wanted in this way.
I
have an mc that I've drawn as a bitmap and added as the skin to a
plane. When the user interacts with my mc, I'm hiding the plane
(object.setVisible(false)

.
When the user clicks something in my mc, I hide the mc and then turn on
the plane.setVisible(true) and then send it a RotationInterpolator.
For us to see the artifact you ares talking about, it would be good if you could attach an example SWF.
A bit of example code to try to hunt down the culprit, wouldn't hurt

Your explanations are quite readable, but there might be confusion anyway:
You say "I have an mc ...added as the skin to a plane", so the mc is a TextureSkin?
Then "When the user interacts with my mc, I'm hiding the plane", so we don't see the plane now.
Then "When the user clicks something in my mc, I hide the mc and then turn on the plane"
How do I interact with an mc sitting as a skin on a hidden plane?
Is it that the same mc is presented twice - both on and off the plane?
Posted by: kiroukou Feb 23 2007, 01:06 PM
QUOTE
EDIT:
Even if I set the easing to default (linear) I still get the artifact,
It seems like the onEnd is firing a bit before the screen render is
actually done... Any ideas?
Yes
that's it. If the onEndEvent is followed by an objectSetVisible( false
); it is possible that the object is rendered before or not.
Is it what annoy you ?
Posted by: Jeffrey Blyseth Feb 23 2007, 04:15 PM
Yes,
I'm not sure why it would leave an artifact on the screen though. Even
if it doesn't finish the Interpolation, it seems like the setVisible
call should over ride all else. However, I think if I killed the
interpolator in the onEnd event this might take care of it. I'll try
that and report back.