dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dynamicly referencing movieclips

  1. #1
    cake! Skribble_Style's Avatar
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    550

    Dynamicly referencing movieclips

    Hello. I'd like to know how I can achieve this in AS3. The code would work fine in AS2, but as I am very new to AS3 I am not sure what the equivalent would be in AS3. Thanks!
    code:

    humanNum = 1;
    MC = ["Human"+humanNum];



    As you can see I can just easily change "humanNum" to a different number to reference different movieclips - Human1, Human2, Human3, etc.
    However I can not do it this way in AS3.

    Thanks in advance!
    Last edited by Skribble_Style; 11-28-2011 at 06:32 AM.
    Skribble

    Its not that im lazy, I just dont care.

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    391
    If those MovieClips already exist and are on the stage, then
    PHP Code:
    MC containerOfThoseMovieClips.getChildByName ("Name of the MovieClip"); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center