Welcome, Guest
  • Author Topic: open new mc from button within an mc on stage  (Read 1257 times)

    Leanne

    • Server what's that
    • *
    • Posts: 5
      • View Profile
      • Email
    hi everyone,

    I have a nav bar that has been turned into a movie clip. From the help button in the nav bar, I want a new help window to appear. Does anyone know how this is done? The new help window is a movie clip. From the button in the original nav bar, I added this code

    on (release) {
    tellTarget ("help_window") {
    }
    }

    I know this is probably way off target. I haven't added the help window into the main timeline, because it doesn't appear until the help button has been clicked. Is there a way of making the button link to the library? Or a way to insert the help mc into the main timeline, and make it invisable until the help button has been clicked?

    If anyone could help, I would greatly appreciate it. :)
    By the way, I am using flash 5, if that makes a difference.


    Susana

    • Server what's that
    • *
    • Posts: 13
      • View Profile
      • Email
    Re:open new mc from button within an mc on stage
    « Reply #1 on: 04/01/04, 08:33 »
    In order to be able to interact with a MC, you must put it on your stage and give an instance name to it.
    As you don't want your MC being visible from the start, you can let the first frame of your help MC empty (just with a stop() in the frame script).
    In the second frame, you can place a label (i.e. "begin") and put the content of the new window.
    Let's name the instance of your help MC: myHelpMc. The script on your button should be:

    on release() {
      _root.myHelpMc.gotoAndStop("begin");
    }


    If you want to close your help window, you should have another label on your help MC to make it invisible (i.e.: "end"). This frame have to be the same as first frame (just with the stop() action on it and nothing more)
    If you have a button to close your help window, you can place the following script on it:

    on release() {
      _root.myHelpMc.gotoAndStop("end");
    }

    Thus, making it invisible again.

    There is another way to get it, if you want to load your help window just at the time you push your button. In this case, you have to have a container MC on wich you load your new movie (the one that contains your help MC). When you want it to close, you have to unload the movie (commands loadMovie and unloadMovie)


    I hope this is of any help