A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: adding movie clip with array.

  1. #1
    Member
    Join Date
    Aug 2007
    Posts
    32

    adding movie clip with array.

    I have a function shuffling a array of numbers.

    How can I have each number correspond to a movieclip?

    Like if I have the number 4 comup first in my array, how can I have movieClip4 show up onto the screen?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    import flash.utils.getDefinitionByName;
    var myArray:Array=new Array(1,4,2,5);
    var MyClass:Class=getDefinitionByName("movieClip"+myAr ray[1]) as Class;
    var mc:MovieClip = new MyClass();
    addChild(mc);
    - The right of the People to create Flash movies shall not be infringed. -

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