A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: array to attach movie clip

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    i have an array (this is just a test)
    Code:
    map = new Array();
    map = [[1], [2], [3]];
    and i want some code that goes through it and if it = 1 attach movie 1 or if it is 2 attach movie 2 and so on??? how is this done??

  2. #2
    Member
    Join Date
    Oct 2001
    Posts
    44

    Unhappy

    Try this one:

    Code:
       for (var k=0;k<=map.length;k++){
           if (map[k]==1){
                attachMovie(movie1,new_movie1_name,depth); // movie1
            } else if (map[k]==2){
                attachMovie(movie2,new_movie2_name,depth); // movie2
            } else if (map[k]==3){
                attachMovie(movie3,new_movie3_name,depth); // movie3
            }
        }
    or you can use other loops...like while() or do{...}while()

    Good luck
    ZeroIQ

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    sorry it still does not work so could you do me a fla???

  4. #4
    to attach a clip you need to:
    right click it in the library, choose "linkage" , choose to export it and type in an ID for the clip. you use that ID when you call the attcach command. if you're using the symbol name it wont work. Then like zeroiq wrote
    attachMovie(ID,new_movie1_name,depth); // movie1

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