A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: on/off music in a button

  1. #1
    Senior Member
    Join Date
    Mar 2000
    Location
    Barcelona
    Posts
    225

    Question

    I've made a button.The action that I want to achieve is the following:when the mouse rolls over the button,I want the music to stop,but in case you don't click that button and the mouse rolls out it,I want the music to play again.How can I do this?.

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,092

    Thumbs up

    right click on the button.
    Choose Properties
    In the Instance Properties in the Actions tab
    you will see

    On(Release)
    Change that to On (Rollover)
    Stop All Sounds


    Click on On End
    add On Mouse Event
    Change On ()
    too On (RollOut)
    Play


    That might do the trick.


    Hope that Helps get back with me and let me know if it does.


    <EMBED src="/cgi-bin/ubb/Members/sigs/00000085.swf" quality=high WIDTH=500 HEIGHT=60 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED>

  3. #3
    Senior Member
    Join Date
    Mar 2000
    Location
    Barcelona
    Posts
    225

    Question

    I've done what you suggested,and if I've done everything ok,when the mouse rolls out the button the action of the movie jumps to the first scene and starts playing all the movie from the beginning.What I would like to achieve is that when the mouse rolls out the button,just the music plays again,and the movie doesn't start playing again.
    Is it possible to do that?.
    Thanks a lot.

  4. #4
    Junior Member
    Join Date
    Mar 2000
    Posts
    20

    Post

    hmmmmm

  5. #5
    Junior Member
    Join Date
    Mar 2000
    Posts
    20

    Post

    k i think i get what you are trying to do

    first make a movie and put your sound loop in that movie and only the sound loop, and loop it how evermany times you want.

    then put that mov into the frame that u want in the scene.

    then in the instance for your the movie with the sound in it label it "sound"

    then on the button instance do this script

    on rollover
    stop all sounds
    end
    on rollout
    tell target "sound"
    play
    end tell target
    end

    try that and i hope it works i know how sound can be fun in flash.

    Nine Lives Courtney Johnston

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