[Tweener] Noob Question: Animate Instances Only?
Zeh Fernando
zeh at zehfernando.com
Sun Aug 10 13:58:14 PDT 2008
Well, the instance name is the reference variable. So if someone wants
another name instead, one can always create another reference.
var xx:MovieClip = myMovieClipWithALongName;
Then:
Tweener.addTween(xx, {...});
Instead of
Tweener.addTween(myMovieClipWithALongName, {...});
Same thing.
Wes wrote:
> It sounds to me as if he's asking if he can use a variable instead of
> typing the exact name of the instance.
>
> --- On *Sun, 8/10/08, Zeh Fernando /<zeh at zehfernando.com>/* wrote:
>
> From: Zeh Fernando <zeh at zehfernando.com>
> Subject: Re: [Tweener] Noob Question: Animate Instances Only?
> To: tweener at lists.caurinauebi.com
> Date: Sunday, August 10, 2008, 1:26 PM
>
> > I'm still learning AS3 and Tweener at the same time so please excuse me
>
> > if my terminology is off but hopefully you get what I'm trying to ask.
> > I'm trying to create a class for disabling an animation and I'd
> like to
> > know how to animate something without having to use the instance name. I
> > know the description of Tweener says that it animates instances but is
> > there a way to do this dynamically so I don't have to type in the
> > instance names all the time?
>
> I'm not really sure I get the question - Tweener would have to know what
> to animate, so you need to use the instance name as the reference.
>
> If you're trying to animate the same display object, you can just use
> "this" as the reference parameter since you're inside the object
> already.
>
> If it's a child of the current display object or something that's
> somewhere else, you'd indeed need to use the name, or if you want to do
> that in a more painful way, you could use getChildAt().
>
> // Animates whatever's at level 0
> Tweener.addTween(getChildAt(0), {...});
>
> Or you could always have an array of objects too...
>
> var myobjs:Array = [cube, sphere, pyramid];
> // Animates "cube"
> Tweener.addTween(myobjs[0], {...});
>
>
> HTH,
> Zeh
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
More information about the Tweener
mailing list