A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: Masks

  1. #21
    Senior Member RhameJ's Avatar
    Join Date
    Aug 2003
    Ok. I fiddled around with the code for alittle bit and I didnt quite understand what you where doing. But I got it. The easy way was just to junk all that button code crap. Just have a gotoAndstop on a frame action.
    What I did. I added a frame 6 to the main stage. On that frame I made sure the buttons where not there.
    On btn1 I gave the code.

    on (release){
    gotoAndstop(6); //thebuttons are not on frame 6

    On the close button I gave the code

    on (release){
    _root.gotoAndstop(2); //the buttons are on frame 2

    You will notice 2 extra things I did.

    One: I added a layer caled emptyClip
    Lock all the layers except this one. Find the little dot just to the left and above of where btn1 is. Notice that I gave it the instance name "mtClip" in the properties inspector.
    This movieclip has absolutely NOTHING in it. Its just that, an emptyclip. This will load an external .swf with the cords being the top left of the movie loaded.

    Two: I resized the catrabajo02.swf to be only the size you need it to be. You may have to move around some of the text number again, I didnt feel like messing with it.

    Having a .swf loaded like this gives you more control over where you want to palce it on the stage.

    Last thing. If the Main stage loads the "services.swf", and services has the emptyclip on it, which it does now, then you will need to change _root to _parent to get the .swf to load.

    For example.
    I have "ONE" movie, my main stage. I drag an MC that has a button on it to the stage. If I have actionscript on that button that says

    on(release) gotoAndstop(3);

    The MC will go to and stop on frame 3. Not the main stage.
    If I change it to this

    on(release) _root.gotoAndstop(3);

    Then the main stage goes to and stops on frame 3.

    Same thing applies to loaded .swf's.
    If I want the main stage to do something, then I need to be specific and tell it what it is that I want done.

    Say you have an MC like the the little button circle you made that spins.
    If I give that MC a name in the properties inspector called "circle"
    and place that MC on the main stage, and want to make it spin from a button that is in a .swf that has been called onto the stage via an emptyclip. The AS would be.

    On (rollover){_root.circle.play();
    On (rollout){_root.circle.stop();

    If the circle MC is in the .swf that is called onto the main stage via an emptyClip, then I would change _root to _parent.

    You getting it now?

    Attached Files Attached Files

  2. #22
    Join Date
    Mar 2004
    excellent, I get it very well, I had some idea about "root" and "parent" commands, but I couldnŽt remember them. IŽll try all of these and tell you if ti worked; IŽm sure it will.

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