dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Roll over states

  1. #1
    Junior Member
    Join Date
    May 2001
    Location
    Some where in my head
    Posts
    11

    Roll over states

    I'm trying to create bouutons w/ over states that stay until you click another botton, can anyone point me to where I can find the code?

    Thanks.

  2. #2
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431
    A good method is to use movieclips. You can either recreate your button as a movieclip or put the button inside a movieclip on frame 1. On frame 2 have the clicked state graphic (no actual button, unless you want it to still have functionality). Then add the following code to your button.

    Code:
    on (release){
       tellTarget(_root.button1){
          gotoAndStop(2);
       }
       tellTarget(_root.button2){
          gotoAndStop(1);
       }
       tellTarget(_root.button3){
          gotoAndStop(1);
       }
    }
    Here I assumed you had three buttons inside three movieclips called "button1", "button2", and "button3". You can of course name these whatever you want. The firs tellTarget command set's the button you clicked, in this case button1, to it's clicked state. The next 2 tellTarget commands set the other buttons to their "clickable" state. In reality only one of these buttons would be clicked at a time. However, unless you want to use variables it's easier to just put all the possible required code in a single statement.

    Hope that makes sense. If not let me know and I can whip you up a quick demo.

  3. #3
    Junior Member
    Join Date
    May 2001
    Location
    Some where in my head
    Posts
    11

    I kinda understand

    I'm new to this and a demo would really help me.

    Thanks.

  4. #4
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431
    Here ya go!
    Attached Files Attached Files

  5. #5
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431
    In that demo there are three movieclips each two frames long. On the first frame of each movieclip is a button. On the second frame is a graphic.

    Each of the movieclips' instance names are the button they have within
    them, "button1", "button2", "button3".

    On each of the buttons is three tellTarget commands which tell the three movieclips to either go to frame 1 or frame 2 depending on which one is clicked.

    Hope that helps!

  6. #6
    Junior Member
    Join Date
    May 2001
    Location
    Some where in my head
    Posts
    11

    Dude you rock

    Thanks for taking the time to show me an example, I understand it fully now.

    I'm a designer - traditional and nontraditional - if you need any help with any design let me know.

    Thanks

  7. #7
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431
    Most welcome, I'm also a designer. Although as of late I've become more and more of a Flash developer...

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