Quick question about accessing a movieclip!

so im inside my movieclip called “blah” (instance name the same), and i’m writing some code in the timeline of “blah”.

with this code i want to tween a movieclip (called “info”, instance name also “info”) which is directly on the stage (not in the movieclip “blah”)

i tried


TweenLite.to(_root.info, 3, {alpha:0});

and


TweenLite.to(stage.info, 3, {alpha:0});

but i cant get it to work. how do i do it? its quite urgent, thank you for your help :wink:

hierarchy:


|------my stage 
          |--------scrollbox_main (MovieClip)
                               |----------blah (MovieClip)

          |--------info

“info” is on the same level as “scrollbox_main” and i want do access it out of “blah”

i read a tip from senocular, i think its about my problem

but i just dont get it … i dont know how to use this for my project :frowning:

try


TweenLite.to(parent.getChildByName("info"), 3, {alpha:0});

don’t have flash here, but should work…maybe a typo or so.

hth
Carlo

this code works:


TweenLite.to(parent.parent.getChildByName("info"), 3, {alpha:0});

thank you!

but why does “TweenLite.to(parent.parent.info, 3, {alpha:0});” not work?? just curious…

Happy that It works.

if you enter parent.parent.info flash expects a variable called info in the object parent.parent (which would be your stage) but you don’t have an variable called info which represents a Movieclip there, that’s why flash has no idea what to do.
If you want to address a displayobject by name you always have to use getChildByName which returns a reference to the displayobject.

(Hope I didn’t say to much crap here, fairly new with AS3 myself)

Cheers carlo