Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Why Are The Sounds That Are Set To Play On Roll Over Also Playing On Click?



I can't figure this out. The home button works perfectly, the other buttons arn't working the same way. I don't want to use stopallsounds, because I am going to be adding in sounds on click and I don't want stopallsounds to be interfering. When I had the other buttons the exact same way as the home button the other buttons would play the sound continuously. I changed them and now the best I can do is that they play once on roll over, but will play once when I click as well, which I of course do not want. I want to get rid of the sound playing on click. Thank you.



FlashKit > Flash Help > Flash General Help
Posted on: 06-22-2004, 10:24 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Why Are The Sounds That Are Set To Play On Roll Over Also Playing On Click?
I can't figure this out. The home button works perfectly, the other buttons arn't working the same way. I don't want to use stopallsounds, because I am going to be adding in sounds on click and I don't want stopallsounds to be interfering. When I had the other buttons the exact same way as the home button the other buttons would play the sound continuously. I changed them and now the best I can do is that they play once on roll over, but will play once when I click as well, which I of course do not want. I want to get rid of the sound playing on click. Thank you.

Click And Play Sounds
Hi everybody!

How do I get flash to play a specific sound when I click on a button?

[MX04] How To Stop Video From Playing Automatically Until User Click A Play Button?
I am using Flash MX 2004.

I have made a video player from scratch and not from the pre-baked components.

I have the video player with a play/pause button, rewind button, a loader, buffer, mute button, etc.
The flv. Videos load into a list box via an xml file which then the user can click the desired video link and switch from video to video.

Using action script I want to know how to stop the video from automatically playing until the user clicks a play button when the player first opens.


var nc:NetConnection = new NetConnection();

nc.connect (null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns)




rewindButton.onRelease = function()
{
ns.seek(0);
}

playButton.onRelease = function()
{
ns.pause();
}

Roll Over Sounds..HELP
i am trying to make a layout with sounds and when i roll over an image i want it to make a sound i also want it to make a sound once you click it HELP ME PLEASE

Roll Over - Different Sounds Each Time?
I wanna make a movieclip, that's activated by the mouse - on roll over. Each time it'll play a different sound and eventually it'll send you to another page (it's a little gimmick!) - Does it make any sense???!
Anyway - how do I do that?
I'm a bit of a newbie, so nothing too complicated please! :-D

Stop All Sounds On Roll Out ?
Hi guys im new here ,,
forgive me 4 my poor english language cuz im an Arabic ..

i just want 2 ask u guys about this !!

http://www.riffavip.com/up/uploads/c8eb6fec12.jpg

if u cant see the pic press here : http://www.actionscript.org/forums/a...1&d=1153513638

this picture is from Macromedia Flash MX 6

how can i find these options in Macromedia Flash MX 2004 ??? i just download it & im lost !! its actions r totally diffrent !!

or action scripts 4 buttons. thats when i move the mouse away from the flash (SWF) the sounds stops and when i roll it over it begins again!!

also can you help me 2 find more actions script for texts?? i have difficulty to search in english ,,

thanx ...

Roll Over And Click Actions
I have made a button in which I have placed separate movie clips for the over and down states. The problem is that when the button is clicked the mc for the over state is also in action. Hence the 2nd mc for the down state cannot be seen.

I had tried to put the button on the main scene without the mcs' in the over and down states. I put both the mcs' in the main scene. For the button rollover action I wrote the following code:

on (rollOver) {
with (mc_home1) {
play();
}
}

However, the problem with this is that the mc starts playing as soon as the movie loads. I want it to play only when the mouse rolls over the button. And the 2nd movie to play when the button is clicked.

Can somebody please help in achieving the following:

on mouse rollover
mc_home1
should play.

on clicking the button
mc_home2
should play.

I am attaching the .fla file. I am on Flash MX.

Thanks!

Stop All Sounds = Play All Sounds
Ok, I'm pulling my hair out

I have 3 movies Layered togehter.
1- Sound file with someone speaking
2- Index moive that loads the Sound file
3- Sound On/Off button

On the Sound On/off moive I would like the button to stop all sounds and then continue playing the same sounds when clicked one again. (Basically pick up where the animation currenlty is.)

Attached is what I have been currently trying. I stops the sounds, but dose not continue to play when - click to start the sound again.

What gives GGGGRRRRRRRRRRRRRRRRRRRRRRRR!

Play Sounds After Stop All Sounds
Dear all,

I have a question which I hope someone can answer: my flash animation starts immediately when a visitor comes to the page. I have a stop button which stops the animation and the sound which comes with it (speaker voice). A play button plays the animation after the stop button was pressed. But the play button only plays the animation, not the speaker voice. How do I do this? I want the sound to start were it was stopped, just like the animation.

I'm using Flash mx 2004, version 7.2

Thanks in advance for your replies

/Bo from Sweden

I Can Play Sounds From Xml. How Do I Only Play One Sound At A Time... Kill The Other
Code:
var mysound:Sound = new Sound();
mysound.loadSound(arVocab[_global.nCurrentWord-1][6], true);
This will play a sound but when I go to another question in my test the old sound still plays while the new sound starts.

How do I kill the old sound? When the new sound loads?

Glen Charles Rowell

Rollover MC Won't Stop Playing If I Roll Out To The Top Left.
I'm working on a current Flash 5 site and I've got the client's logo on the top left, like most sites. I've also got a rollover effect that when rolled over a MC starts playing with sound and then stops on rollout. Works fine unless I roll out to the top left off the browser's window. Very strange. Why is this happening?

Here's my current script for my button (the logo):

on (rollOver) {
_root.logo.gotoAndPlay("in");
}
on (release) {
gotoAndStop("home");
loadMovie("main.swf", "main");
}
on (rollOut) {
_root.logo.outRoll();
}

Roll Over Playing Movie Clip From Begining
I have created a button. I want to play a movie clip when we move the mouse over the button. The button is inserted from frame 1 to 60.

I have inserted the movie clip just over the button and made the movie clip invisible (alpha - 0) so that it is not visible when the movie is playing. Movie clips name is "wanaka"

And I have inserted the following script in the button.

on (release) {
_root.gotoAndStop("mainprize");
}
on (rollOver) {
gotoAndPlay (_root.wanaka);
setProperty ("_root.wanaka", _alpha, "100");
}

Now the problem is that when put the mouse over the button the movie clip becomes visible but does not play from the begining.

Is there any solution, so that when we put the mouse over the button, the movie clip plays from begining

Please help me

How Do I Check To See If A Sound Is Already Playing Before Playing When Pressing Play
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.

heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusc.

ActionScript Code:
on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}
Thanks

Strange: My Code Only Works Once When I Click, But Again If I Roll Off And Back On Th
Strange: My code only works once when I click, but again if I roll off and back on the button.

Any advice?


Code:
btniPoints.onPress = Points;
function Points() {
_root.score += 0.5;
}

Want To Play A Mc When I Roll Over It
I want to play a mc when I roll over it. Inside the mc there are buttons that load after the roll over. Here is my AS:

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
tellTarget (guest) {
nextFrame();
} else {

prevFrame();

}
}
}

I am trying to unload the mc when I roll Out by using the else, but I can't get it to work. Can someone help on the AS.

Getting A Button To Play On Roll Out
i have a button where on the "over" frame ther is an mc with a little animation on it. When u roll off the button i want the MC thats played on roll over to play (but frames reversed). i have copied the animation, pasted them after the Stop action and choose Reverse frames. Now all i need 2 do is put an action on the button that tells it to play again on roll out. How would i do this as this doesnt work (Target not found: Target="home button slider" Base="_level0"):

on (rollOut) {
tellTarget ("home button slider") {
play();
}
}

please help
cheers
jh

Roll Over Play Button
I have a online seminar I am putting together and I want the PLAY button to change to a pause when I click to stop the slideshow, and then change back when they click it again to play the movie. I created a movie that I would place inside the button with 2 frames. The 1st frame is the pause symbol on the keyframe I added the script

onclick gotoAndStop(2);

2nd keyframe is the play. It has the script

onClick gotoAndStop(1);

Now how could I get this to work in the button? I have tried a couple things but no go. I hope someone can help me .

Thanks

JCF

Play An Image When Roll Over
can someone please help me!

I have a button that is on a scrolling tool bar and when someone rolls over it I want an image to appear in the main area of the screen. I have tried to incorporate the image in the over state of the button but the image scrolls with the tool bar as well. Want i want to do is roll over the image in the tool bar than a larger image appears above the toolbar. HOW DO I DO IT???

it has to be simple like:

On rollover play image (graphic,movie) x

as long as the image doesn't move with the toolbar everything will be fine!

On Roll Over Play Sound
Basically its a 200 x 200 box. When the user mouses over the box, play a sound, when they mouse off, stop the sound.

I cant get it working, can someone else have a go and get back to me

[MX04] Click A Button Once To Play, Then Again To Play In Reverse
Alright, so I've got this MC that is set up to play 2 other Movie clips upon being clicked, and what I would like to have happen is; upon clicking this MC again, these 2 other movie clips will being playing in reverse, and if clicked again will play forward, and so on ad infinitum.

I've attempted to do this by having this code in the first frame of the "button" MC, in a separate actions layer.


PHP Code:



stop();

this.onRelease = function() {
    gotoAndPlay(2);
    this._parent.wing1.play();
    this._parent.wing2.play();
};




And this code on the second frame.


PHP Code:



stop();

this.onRelease = function() {
    gotoAndPlay(1);
    this._parent.wing1.prevFrame();
    this._parent.wing2.prevFrame();
};





As of right now, this will simply play the two movie clips upon clicking, stop them and reverse them a single frame, when clicked a second time, then begin playing them again from that point if clicked a third time.

Once the two MCs finish reach their final frames, the button does nothing.


Any help would be appreciated.

Movie To Play On Mouse Roll Over
I need some help to get a movie to play when I do an onroll over for a button?

Thanks

Buttons That Play In Reverse On Roll Out
how do you make a button that animates on the rollover and then animates in reverse on the roll out??? i can't seem to figure it out...

Making A Movie Play On Roll-over
I have created a simple rectangle and made it a movie clip. I am trying to get the rectangle to be animated on roll-over of that same rectangle. Attached is my example file.

Could someone let me know what I'm doing wrong? I know it's an actionscript issue.

THANKS!

On Roll Over, Play Timeline Backwards
What do I need to do to a button to make the timeline it is in to play backwards when you roll over the button, but stop when you roll out? I've been searching the forums, but can't find it.

Want Movie Clip To Play On Roll Over
I have a few buttons in my site and when i roll over a button i would like it to play a movie clip i have created. my movie clip is in my library, not on my stage. what is the script i need to add to the button to get it to play on roll over. and when u roll off it unloads the movie clip??

hope someone can help me.

thanks.

A

Making Movies Play With Roll Over
Does anyone know how to make a movie roll over button, that will start and stop were you left off. here are some examples:

http://www.fabchannel.com
http://www.diddy.com/diddy.php

The buttons are at the bottom.

Thanks so much,

GL

Roll Over: How To Play A Movieclip Without Skipping...
Ok here is my problem. To make it easy to understand I will use a simple example.

I want it the roll over of my button to play a ball bouncing. But the problem that I am having is when i rollover the button, and then roll back over the button quickly, it glitches the animation.

Does anyone know how to fix this with an If/Then statement? Like make the rollover only activate when the Ball movieclip is only on Frame 1?

Thanks
Mike

About Playing Sounds..
how do I tell a sound in the library to play from a mc..?

i have an if command saying that if the variable is true I want the sound to play...

can't figure out the right way to do it.. =-

it's alert.mp3 by the way :P

Help With Playing Sounds
im trying to make something along the lines of what this is:

http://209.208.248.102:8080/insoundradio.html

i tried reading the tutorial on this site and it made no sense whatsoever to me.

if someone could please help me out and just tell me where to start and how to have like 5 mp3s play in a sequence with stop/start/pause/next/back buttons, i'd really appreciate it

thank you so much

Playing Sounds
Is there a specific action that when you press a button it plays the music. I want to say it's on mouse release play but I'm not sure if that's it or not. I've done it before but I can't remember how to do it...it's been that long. I'm using Flash 5.

Thanks.

Anita

Playing Two Sounds
Hello!
I'm having some problem in playing 2 different sounds in my movie.
I want to sync 2 sounds, one plays when movie loads (the second one has to be playing too when movie loads but in mute) and the second one leaves mute state when I press a button (the first sound has to be on mute now).

Does anybody knows how to do it?
Thanks in advance!

Playing Sounds W/AS
this a button that plays a sound, right?
how do I make it stream with action script?

code:
on (release) {
mySound = new Sound();
mySound.attachSound("intro.wav");
mySound.start(0,100);
gotoAndPlay(2);
}

Playing Sounds
I made a button that you press to make a sound play or stop sounds but so far all it does is stop all sounds. I want it to stop one sound or play the sound.
The code will make more sence:

Code:
on (release) {
if (_root.yyy == 0) {
stopAllSounds();
_root.yyy = 1
}else{
_global.Sound.amonscell.wav.start(0,1);
_root.yyy = 0
}
}
Could any one write me code that works?

Playing Sounds In A Que.
This is probably pretty easy but, i'm a more of a director guy and I couldn't figure out how to do this in flash, so bare with me.

I have an array of sound/music files that a user can choose to hear by clicking on the name of the song he wants to hear. The problem is when the song is done playing, the user has to click on the next song to hear it.

I would like the program to move on to the next song in the array when ever the last song ends, but I don't know how to detect when a song ends.
Any Ideas?

Thanks.

Playing Sounds
I have a movie that begins playing "autoSound" when it's loaded.

Code:
//create a new sound object
var autoSound:Sound = new Sound();
//attach the sound
autoSound.attachSound("autoSound");
//play attached sound
autoSound.start(0,99)
This sound continues to loop the entire time the movie is opened. I have a "next" button that I want to stop playing the current sound/song and play another. I tried writing an "if" statement to see if "autoSound" is playing, and if so, to stop it and play another sound. My problem is I do not know a correct AS to put it to see which is playing. Does anyone know how to make this work or a better way than I am approaching it?
Thanks!

Sounds Currently Playing
I'm sure there's an AS but cannot find out what it is. Does anyone know how I can detect if a sound is attached and playing?
Thanks

Playing Sounds
i would like to play a sound when a movie clip gets to a certain position on the page. the clip moves across the stage and stops when x = 400 or something, and i want the sound to play once when it gets to this point. i've tried to put something like: if x > 399 play the sound, but this simply distorts/loops the sound in a weird way! any suggestions would be greatly appreciated...

Playing Sounds
I am having issues playing a sound from where it stops. I want to incooprate a stop and play bottun in my flas file i can get the video to stop amd stop all sounds however when i click play the video plays but no the sound. And if i do get the sound to play again it begins from the begining of the track rather then where it was stop. And suggestion on how to get sound to play from the stop location along with the video? Thanks

Playing Sounds
Need the actionscript or whatever, so when you press a button, it toggles sound on/off.. Anbody know? :]

Playing Sounds In LMS
Would anyone know the best method for linking sound clips in an LMS? I've just started working with this system and I've heard of sound clips not working before my time.

The method I've always used was having separate .swf files that contain one sound file each. Then to play, pause, stop, I would load each .swf into a blank movie clip or a level.

To my understanding, the LMS is always one level down ( _root does not work at all ).

Here's the method that we currently use in the first frame of the main time line, actions layer:
register = new Sound();
register.attachSound("cash");
register.start(myMusicPosition,0);

register2 = new Sound();
register2.attachSound("money");
register2.start(myMusicPosition,0);

Any thoughts?!?

Playing Sounds
Ok, I need to know how to play sounds, this is what I have

(I have flash 8 pro)

I've gone to linkage, selected "export actionscript & first frame"

gave it the identifier "beep"

then used this code...


Code:
function start_interval()
{
_global.interval = new Number(1);
_global.beep_interval= new Number(setInterval(beep, interval*1000));
trace("start_runs");
}

function stop_interval()
{
beep.stop();
trace("stop runs");
}



function beep()
{
trace("runs billion times a second");
beep.start(_global.interval*60, 999999);
}




//end

start_btn.onRelease = start_interval();
stop_btn.onRelease = stop_interval();
Thanks in advance

All Sounds Playing
Hi, I have a flash movie and on some frames there are sounds as part of movieclips.

Wheni use a back button (a simple gotoAndPlay) to go back to a frame with sound on it, i get all the sounds from the entire flash movie.  It all works correctly if accessed by a forward button (another GotoAndPlay).

I am confused - can anyone help ?

Playing Sounds Through AS
Greetings. I've been working on a small project where I'll be required to play a sound when pressing a button. There will be LOTS of sounds and I'm trying to get the code a little more compact. In doing so I have a question on whether or not I'm going about it effectively. I'm not a great programmer and have had some help with this so far, but now me (and my help) are stumped.

Here's the code that's working so far:

ActionScript Code:
// label each sound
numsounds = 6;
for (a=1; a<=numsounds; a++) {
    _root["snd"+a] = new Sound();
}
// attach each sound
attsounds = 6;
for (a=1; a<=attsounds; a++) {
    _root["snd"+a].attachSound("wav"+a);
}


From there if I code this:

ActionScript Code:
_root.btn1.onPress = function() {
    snd1.start();
}

... everything works fine (for that 1 button). But like I said, there will be lots of buttons each with their own sound. So I started messing around with this:

ActionScript Code:
numbuttons = 6;
for (a=1; a<=numbuttons; a++) {
    _root["btn"+a].onPress = function() {
        _root["snd"+a].start();
    };
}

... and in theory, I thought it would work but it doesn't. Is there a way that I can include in one frame ability to determine which button is hit (all called "btnX" - where x will be a number)and play the corresponding sound?

I should mention as well that all sounds that are being used are "export for AS" with the label "wav1", "wav2", etc.

Thanks,
-Paul

-edit--
Just realized, I'm probably in the wrong area. Please move this thread if necessary.

Button On Roll Over Should Play A Movie Clip
what i mean to say is that.. i m making a flash site..and the link have a roll over effect. now when a person roll's his mouse over the link ..the link should play a movie clip(object not a swf file)

now what should i give the script for it!!!

CS3 Mouse Click Sounds
Hello! I am trying to make a simple flash game which involves shooting. I would like to have a gun sound mp3 trigger when the mouse button is clicked. I have seen other posts which show this code, but it doesn't seem to work for me.

cursorSound = new Sound(this);
cursorSound.attachSound("gunSound");
onMouseDown = function() {
CursorSound.start();
}

I have imported the sound "gunSound" and then put in this code. Does anyone have any suggestions? I am using CS3. Thank you, Dave

Play Movie When Play Button Is Click.
Hi all,

I am a newbie, and I did use the tutorial on how to create a video with FLV and it works beatiful. There is something I can not figuere out yet.

How do I make the movie not to start playing until I click the play button?

Any questions let me know and thank you in advance for your help.

mperez6109

Big Problem Playing Sounds
Hello,

Im making a mixer with 4 channels with 3 differents sounds each one. Then i have 12 sound objects assigned to 12 diferents movieclips.

l11 = new Sound(sonido1)
l12 = new Sound(sonido2)
l13 = new Sound(sonido3)
l21 = new Sound(sonido4)
l22 = new Sound(sonido5)
l23 = new Sound(sonido6)
l31 = new Sound(sonido7)
l32 = new Sound(sonido8)
l33 = new Sound(sonido9)
l41 = new Sound(sonido10)
l42 = new Sound(sonido11)
l43 = new Sound(sonido12)

once done this, i attach the sounds from the library to each sound object.

l11.attachSound ("a1")
l12.attachSound ("a2")
l13.attachSound ("a3")
l21.attachSound ("b1")
l22.attachSound ("b2")
l23.attachSound ("b3")
l31.attachSound ("c1")
l32.attachSound ("c2")
l33.attachSound ("c3")
l41.attachSound ("d1")
l42.attachSound ("d2")
l43.attachSound ("d3")

And now, in a different frame i start each sound with a loop of 200.

l41.start(0, 200)
l42.start(0, 200)
l43.start(0, 200)
l31.start(0, 200)
l32.start(0, 200)
l33.start(0, 200)
l21.start(0, 200)
l22.start(0, 200)
l23.start(0, 200)
l11.start(0, 200)
l12.start(0, 200)
l13.start(0, 200)

THE PROBLEM is that the last 4 sounds never plays. I tried swapping the sounds from the end to the start of the list (see next code) and the problem still with the last 4


l23.start(0, 200)
l11.start(0, 200)
l12.start(0, 200)
l13.start(0, 200)

l41.start(0, 200)
l42.start(0, 200)
l43.start(0, 200)
l31.start(0, 200)
l32.start(0, 200)
l33.start(0, 200)
l21.start(0, 200)
l22.start(0, 200)

This look like Flash just can play only 8 sounds and the others 4 never plays.

PLEASE HELP ME!!!!
THANKS

(Sorry about my english

Playing Sounds In A Certain Time...help?
I'll be plain and simple:

i want to load some sounds to my movie let's say... every 15 secs a different sound in order to don't make my movie always with the same sound...

i think that this is possible to do with actionscripts, but i'm only initiating in flash now, so... can u help me?


Thanks in advance

Playing/Rewinding Sounds
Hi, I am a new user of flash and just started to learn about ActionScriting. I have created an animation with a song playing in the background. I have also created buttons to control the animation. I am able to play, stop, and rewind the animation itself but am having problems with the sound. My sound is set to loop over and over but I want the song to act in the same way as the animation itself. When I hit stop they both stop but when I hit play the animation picks up where it was and the song does not. The song starts over at the beginning. Also when I hit rewind, the animation goes to the beginning but the song never starts over, it just keeps going. Does anyone more experienced with ActionScripting have any suggestions? Thank you very much.

Copyright © 2005-08 www.BigResource.com, All rights reserved