A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: MC's and navigation

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    15

    resolved

    Hi Guys

    Is this the right way to do this.

    I have 5 buttons and want each button linked to a move clip.


    (1) Do I create all 5 buttons in a movie clip ?

    (2) what code do I use with the button to call the MC.

    (3) How do I ensure that the buttons remain visable no matter what MC is called?

    Thanks


  2. #2
    Ambassador of Style
    Join Date
    Feb 2001
    Posts
    597
    1) Yes, this is one approach. You can either place 5 different button symbols in the MC or simply create 1 "invisible button" (created by adding only a hit state) and place instances of it over each graphic symbol. Always place the actions on the instance - not actually within the button states (ie: up, down, etc)

    2) You have a few options - depending mostly on whether you'll be publishing the SWF as F4 or F5. With F4, you must use tellTarget to command the other MC. With F5, you can use tellTarget with root notation. Example:

    You have a MC called "buttons" that contains 5 button symbols. You want the first button to play frame 25 in a MC called "yoyodyne". Make sure to give the MC that instance name!

    F4:

    on (release) {
    tellTarget ("../yoyodyne") {
    gotoAndPlay (25);
    }
    }


    F5:

    on (release) {
    tellTarget ("_root.yoyodyne") {
    gotoAndPlay (25);
    }
    }

    There are other ways to accomplish what you are trying to do, but this is probably the most basic and easy-to-do method and it should suit your needs fine! Good luck!

    -A02

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    15
    Thanks for that reply

    One more question ?

    How do I ensure that the buttons will remain on the screen

    For each mc that is palyed ?

    Thank you

  4. #4
    Ambassador of Style
    Join Date
    Feb 2001
    Posts
    597
    Think of the stage in terms of HTML framesets. Place the MC with the buttons where you want - and then have the MC's appear where you need them to. I highly recommend not using scenes and simply placing each MC on its own layer. See image below:



    Excuse the cheese-factor of this - I whupped it up in like 5 minutes. Basically, image the blue area is your MC with the buttons. Note how it spans the length of the movie timeline. This means that no matter where the playhead is - the menu will always show.

    The pink box you can imagine as a MC section. Notice how they are only "active" on the stage for certain periods of time. There are stop actions at the end of each 10 frame segment to stop the playhead.

    You can use the same principles to do things within that MC as well, by giving the MC an instance name and using tellTarget like I posted earlier. Hope this helps!

    -A02




    [Edited by AGENT 02 on 10-17-2001 at 05:05 PM]

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    15
    Thanks AO2

    I will try that , If you still ahve that FLA handy could
    you send it on to me gkb@oceanfree.net, It would be a big help , If its not to much hassle !!

    Once again Thanks !!!!!

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