A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [F8] Easier way to replace MCs than attachMC?

  1. #1
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392

    [F8] Easier way to replace MCs than attachMC?

    I have a place holder MC, inside of which are several other MCs. I also have alternate MCs on stage at various spots. My goal is to "build" one "master" MC with a mix-n-match type of application.

    okay... picture a snowman.. 3 circles on top of each other, one bigger than the next. This is my "default master" MC. Each circle is yet another MC. Now around the stage I have triangles and squares and whatever.

    If you click on a triangle I want it to replace the top circle in the default master MC. Then you can "choose" how your snowman looks. a triangle head, a large square middle and a tiny circle bottom... etc...

    Right now I am using emptyMCs as the place holders inside the master MC, but the coding is getting out of hand. Is there a more simple method to swap MCs, whereby each old MC would be removed from the Master MC, not just covered up?

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

  2. #2
    Junior Member
    Join Date
    May 2007
    Posts
    18
    Quote Originally Posted by MasterofNothing
    I have a place holder MC, inside of which are several other MCs. I also have alternate MCs on stage at various spots. My goal is to "build" one "master" MC with a mix-n-match type of application.

    okay... picture a snowman.. 3 circles on top of each other, one bigger than the next. This is my "default master" MC. Each circle is yet another MC. Now around the stage I have triangles and squares and whatever.

    If you click on a triangle I want it to replace the top circle in the default master MC. Then you can "choose" how your snowman looks. a triangle head, a large square middle and a tiny circle bottom... etc...

    Right now I am using emptyMCs as the place holders inside the master MC, but the coding is getting out of hand. Is there a more simple method to swap MCs, whereby each old MC would be removed from the Master MC, not just covered up?

    ~MoN
    Hmm.. one thing I can think of is to just have multiple states of the snow-man's movie clip parts and, depending on which one is selected, that will change. For example...
    code:

    triangleOption.onRelease = function(){
    snowmanHead.gotoAndStop(2);
    }//end onRelease


  3. #3
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392
    Thanks! That sounds like what I want..

    Would I need to add or change anything if I want to keep the selected snowman to use later?

    Like the snowman you build is the main character for the rest of the movie, do I need to use SO for this or set a var to remember the selections?

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

  4. #4
    Junior Member
    Join Date
    May 2007
    Posts
    18
    Quote Originally Posted by MasterofNothing
    Thanks! That sounds like what I want..

    Would I need to add or change anything if I want to keep the selected snowman to use later?

    Like the snowman you build is the main character for the rest of the movie, do I need to use SO for this or set a var to remember the selections?

    ~MoN
    Hmm... well... One thing you could do in that case is to perhaps set up a variable in the above if statement that you can use as reference for later.

    [AS]

  5. #5
    Eternal Newbie
    Join Date
    Apr 2006
    Location
    Bitter cold Hell of the crappy NW
    Posts
    392
    I didn't think about that I will play around with that and see what I can come up with.

    Thanks again!

    ~MoN
    If I am wrong, please just correct me and move on.. there is no need for all that pointing and laughing! ~MoN

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