A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: please help -- duplicating mc's to have unique buttons

  1. #1
    Member
    Join Date
    Aug 2000
    Posts
    75

    please help -- duplicating mc's to have unique buttons

    I am trying to make an updateable gallery by duplicating movie clips, and having each movie clip act as a button that when pressed willl load an image into an imageHolder. I cannot seem to assign a unique variable to each new movie clip. This is the script I have so far...

    // make the duplicated MC invisible
    this.button_mc._visible=0;

    //the current movie being duplicated
    current=0;
    //how many buttons needed
    imageCount=5;
    //the space between each button
    yIncrement=22;
    // the initial offset
    yOffset=this.button_mc._y;

    this.onEnterFrame=function(){
    if (current<imageCount){
    var y:Number=current*yIncrement;
    this.button_mc.duplicateMovieClip("button_mc"+curr ent, current);
    this["button_mc"+current]._y+=y;
    this["button_mc"+current].loadMovie("images/wedding/thumbs/image"+[current+1]+".jpg");

    //this is where I am having a problem...
    this["button_mc"+current].loader=["image"+current];

    ++current;
    } else {
    }
    };


    any help is greatly appreciated.
    Andrew Bartja
    the undisputed welterweight champion of the world

  2. #2
    Flash programmer
    Join Date
    Jul 2005
    Location
    Sweden
    Posts
    48
    I don't really see what you are trying to do at that line. It seems like you only want to assign a value to that variable, and in that case just write:

    Code:
     this["button_mc"+current].loader="image"+current;
    Hope that works, good luck.
    Have a nice day - The Wazaa
    My portfolio

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