Jump to content
Search Community

Get movieclip instance

friendlygiraffe test
Moderator Tag

Recommended Posts

Is it possible to get the instance of the targetted MovieClip? for example:

 

I have an mc with a variable inside it, and I get that value like this:

 

text_mc.myX = 50;
TweenNano.to(text_mc, 1, {x:text_mc.myX});

 

but I want to get that value without have to name it:

 

TweenNano.to(text_mc, 1, {x:CURRENTMC.myX});

 

Is this possible?

 

Thanks

Link to comment
Share on other sites

i'm pretty sure the tween doesn't know what its target is until after it is created.

if you defined CURRENTMC yourself prior to the tween being created then you could do:

 

var CURRENTMC:MovieClip = text_mc;
TweenNano.to(CURRENTMC, 1, {x:CURRENTMC.myX})

 

 

I'm a little unclear why if you are already defining text_mc as the target, you can' t just use it like you currently are for generating the x value.

TweenNano.to(text_mc, 1, {x:text_mc.myX});

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...