A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Accessing clips created with attachMovie

  1. #1
    Senior Member
    Join Date
    Dec 2003
    Posts
    188

    Accessing clips created with attachMovie

    Hi,

    I have a question as to how I would go about accessing the movie clips I'm creating with the following code:

    PHP Code:
    for (i=0i<totali++) { 
        
    _root.attachMovie("thumbButton""thumb" ii);

    This creates movie clips labeled "thumb1", "thumb2", etc. How would I go about accessing these movie clips?

    IE: In the same for loop I want to call .loadMovie from each of them.

    thumb1.loadMovie("images/1_gallery_1_thumb.jpg");

    How do I dynamically get the 1 in there?

  2. #2
    Senior Member Dricciotti's Avatar
    Join Date
    Aug 2002
    Posts
    2,988
    Code:
    for (i=0; i<total; i++) { 
        BOB=_root.attachMovie("thumbButton", "thumb" + i, i);
        //now you can identify it as "BOB"
        BOB.onEnterFrame....
    
    }

  3. #3
    See-n-reMember azwaldo's Avatar
    Join Date
    Mar 2003
    Location
    Sonoran Desert
    Posts
    745

    'iterate' the reference

    you can 'iterate' the object reference like this:
    Code:
    for (i=0; i<total; i++) { 
        _root.attachMovie("thumbButton", "thumb" + i, i);
        _root["thumb" + i].loadMovie(" url ", level  /  target [ ,   variables  ]) ;
    }
    __azwaldo__

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