ActionScript 3.0 :: Sound - When Press Stop Then Play It Only Plays From The Last Pause And Not The Beginning
Apr 26, 2009
i'm habing abit of problem with this code, its supposed to play pause and stop, the problem being that when i press stop then play it only plays from the last pause and not the beggining how to get it to play from the start after the stop button is pressed
I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly.
The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either.Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3.
Pause and Resume external SWF sound filesI have this code that plays the sound through linkage. It reside in scene1.fla -> scene1.swf.
var mc:MovieClip = this.createEmptyMovieClip("mc",1);var myLoop:Sound = new Sound(mc);myLoop.attachSound("bg_sound");myLoopVolume=0;myLoop.setVolume(myLoopVolume); mc.onEnterFrame = function () { if (fadeIn01==1) {
I have just a play and pause button on a website I'm creating for a client that streams one mp3 song. It works great with the code below, but the problem is that when it reaches the end, it doesn't loop back to the beginning. I would like for the user to be able to press the play button at the end to hear the song again, or include another button that rewinds back to the beginning.
Code: this.createEmptyMovieClip("sound_mc", 10); music = new Sound(sound_mc); music.loadSound("[URL]", true); music.start(); active_button = "play"; [Code] .....
All my sounds work however, the play button only seems to play my sound when I click on the pause or stop button first! Plus, my stop button acts like a pause button, it doesn't start the song from the beginning once it stops. [code]...
I have a timeline of 30 frames, each it's own mc (page01_mc, etc.). In each mc I show a picture or two and hear narration.I have a first, prev and next nav on the main timeline. I need to add a play/pause btn that will pause both pictures and sound. I assume I do that in each mc, but do not know where to find the code.Here is what is in each mc now:
var mySound:Sound = new Sound(); mySound.load(new URLRequest("english/Intro01.mp3")); mySound.play()
OK, say I have a button that does something, like go to the next frame, is there anyway to have it play a simple sound located in the library without looping?
I have a sound bite (~500ms) and want when a key is pressed and held the sound is played.However, what I appear to be getting is the sound triggered to play every time the key down event is triggered (not suprising & makes sense since key is held down). This creates what sounds like several copies of the sound being played at same time only shifted slightly. Very ugly sound btw.My thought is to have a way that even if key is continued to be held down the sound bite is looped but not overlapped.Tried several things such as using Event.Sound_Complete listener, tracking the position, transformation things, timers, etc without success.
I'm having the worst time figuring this out... Here is the movie I made: [URL] and I want it to stop, then when i press that circle, continue with the animation. right now i have a stop(); on frame 19 the button is named myBtn I have tried all kinds of myBtn.onRelease = Play() but when I do that, i get errors and it no longer stops...
i've imported a flv video file to Flash for the intro and i create skip button to go next frame..but when i press skip..it stop at next frame but the sound of intro still playing.
I'm looking for some help regarding stopping sounds in Actionscript 3. Basically I'm making an interactive story game, basically a quiz game. On the main menu I have a narrator talking. What I basically want to do is have the track stop playing when you press the play button. I have the soundtrack playing already and the play button too. I just can't figure out how to get the sound to stop when I press the play button and it goes to the next scene.
I'va any troubles in controlling sound in an external swf. I need to stop/play/pause it. I've put the sound file on the timeline of the external swf and I want to control it from tha main movie in wich I've load it. the swfs are made using AS2.0
The pause button in my MP3 player resets the track to the beginning, there is something wrong with my sound channel because when i trace the position it is always zero.[code]...
you see that the sound is on a seperate layer, with gotoandplay(1); or w/e on the end... so it indefinetely loops if left to it's own devices.Now the actions for the play arrow button are:
on (release) { play(); }
and the actions for the stop square button are:
on (release) { stop(); }
Techincally, as to my VERY BASIC A/S knowledge, this should work right? I also tried instead of "on (release)" I tried "onClipEvent (mouseUp)"but that didn't work either?
I can do this in AS2 but am struggling in 3. I've got the Play/Pause working and toggling and the Stop button stopping but I can't get the Play/Pause to toggle when the Stop button is pushed.
Here's my code:
var isPlaying:Boolean;var soundChannel:SoundChannel = new SoundChannel();var sound:Sound = new Sound(new URLRequest("commercial.mp3"));xstop.addEventListener(MouseEvent.CLICK, clickStop);xplay.addEventListener(MouseEvent.CLICK, clickPlayPause);
I have a Sound that is playing in the background of my movie, I am using Tweenlite to tween the volume of the sound at various point along the timeline.Now I have been asked to ad a pause button, which I have implimented and works(pauses the sound at the pausePoint), but when I resume the animation the sound I have no sound.I think my problem has to do with Tweenlight not updating the current soundvolume as when I trace the soundransform volume value it is 0 ?
ActionScript Code: var myIntroloopTransform:SoundTransform = new SoundTransform(0); // Toggle Pause
I have a movieclip. And I try pause n play together with sound. But I can't do it. This my code in one frame just play pause movie clip without sound..
i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on... i know it has to be made with a boolean variable, true/false, but i just can't figure out how.
I've googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash?
I have created a SWF file that plays/stops sound. The SWF file works great when previewed in Flash CS4, but does not work when inserted in the HTML file.Here are the 2 files that are automatically generated when I INSERT>MEDIA>SWF in Dreamweaver CS4:
swfobject_modified.js expressInstall.swf Here is the ActionScript3 that I am using in the Flash file:
How can I get the pause button to stop sounds and music, and the play button to start them up again? As of now, it only stops the animation, and lets the music continue.
I am trying to make a play, pause and stop btns controlling a mp3 file which is in the library which has a linkage id of Speakers. I've manage to get the pause and play to work but now incorporating a stop button isn't working for me
To say basically if you have pressed the pause btn, then the play btn, play from state pause at, but if you have pressed the stop btn then pressed the play btn, play from start and also if the play btn has been pressed and the audio is playing if pressed again dont play again do nothing.
I am making a simple radio interface and i have 6 preset buttons which i want to have play the specific preset button's song which is in the library and stop/pause the current song when any preset button is pressed.
i tried using the attachSound function, with associated identifiers but not sure if that is the right way to go. It plays the songs, but doesnt stop them.[code]...
I just need something simple, where there is only pause, play and stop buttons. I usually load the music within the flash movie and play from there, but I would like to build one where if you press play, the music loads and plays streaming on the spot. I have got a couple of more complex streaming style mp3 players but I would like to use a simplified streaming version. Any recommendations or code that I can just add to a button?