Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 5 of 5
  1. #1

    Default linking buttons in a movie clip

    I made an animated menu for a website I am currently working on. (http://osoclan.tk)

    Anyways, I am replacing all the buttons (which all work when not in an animated menu). When you roll over the main menu button (which is the movie clip). The buttons roll down fine, but I cannot link the buttons properly. The only buttons that DO work in that menu are ones that go to other URL's.

    I have four buttons in it that SHOULD link to different stopped frames in the MAIN movie. Like I want one button to link to the first frame in the main movie, another one links to frame 3, another to frame 5, and another to 7.

    So I guess the main question is what action script do I put on those buttons in the movie clip of the animated menu to go to different frames in the main movie timeline?

    Any and all help is appreciated.

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Put frame labels on each frame you want to target and then from each button.....

    Object code.....

    on(release){
    _root.gotoAndStop("frameLabel");
    }

    Frame code.....

    _root.buttonName.onRelease=function(){
    _root.gotoAndStop("frameLabel");
    }
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

  4. #3

    Default

    you sir, are a genious!

    Thank you very much. I was really busy the last week, and just got around to trying it, and sure enough within 20 minutes I have the website up and running with the new menu!

    I cannot thank you enough.

  5. #4

    Default

    Hi NTD,

    I notice that this post is over 2 months old but I'm stumbling across the same problem. I'm trying to link a button to another frame (not URL) and I tried applying your code and it's not working. Ok let me just take a moment and explain what I'm doing. I'm currently using a Swish Max program for flash. You can create buttons, sprite for action, scenes for a new set of actions.

    I create a button that has an UP / Over / Down / Hit state. You can insert images or sprite into each state. The program won't let me insert frames into any of the button (UP / Over / Down / Hit) states. I can't set a frame to the image either. So I had to create a sprite in order to create frame and set a label to it. Then I inserted the image that I wanted the hit state of the button to change into, into that sprite. I inputed this code into the sprite:

    onFrame (1) {
    setLabel("Final Fantasy WP");
    }

    After that, I imported the main image into the outline. I added a button to the image. Then I changed the image in the hit state so when you click on the button, it would turn into another image. The problem is whenever I run it and I click on the button, the image would change but it won't stay permanent. So I tried inserting the sprite with the code above into the hit state. Then I went back to the main button that controls it and implemented the code you listed:

    on(press){
    _root.gotoAndStop("Final Fantasy WP");
    }

    _root.Final_Fantasy_WP.onPress=function(){
    _root.gotoAndStop("Final Fantasy WP");
    }


    I'm not sure if I inserted the code correctly. The code you a had before was:

    _root.buttonName.onRelease=function(){
    _root.gotoAndStop("frameLabel");
    }


    Is the "buttonName" the name of the file or name of the frame? The name of image file I had was "Final Fantasy WP.jpg". Of course, the actual image file name would probably be "Final_Fantasy_WP.jpg" with an underscore. So I tried running it with that code and sadly, the hit state of the button still didn't change permanently as it returns to the previous image displayed before I clicked on the button. I hope you can help me out. Any help you can provide will be greatly appreciated.

    ~ PJ

  6. #5
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    I've never used SwishMax so not sure how much help I will be. I am also a bit unclear on what your trying to achieve. First, the code sampe I posted uses the frame label as a target.......
    Code:
    myButton.onRelease=function(){
    _root.gotoAndPlay("frameLabel");
    }
    "frameLabel" would be replaced with the actual label you put on your frame.

    It sounds like your trying to make a graphic appear when a button has been pressed. By putting content on the button frames, the button methods will not allow the button timeline to stay at the down frame. If you want to make a graphic appear on press, the easiest way is to use another movieclip and toggle the _visible property of that movieclip from the button.....
    Code:
    myButtonGraphicMC._visible=false;
    myButton.onRelease=function(){
    _root.gotoAndStop("frameLabel");
    myButtonGraphicMC._visible = true;
    }
    hope it helps
    NTD
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Buttons with reverse Clip sequences
    By pmazz in forum Flash Scripting
    Replies: 1
    Last Post: 03-17-2007, 06:14 AM
  2. Linking to an HTML anchor using flash buttons
    By dntchaseme in forum Flash Scripting
    Replies: 1
    Last Post: 10-20-2005, 09:11 PM
  3. Replies: 1
    Last Post: 09-03-2005, 07:13 PM
  4. linking movie to another page
    By staceyrae.k in forum Newbies
    Replies: 2
    Last Post: 07-23-2005, 10:19 PM
  5. buttons in a movie clip flashmx2004
    By force in forum Newbies
    Replies: 1
    Last Post: 04-19-2005, 01:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial