Sound Object: Pause, Start, Stop.
I had to creat a player that would stop, start, pause a music track.
I first Imported a sound and Choose to export the symbol I gave it a name of "tosca"
I got this code from a tutorial.
In my first keyframe I inserted this script
s = new Sound();
s.attachSound("Tosca");
i = 1;
function timeme() {
now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
_root["nowtime"+i] = (Number(hours)*3600)+(Number(minutes)*60)+seconds;
_root.newstarttime = _root["nowtime"+i]-_root.nowtime1;
i++;
}
s.start();
timeme();
But thier is a little problem that a neophyte like me can't seem to solve for the life of me. I created a fla and published it with a name called "sound.swf". It works pefectly when I view the .swf file. But when my main movie "main.swf" plays it loads my sound.swf fine but does not play any music? Does anyone know what I did wrong.
Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-29-2002, 11:01 AM
View Complete Forum Thread with Replies
Sponsored Links:
[CS3] Sound - Stop/start/pause Button
Ok.
So i have a pause/start/stop button. I have a movie and .mp3
When i click start/pause/stop buttons, i have coded the movie correctly so it responds fine. But the .mp3 just keeps running and doesnt when i click the buttons.
The // is my .mp3 part, can some1 help me to get it workin with the buttons.
Code:
//(var my_sound:Sound = new Sound();
//my_sound.attachSound("Bullsong");
//playBtn.onRelease = function(){
//my_sound.start();
//};
//stopBtn.onRelease = function(){
//my_sound.gotoAndStop(1);
//};
//pauseBtn.onRelease = function(){
//my_sound.stop();
//} ;
playBtn.onRelease = function() {
play();
//my_sound.setVolume(100)
};
stopBtn.onRelease = function() {
gotoAndStop(1);
//my_sound.setVolume(0)
}
pauseBtn.onRelease = function() {
stop();
//my_sound.setVolume(0)
};
P.s. when i save and compact my .fla, it comes out as 60mb... so i guess i cant show it to you guys...
View Replies !
View Related
Sound Object Start Stop Exactly At Button Press
Require code urgently to stop 'sound object' using pause button.
Upon pressing pause/play button...movie stops + sound stops, pressing again it plays from exactly where it had been paused.
Also set up sound object with animated sequence but when calling identifier at different chapter bookmarks in movie sound will not sync with existing file.
View Replies !
View Related
HTML Link To Start/Stop/Pause Flash
is there any way to put a HTML link (a href kinda thing) in you code that will start or stop any flash thing... IE: You have music saved in flash form and want any user to have power to stop/pause/restart it... is there any way for this to be done??? (W/O putting a pause link in the flash file... I want it to be independent) Thank You ppl...
View Replies !
View Related
Pause/start Sound
Hi,
If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?
Thanks,
Tim
View Replies !
View Related
Pause/start Sound
Hi,
If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?
Thanks,
Tim
View Replies !
View Related
Pause Functionality: Sound.start() Not Starting
Hi All,
i'm loading mp3 files into an empty movie clip and using the Sound object.(see below). I have it not set to stream, and i have the most recent player.
The problem is that when I stop and start the sound, it doesn't always start playing again. As with a pause button for example. Also with a 'next' button where when pressed, the sound is stopped, next audio file is loaded and started. - but sometimes it just doesn't start!
So whether i'm trying to start the sound from the beginning or from an offset position, sometimes just nothing happens!
I've done a fair bit of checking - i can't seem to find particular conditions that make this problem recurr, it seems fairly arbitrary.
Does anybody have any ideas?
Any suggestions greatly appreciated,
Sinead.
//excerpt from sound loading bit.
myAudio = new Sound(myAudioMc);
....
myAudio.loadSound(myAudioFile, false);
myAudio.onLoad = PlayAudio();
function PlayAudio(){
myAudio.start();
}
the pause function simply says
on pause
myAudio.stop();
on un-pause
myAudio.start(myAudioPausePosition);
View Replies !
View Related
How To Start Off Playing Sound For PLAY/PAUSE
I am new to 3.0 and I can't figure out how to get my button to flip between play and pause with the music playing on enter frame. Help! I am sure this is super EASY!
I will post the file. Thanks in advance!
var soundReq:URLRequest = new URLRequest("nameofsoundfile.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
var resumeTime:Number = 0;
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
function onComplete(event:Event):void
{
play_btn.addEventListener(MouseEvent.CLICK, playSound);
}
function playSound(event:MouseEvent):void
{
soundControl = sound.play(resumeTime);
pause_btn.visible = true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseSound);
play_btn.visible = false;
play_btn.removeEventListener(MouseEvent.CLICK, playSound);
}
function pauseSound(event:MouseEvent):void
{
resumeTime = soundControl.position;
soundControl.stop();
play_btn.visible = true;
play_btn.addEventListener(MouseEvent.CLICK, playSound);
pause_btn.visible = false;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseSound);
}
pause_btn.visible = false;
View Replies !
View Related
How To Stop And Start Sound
I have a flash file which has a movie clip that contains sound. The instance name of which is 'soundMovie'. I have placed the movie clip on the stage. NOw when I run the file I can hear the sound. THe problem is with the following script that I have placed on the first frame of the main movie timeline (NOT THE MOVIE CLIP CONTAINING THE MUSIC). i.e when the following script is attached to the first frame, the music stops. my question is why doesnt the music start if I have written soundobj.start(). If I remove the live soundobj.start it runs fine. any help would be highly appreciated !!!!
soundobj = new Sound(_root.soundMovie);
soundobj.stop();
soundobj.start();
View Replies !
View Related
Sound: Start-Stop
I have a movie that you can start and stop at different points on the timeline (whenever you press play or stop). I would like to add a narrative sound track that will start and stop at the same time as I start and stop the movie, without the sound going back to the beginning.
Does anyone know how to achieve this or know of a link to a tutorial which explains how to do this?
Thanking you!
Luke
View Replies !
View Related
Start One Sound, Stop Another
I am using this code on the first frame of my movie:
stop();
_root.soundb.onRelease = function(){
mySound = new Sound();
mySound.loadSound("sounda.mp3", true);
}
_root.soundb.onRelease = function(){
mySound = new Sound();
mySound.loadSound("soundb.mp3", true);
}
_root.soundc.onRelease = function(){
mySound = new Sound();
mySound.loadSound("soundc.mp3", true);
}
Each button works perfect EXCEPT, when one button is clicked, I want the previous sound if any, to stop before the new clip starts. How do I modify my code to make that happen?
Thanks
View Replies !
View Related
Stop Start Sound
Can any of you geniuses help me i have a website with a background sound thats embeded in a player see www.imageworksltd.com on the site i have a few .flv movie files when someone plays the movies i want the background sound to fade out so you can hear the movies and if poss fade back in when movie finished im not a programmer so its all far fetched for me thanks in advance Alistair
View Replies !
View Related
How Do I Pause, Or Stop A Sound.
I made the 2 buttons, but I just can't seem to find out the right action script to Start/stop the song I wish to play on my website. I know how to add the sound, and make it play.
If you know how to stop a song, or pause it, and make it play again after you pause it, please tell me!
Thankyou
---------------------------
A Dragon's Ball.
View Replies !
View Related
Start And Stop Sound Button
http://www.flashkit.com/movies/Basic...dex.php?chk=no
I want to learn how to make a button to start sound or stop sound, however, i were unable to download .fla from the link above, can you show me how to make it? Please and thanks!
View Replies !
View Related
Start/stop Sound With Button
I want there to be sound when my site opens. I can get the sound to play automatically and have added a button into the site if the user doesn't want to have sound. However, I am missing a detail or two and can't get it to start again after you've stopped it when you hit the same button. Does anyone have any suggestions?
View Replies !
View Related
Stop/Start Sound Not Working?
I created a button play_mc and another button pause_mc and a final button titled trigger_btn. I used the following actionscript in the first frame of "trigger_btn." When I test my movie, I get no errors... however the music file does not play. Can someone look at the AS and tell me why?
function getSound(url:String) {
sound.stop();
delete sound;
sound = new Sound();
sound.onLoad = function(success:Boolean) {
if (success) {
trace("[MP3 Player]: file loaded");
} else {
trace("[MP3 Player]: Could Not load Sound Data from file, please try again");
}
};
sound.loadSound(url, true);
}
function audioStop() {
sound.stop();
$marker = sound.position/1000;
$state = false;
}
function audioPlay() {
sound.start($marker);
$state = true;
}
function checkState() {
if ($state == true) {
pause_mc._visible = false;
audioStop();
} else {
pause_mc._visible = true;
audioPlay();
}
getSound("http://joshuasortino.com/remember.mp3");
sound.stop();
var $state = false;
var $marker = 0;
trigger_btn.onRelease = checkState;
}
View Replies !
View Related
[CS3] AS3 - Make Sound Stop/Start
Hey everybody! The following code works exactly like I want it to by turning on the sound for my flash movie, but once the sound is on I can't figure out how to make the same button turn it off again. Can someone help me?
Code:
import flash.media.Sound;
import flash.media.SoundChannel;
status.text = "Chimes Off";
playButton.addEventListener(MouseEvent.MOUSE_DOWN, playChimes);
function playChimes(e:MouseEvent):void
{
var chimes:Chimes = new Chimes();
var chimesSound:SoundChannel = chimes.play();
status.text = "Chimes On";
var chimesStatus:Boolean = true;
trace ("Playing!");
}
View Replies !
View Related
Stop / Start Sound Problem
I have pulled in an FLV file into my SWF.
I wanted to create a "Mute" button that would stop all sounds and then start them back up when clicking.
1. Click once, mute.
2. Click again, unmute.
However, when I used the Behavior "Stop all Sounds", it actually stops the video as well.
Is it because it is an FLV that it won't work like that?
Any help is appreciated.
Thanks,
Bryan
View Replies !
View Related
Start/stop Sound With Actionscript Problem
...been trying to use .sound commands in AS to start and stop specific and separate sound files but encountered this problem; please help...
actionscript in main scene;
---------
s = new Sound();
s.attachSound("prodigymorello2");
k = new Sound();
k.attachSound("gittarriff");
---------
with individual buttons, to START these sound files went ok but STOPPING them separately didn't work.
for example; "prodigymorello2" is started, then "gittarriff" is also started after the first sound. but when i created individual stopsound buttons for each sound, it stops BOTH the sounds playing - not just the specific sound that was supposed to stop; something wrong with my scripting?
---------
on (release) {
k.stop();
}
---------
(on the "gittarriff" stopsound button)
---------
on (release) {
s.stop();
}
---------
(on the "prodigymorello2" stopsound button)
by the way, both these stopsound buttons work, but as if they were;
---------
on (release) {
stopAllSounds ();
}
---------
why??!!
View Replies !
View Related
Getting One Sound To Stop And Another To Start On Button Press?
I've searched on this topic with several keywords to no avail.
I have a sound playing (1.wav). I would like that sound to stop playing and another (2.wav) to start when a button is pressed. How do I do this?
So far I can either I can have both sounds playing, or neither (stopallsounds) when it's clicked; but I would like to stop 1.wav and start 2.wav and can't figure it out. Help!
View Replies !
View Related
Start/Stop Externally Loaded Sound
Can anyone help me with this on/off music button. I want to load the music externally and have it start automatically but use the stop and start button to control the sound. Here is the .fla and if you need it the music also, the file was too big to upload here.
http://www.nucklewebdesign.com/dloads/music.zip
Thanks,
Josh
View Replies !
View Related
Stop/start Button Sound Plays Over Itself
Hello Evenyone,
I am new to the forum. I am using a 30 sec sound file. I want it to play when the site starts and turn off when the button is hit.
The sound starts when the site starts up however, the first time the sound off button is hit the sound plays over itself-- like two songs are playing. The second time the button is hit the problem seems to go away.
Here is are the steps and code I used. I would appreciate someone giving me better code to use to create on/off buttons and loading sound or helping me with my existing code.
Did following to sound file:
Selected: Linkage
Selected: Export for Actionscript
Created layer named music
Added the following actionscript in keyframe 1
my_sound = new Sound();
my_sound.attachSound('jazz");
my_sound.start(0,1000);
gotoAndStop("stop");
In keyframe 2;
Added a stop();
Added a name for the frame called 'play'
In keyframe 3:
Added a stop();
Added a name for the frame called 'stop'
Dragged 'on' button to frame 2 with following actionscript:
on (release) {
_root.my_sound.start(0,1000);
_root.gotoAndStop("stop");
}
Dragged 'off' button to frame 3 with following actionscript:
on (release) {
_root.my_sound.stop();
_root.gotoAndStop("play");
}
I would appreciate any help..........I'm not too familiar with sound files and how to control them.
Thanks.
Lindaabby
View Replies !
View Related
Can't Get Sound Object To Start
Hi All,
I am using Flash MX 6.0. I am trying to build a very simply MP3 player that loads its song list from a text file. I have a pause button that stores the position of the sound object and then calls the stop method on the sound object. Then I have a play button that calls the start method on the sound object using the position as a parameter. However, it will not start. I have tried just calling start with no parameters and I can't figure out what is wrong. I have posted my .fla if anyone could please have a look and see what I am doing wrong. I am completely new to this stuff. Thanks.
http://www.deimde.org/flash/SimplePlayer.zip
View Replies !
View Related
Stop All Sounds And Start Another Sound By Clicking A Button
I am working with Flash 5 and I have a problem like this:
I have several buttons in one page, when clicking each button you get a sound (long), I set the sound on the down phase of the button and set it to "start".
The problem is that when I click one button, and then immediately another button, I hear the sounds of both buttons together.
How can I make it, so that when clicking on the button, the sound that is playing will stop, and the new sounds will start.
Thanks you very much, Efrat.
View Replies !
View Related
Basic Sound Problem - Start & Stop Buttons
Hi, I'm new to flash and I'm experimenting having a looped sound that is controlled by a stop and start button.
http://www.tarotrealm.co.uk/flashtest.htm
Why is it on this page the stop button manages to stop the looped wave sound but after a few seconds the sound starts playing again?! And when the sound is stopped after pressing the button, the play button doesnt seem to work? Ive used the actionscript play and stop movie controls for the buttons.
Any help appreciated!
View Replies !
View Related
Stop And Start Sound Loops With 1 Keyboard Button?
I am new to flash and have been learning using a range of tutorials on this site , which have been most helpful to me.
However i cant seem to start and stop a looped music sample using the same keyboard button! Ive tried a number of methods but just cant get it.
Any help would be much appreciated or links to anywhere that might be of use
Thanks
View Replies !
View Related
Sound Stop And Sound Start
Hi There.
I have the follwoing problem. I have this play/pause button that toggles. This works. When clicking it the movie freezes and when clicking it again it runs. I have now added sound to the timeline, and what I want is that when clicking the pause button the movie freezes but also the sound freezes. Clicking the pause button again should start the movie and the sound again.
I have written the follwoing actionscript to the button:
Code:
isPaused = true;
allSounds=new Sound();
this.movieClip.play_btn.onRelease = function() {
isPaused = !isPaused;
movieClip.gotoAndStop(isPaused ? 1 : 5);
stop();
_root.allSounds.stop();
if (isPaused==true) {
play();
trace("We are rolling");
trace("and this is frame "+_root._currentFrame);
_root.allSounds.start(0,99);
}
}
It does half of it good. When I now click the button, the movies freezes and the music stops. When I click again the movie starts again, except that I do not hear any sound anymore. I am sure it is just some simple error, but any tips would be welcome!
Thnx!
View Replies !
View Related
Stop Sound To Start Another Sound
I have a movie -a read aloud ebook for kids-with a main soundfile, and buttons with soundfiles (definition of the word in the text). I need to be able to click on the word definition button, stop the main soundfile, listen to the word definition button soundfile, then return to the main soundfile. Everything in the movie works perfectly except that with the code below (on each button), on rollOver ALL sounds are stopped, and I can't work out how else to do it. Can anyone show me how to do this without the onRollover please?
on (rollOver) {
stopAllSounds();
}
on (press) {
_root.play();
}
on (release) {
_root.stop();
_root.btnStopPlay.attachMovie("mcButtonPlay", "btnPlay", 1);
}
View Replies !
View Related
Pause Button To Stop Animation & Sound Simultanous
SLIDE SHOW that run alongs with Animation and Sound. I want to put PAUSE button like the companys page has. It supposed to Pause NOT Stop.
I need to keep the whole SWF as a one file only. Also I'm going to put image file from external XML is it going to work?
My page sucks http://www.compoundingprofits.com/home.htm
Companys page cool http://inwiththenew.com/presentation/
Please help. If you need to see my FLA file I'll arrange to put it on my site.
View Replies !
View Related
[AS Sound Object] MP3 Pause, Play
Hi,
I'm building a dynamic MP3 player for a site, basically it will take data from XML and then assign vars that will be used when calling on the MP3s. My problem is that I can't seem to get the start method to work with a streaming sound. It works with an event loaded sound, but i don't want to use that because I have to load the whole sound before i can do anything. Any suggestions on what to do? By the way all sounds are loaded through the loadSound() method if that helps.
View Replies !
View Related
Sound Object Won´t Start Unless If Pressed With Button...
Hi guys,
So i am building a web-site and wanted to put a small sound control system onto it. I mean one looping song with Play, Stop and volume controls. I´ve managed to do that many times for CD-ROM presentations but now that I want to do it on a web-site it won´t work! Here´s what I am doing...
On the second frame of the movie (on the first one I´ve got my preloader):
Quote:
som = new Sound();
som.loadSound("mp3/ambient.mp3", false)
var vol = 70;
_root.onEnterFrame = function() {
som.setVolume(vol);
vol_t.text = vol;
}
som.start(som.pausa, 9999);
stop();
Besides that, I´ve put a button on the same frame with the following code:
Quote:
on (release) {
som.stop();
som.pausa = 0;
if (som.pausa != null) {
som.start(som.pausa, 9999);
} else {
som.start(0, 9999);
}
}
Unfortunately, once the site opens the song won´t play at all... In the other hand, If I press this button, the song will start. That behavior tells me that the movie IS finding and loading the MP3 file, but it is not starting it unless told so by the button.
And just to make things a little bit more awkward, that behavior only happens when I test the movie in its remote server. If I test the movie in my PC locally there won´t be any problems at all...
Thank you for any help.
Regards
View Replies !
View Related
Sound Object START Wont Work
I'm building an MP3 player from an xml list.
I've got everythign working okay except for the resume after pause button. my soundObject.start(offset) wont work unless I create a new sound object which has occurred so that multiple mp3s play at once.
Here is my code, I have basically nothing on my stage right now other then a list to select songs (which is fine), my next prev buttons which are okay.
The play pause is a movie clip with 4 keyframes that changes the text and weight of a font, no AS in the element itself other then a stop() frame
here is my code:
PHP Code:
//!-- UTF8
/// Holding Variables
var Songs=Array();
var Current= -1;
var pos = 0;
var CurrentVolume=75;
var Sengine=new Sound();
Sengine.onSoundComplete = PlaySong;
Sengine.setVolume(75);
/// functions
function PlaySong()
{
if (Current == Songs.length - 1) Current = -1;
if (Current == -2) Current = Songs.length - 2;
Sengine.stop();
Sengine = new Sound();
Segine.setVolume(CurrentVolume);
Sengine.loadSound(Songs[++Current], true);
textbox.text=Current + 1;
}
SongXML = new XML();
SongXML.ignoreWhite = true;
SongXML.onLoad = function(success)
{
if(!success)
{
trace("Didnt load XML" + this.toString());
}
var cNodes=SongXML.firstChild.childNodes;
for (i=0; i<cNodes.length; i++)
{
Songs.push(cNodes[i].attributes.url);
listit.addItem(cNodes[i].attributes.title, i);
}
PlaySong();
}
SongXML.load("music.xml");
function nextprev(sum)
{
Current=Current + sum;
PlaySong();
}
/// interaction
listit.setChangeHandler("PickSong");
function PickSong()
{
Current=listit.getSelectedItem().data - 1;
PlaySong();
}
prev.onPress=function()
{
nextprev(-2);
}
next.onPress=function()
{
nextprev(0);
}
pauseclip.onRelease= function()
{
if (pauseclip._currentframe == 10)
{
pos = Sengine.position;
Sengine.stop();
pauseclip.gotoAndStop("playOver");
}
else if(pauseclip._currentframe == 30)
{
Sengine.start(pos / 1000);
pauseclip.gotoAndStop("pauseOver");
//trace(pos)
}
}
pauseclip.onRollOver= function()
{
if (this._currentframe==20)
{
this.gotoAndStop("playOver");
}
if (this._currentframe == 1)
{
this.gotoAndPlay("pauseOver");
}
}
pauseclip.onRollOut = pauseclip.onReleaseOutside= function()
{
if (this._currentframe==30)
{
this.gotoAndStop("play");
}
if (this._currentframe == 10)
{
this.gotoAndPlay("pause");
}
}
function AdjustSound(svalue)
{
Sengine.setVolume(svalue);
CurrentVolume(svalue);
}
View Replies !
View Related
Creating A Pause Button For Sound Object...
Hey, I want to have a sound playin in the background of my movie.
I want a button to stop the sound and change its appearance.
When that button is clicked again, I want it to start the back up (from where it left off if possible) and change its appearnce back to normal.
How?!?! Thanks!
View Replies !
View Related
Stop Sound File Early (using Sound Object)
I know I can use the play() method of the Sound object to offset the beginning of a sound. Ex:
mySound.play(2000) - plays the sound beginning at 2 seconds
Is there a way to get a sound to stop early? For example, if it is a 20-second sound, can I get it to stop at 18 seconds? Thanks!
View Replies !
View Related
Sound Object Help - Pause Button & Multiple Mp3s
I'm trying load the mp3 externally and be able to stop, start and pause it but the pause (the pause works, just the UNpausing doesn't) isn't working. Also, if anyone has any idea how I can make this shuffle through multiple MP3s rather than just the one that would be awesome.
I'm pretty new to flash/actionscript/code so this is really just not working for me. I used a lot of it from a tutorial on here but the pause just doesn't work. I'm going to attach the fla, swf and mp3 I'm using to test it in hopes someone can fix it for me and tell me what is wrong. This is the code on the pause button... though you will probably have to download the files I'm sure:
All the files (mp3, fla, html, swf) are HERE
Thanks so much, you guys are great here.
// Pause Button
on (press) {
if (pausedx == false) {
// set variables =
pausedx = true;
playingx = false;
stoppedx = false;
// musicposition set it equal to the position/1000
musicposition = myMusicx.position/1000;
// and stop it
_root.myMusicx.stop();
} else {
playingx = true;
pausedx = false;
stoppedx = false;
myMusicx.start(musicposition);
}
}
View Replies !
View Related
HELP Sound Object Stop Kills Flv Sound Too
code:
if (!firstTime) {
_root.introMusic = new Sound();
_root.introMusic.attachSound("music");
_root.introMusic.setVolume(50);
_root.introMusic.start(0, 1);
firstTime = true;
}
music_btn.onRelease = function() {
if (!rockNow) {
_root.introMusic.setVolume(0);
this.gotoAndStop(2);
rockNow = true;
} else {
_root.introMusic.setVolume(50);
this.gotoAndStop(1);
rockNow = false;
}
};
stop();
This script for my "music on/off" btn kills ALL audio and not just the sounds object audio. It also pauses FLV playback (I'm using the FLVplayback component). Any insite?
I've tried modifying the above AS not using the "_root." to target the obj and also stop() and start() on the obj instead of just volume control. HELP!!!
Thanks,
1M.
View Replies !
View Related
Stop A Sound Object From Repeating
Hi,
im doing an mx sound tutorial on this site that gives the following code for calling a sound on a button.
code: on (press) {
if (playing=true) {
_root.firstSound.start(0,999);
playing=true;
}
then to the same sound off-
code:
on (press) {
_root.firstSound.stop("firstSound01");
playing=false;
}
My question is how do i get a the "playing" variable like the one above working on an onclipEvent intead of on a button. When i use this code the sound keeps playing new loops everytime it enters the frame. And im not sure whats the best way to handle the variable or if its even the best way
code: onClipEvent (enterFrame) {
_root.shakermc.firstsound.start(0, 999);
}
thanks
View Replies !
View Related
Sound Object - Specifying Only Certain Sound To Stop
Hi everyone. I'll try to make this as brief as possible. I am creating a flash project which contains video on a few pages. The project also contains background music which loops contiuously.
The goal is to have the background music stop whenever the user is on a page containing video and for the music to play again when the user leaves said page.
The script I created works to stop the music, but it also stops the audio contained within the video and causes the video player (by proxxus) to lock up.
The solution is probably a simple one, but I'm having difficulty figuring it out.
If anybody can see where I've gone wrong, your help would be greatly appreciated. Here's the setup:
Library:
music.wav - linkage = "myMusic01"
Main Timeline:
Code:
//-- create a variable to determine if the current movie contains video
var currMovie:String = "notVideo";
//-- start playing sound object
myMusicMc.myMusic.start(0, 999);
myMusicMc (residing on main timeline)
frame 1
Code:
//-- set up sound object
myMusic=new Sound();
myMusic.attachSound("myMusic01");
frame 2
Code:
//-- check the variable "currMovie"
if (_root.currMovie == "Video") {
_root.myMusicMc.myMusic.stop();
} else {
_root.myMusicMc.myMusic.play();
}
frame 3
Code:
//-- create a loop to continuously check the variable
gotoAndPlay(2);
on the actions layer of the movie clip containing my navigation controls
snippet of the callback used
Code:
videoLink_mc.onRelease = function() {
_parent.prodDetail_mc.gotoAndPlay("video");
_root.currMovie="Video";
}
on all the other buttons currMovie is set to "notVideo"
View Replies !
View Related
One Button Stop/play Sound Object - MX
I'm using MX and taken some Flashkit tutorials on sound objects, but I can't seem to get one thing to work. I'm trying to create one button that, when clicked, stops a sound object if it's playing and start it when it's not playing. I know how to create separate stop and play buttons, but for this project I need them combined into one button. I can get the sound object to stop, but not to play again. Any help would be much appreciated, thanks and have a great day!!!
Laters....
View Replies !
View Related
My Sound Object Wont Stop Looping
I created a Sound object that is controlled by a volume slider. However, when it gets to the last frame of the audio, i want it to stop along with the animation. I have a stop action on the last frame, but the sound object starts up again and ignores the stop action. I have also tried adding a
stopAllSounds();
action to the last frame as well, but it ignored that too! How do I get this sound object to play once and stop at the end without looping?
View Replies !
View Related
|