A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: On/Off button Driving me mad!!!

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    2
    heres the deal....doing an interactive mixer/turntables. I want the left table to start playing a beat on mouse over, and continue to play until you mouse OVER a second time, then stop. I guess it would be the same as an on/off effect, no clicking involved.
    Ive tried everything i know, any input would be welcome!! THanks!

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    maybe you could try something like this,

    at the begining in frame action set a variable playing = false;

    then in the button

    on (rollOver) {
    if (!playing) {
    playing = true;
    // start beat
    } else {
    playing = false;
    // stop beat
    }
    }

  3. #3
    Senior Member estong's Avatar
    Join Date
    Nov 2000
    Location
    philippines
    Posts
    157

    hmmmmmmmmmmm

    have u tried putting in a counter script inside the button action?;say: On(roll over)
    y=y+1 //this is ur counter so dat everytime a
    mouseover is done it sums up
    if y=2 //check f 2 mouseover action was done
    {assign desired action f 2 mouseover action
    was done}
    end if

    hope this helps

  4. #4
    Mrs Rabbit Jessica Rabbit's Avatar
    Join Date
    Apr 2002
    Location
    London, UK
    Posts
    132
    Or use one instance of the button with a play command and one instance with a stop command.

  5. #5
    Junior Member
    Join Date
    Mar 2002
    Posts
    2
    i tried the first two solutions, and although I understand the theory, I kept getting out errors....*sigh*
    Im an action-script n00b, so you know my frustration here.

    The button is comprised of a movie clip in the button keyframe "over" that is set to loop continusely. Maybe this is where im messing up. Becasue the result im getting is that...
    When you mouse over, music and animation starts. When you mouse out the animation stops and the music continues.
    What i want it to do is...
    When you mouse over, music and animation starts. When you mouse out animation and music continue, until you mouse over a second time and then animation and music stop...

    Im thinking the counter idea will be the one that works....now if i could only get the actionscript right!! If you could post the script like it should be written it would be a big help, because it seems sme fo the stuff was out of place in the last post....THnaks A lot everyone!

  6. #6
    Senior Member estong's Avatar
    Join Date
    Nov 2000
    Location
    philippines
    Posts
    157

    hmmmmmmmm

    wat version of flash are u using? im using flash 4 though
    but f ur using higher flash version, u can post ur script that u came close, here so i and everybody else in the forum can help diagnose the problem=)
    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