-
addChild() to a container error
Hi,
I created a about_mc, which works like a button. The button is placed on stage1. When I click it, i want it to call another movie from the library and play it.So code inside the about_mc button on frame 1:
var dynAbout = textAbout();
addChild(dynAbout);
it works fine up to here. Now i would like to access the dynAbout, so I will add name to it:
dynAbout.name="dynNameAbout";
then accessing it like that:
MovieClip(parent.root).dynNameAbout.x=300;
When I test it, I get the textAbout() movie added to the scene1 and its playing, but it pops up with an error:
TypeError: Error #1010: A term is undefined and has no properties.
at About/aboutDOWN()
I'm pretty sure that I'm accessing it the wrong way, how should I do it? Pls explain in steps, its my like 1st week of AS
thanks!
Polish
-
Senior Member
MovieClip(parent.root).getChildByName("dynNameAbou t").x=300;
- The right of the People to create Flash movies shall not be infringed. -
-
Originally Posted by cancerinform
MovieClip(parent.root).getChildByName("dynNameAbou t").x=300;
Hi,
That created different error as well, but when i just did
getChildByName("dynNameAbout").x=300
it worked fine, i better go back and read more :/
thanks for help
-
cancerinform,
MovieClip(parent.root).getChildByName("dynNameAbou t").x=300;
how do I access getChildByName("dynNameAbout") TimeLine? its a movieclip. I need to move it to frame 2. Tried so many ways, but i'm failing to access the timeline.
I can access all properties and change them ok, but if I do:
MovieClip(parent.root).getChildByName("dynNameAbou t").gotoAndStop(2);
compiler errors pop up
thanks
-
Senior Member
Try this:
MovieClip(getChildByName("dynNameAbout")).gotoAndS top(2);
- The right of the People to create Flash movies shall not be infringed. -
-
thanks cancerinform
it worked, I had to go one level up as well.
MovieClip(parent.getChildByName("nameSPC")).gotoAn dStop(1);
also, I've managed get it getChildAt(). Looks like it's working, funny enough I needed a day of rest to clear my mind
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|