the name of a movieclip used by getChildByName() is the value that's in it's
myMC.name property. When you place something on the stage manually and add a
name into the properties dialogue box, it's this that you're affecting

a

On Wed, Jun 17, 2009 at 1:33 PM, Cor <[email protected]> wrote:

> Hi Kurt,
>
> How do you load youe swf into your myMC?
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Kurt
> Dommermuth
> Sent: woensdag 17 juni 2009 13:57
> To: 'Flash Coders List'
> Subject: [Flashcoders] understand getChildByName
>
> Hi All,
>
> New to AS3.
>
> I'm sure I must be missing something obvious, but I'm at a loss.
>
> Example:
>
> I have created a movie clip - called "myMC". I added it to an existing
> movie
> clip called "main" (main.addChild(myMC)).
>
> At this point myMC traces as [object MovieClip].
>
> I load an as2 swf into myMC.
>
> At this point myMC traces as [object MainTimeline].
>
> I change myMC's y value to 100 and it traces as 100.
>
> Later I want to move it again.  To reference it I create a variable like
> this:
>
> var mc:DisplayObject = main.getChildByName("myMC");
>
> Now when I trace mc's y value it is 0.
>
> I don't know why.
>
> Does the trace [object MainTimeline] indicate that I've used addChild
> incorrectly?  Should I have added myMC to "main" after it had loaded?  Why
> did it go from a MovieClip object to a MainTimeline object?
>
> Does the fact that I'm loading in an as2 swf have anything to do with it?
>
> Any help would be appreciated.
>
> Thank you,
> Kurt
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to