How do you set the final position for a fly transition

AS3: I can make the fly transition work but I can't find any way to set the final position for the movieclip (which is a child) when the fly finishes.

There isn't a parameter for it in the transition manager. I've try adding the child and setting the x and y but it doesn't make any difference. TM seems to have a mind of its own. If I set the position, for example, to 275/200 it flies in to about 50/50.

?????
chevronrodAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

conagramanCommented:
as you have already noticed the transitions available in the transition manager class do not have a parameter for X and Y ending positions. the x and y position the transition will end on will be the movieclip's x and y position before the transition begins. You should also know the transition manager does not work with the sprite display object type but only Movie clip types.
i think i will need to see your file / code you are adding your child to your movielcip and the transition code you are using to go any further.
0
conagramanCommented:
I should also point out that an alternative I would recommend to using the transition manager would be to use the tween class instead which will give you greater control including the parameters for speed easing and your starting and ending positions. Another benefit to using the  tween class is that it does work with the sprite display object type.
0
chevronrodAuthor Commented:
Here is the code:

var brothers1MC:MovieClip = new mcBrothers1();
var brothers1TM:TransitionManager = new TransitionManager(brothers1MC);
function brothersAdd(e:Event):void{
      addChild(brothers1MC);
      brothers1TM.startTransition({type:Fly, direction:Transition.IN, duration:8, easing:Strong.easeOut});
}


FYI: Easing and duration do work on the Fly transition.

But I'm leaning towrd using a tween like you said....
0
conagramanCommented:
thank you but I am aware of the parameters of the transitions of the transition class.

ok first declare your transition manager outside of any function.  
var brothers1TM:TransitionManager;   // this line
the problem with any tween or transition is the garbage collector will sometimes remove the instance before it is complete keeping the declaration outside of any functions will keep that from happening.
Another thing that will help is to add a listener for when the transition is complete like i have below.

So i think what should work for you is  make sure your code waits till the transition is complete and declare your transitions outside of your function.


var brothers1TM:TransitionManager;   //  outside of all functions

var brothers1MC:MovieClip = new mcBrothers1();
brothers1TM = new TransitionManager(brothers1MC);

function brothersAdd(e:Event):void
{
      addChild(brothers1MC);
      brothers1TM.startTransition({type:Fly, direction:Transition.IN, duration:8, easing:Strong.easeOut});
brothers1TM.addEventListener(“allTransitionsInDone”, TransComplete);
function TransComplete(e:Event):void
{
trace(“transition complete do something else”);
}

}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chevronrodAuthor Commented:
I did exactly that but I still have a problem. There must be something else interfering. I'm going to keep trying but since I am giong to work with your solution as the foundation I'm closing this one.

Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.