A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to get GotoAndStop to work on all duplicated MCs

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    3

    How to get GotoAndStop to work on all duplicated MCs

    I have a simple bit of AS which duplicates MCs via looping through a couple of frames:

    _root.tile.duplicateMovieClip("tile"+i,i+1)

    What I would like to do is to use a button to move each duplicated MC from frame 1 to frame 2, hence changing the appearance of ALL duplicated MCs.

    I have tried a simple action on a button:

    on (release) {
    tile.gotoAndStop(2);
    }

    but obviously this only changes one MC - the first one, and none of the duplicated ones.

    Please can someone advise about the correct syntax to impact on all duplicated MCs?

    Thanks

    Jim

  2. #2
    FlashCLUE.com Wizzz's Avatar
    Join Date
    Nov 2005
    Location
    Warsaw Poland
    Posts
    451
    on (release) {
    for( var i=first_tile_i; i<last_tile_i; i++) _root["tile"+i].gotoAndStop(2);
    }

  3. #3
    Junior Member
    Join Date
    Nov 2005
    Posts
    3
    Thanks Wizzz, for the advice.

    I have tried that, but unfortunately it doesn't work.

    If it's not too cheeky, I have uploaded the file I am working on:

    swf: http://jimpix.co.uk/thanks2.swf
    fla: http://jimpix.co.uk/thanks2.fla

    The green bar at the bottom is the button which has the action on you posted on this thread. The idea was that it would move the duplicated m/cs to frame two, and in doing so change their color from green to black.

    Any advice much appreciated!

    Thanks

    Jim

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