ActionScript 3.0 :: Sound Continues Playing When Replaying Movie

Jul 20, 2010

I'm fairly experienced with AS2 and not very with AS3. I've run into a problem with sounds repeating and have set up some simple test files. Yes I'm sure they could be set up in a smarter way, what I'm curious about is why the AS3 behavior is different from AS2.

I'll explain what I've got:

A file with five frames. Nothing on frames 1-4. On frame 5 there is a stop() action, and a movieclip with a sound embedded into it set to "Stream". There is also a button that triggers a gotoAndPlay(1) event when clicked.

In AS2, clicking the button stops the sound (because the clip doesn't exist on frames 1-4), replays the .swf and on frame 5 starts the sound over.

In AS3, the .swf replays, but the sound continues to play (in spite of the clip not being on frames 1-4) and on reaching frame 5, starts playing a second copy of the sound over the first.

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Flv Continues Playing After Unload?

May 5, 2011

I have an air project which every seconds reads a txt file. Depending on the content of this file it loads an external swf file (the contents of the file is changed from an external program periodically)Every external swf file gots a flvplayback2.5 inside which loads and play a flv video (everthing is done locally).

The problem comes when the contents of the txt file changes and I have to unload the previous swf and load the new one.Despite the new swf loades plays fine I can still hear the audio of the previous swf playing in background.For the project I used only one Loader in which i load the external swf files. Before loading another swf inside it, I call the Loader.unload() but no luck.I thought that this method would remove also the loaded object but the Adobe reference about the unload() method says:

"Removes a child of this Loader object that was loaded by using the load() method.The property of the associated LoaderInfo object is reset to null.The child is not necessarily destroyed because other objects might have references to it; however,it is no longer a child of the Loader object.As a best practice, before you unload a child SWF file, you should explicitly close any streams in the child SWF file's objects, such as LocalConnection,NetConnection,NetStream, and Sound objects.Otherwise,audio in the child SWF file might continue to play,even though the child SWF file was unloaded.To close streams in the child SWF file,add an event listener to the child that listens for the unload event.When the parent callsLoader.unload(), the unload event is dispatched to the child."
 
I don't know how interal structure of the external swf is,beacause the customer gave to me only the compiled swf (I guess there's not a lot inside that swf, i think only the flvplayback control, but if i don't know the name of the flvplayback I can't invoke any stop method on it).So, do You know any method to brutally unload the loaded swf, by destroying it,no matter where it hides itself in the dark and misterious jungle of the Flash Player?

View 5 Replies

ActionScript 3.0 :: Button Rollover Continues Playing?

May 10, 2011

I am working on an application for an advocacy group for people with learning difficulties. I have ran into a few issues though that I can't really figure out.http:[url]....

If you go to the above link and make your way to the menu, you will see that a black arrow flashes when you hover over a button. Then when you click it, it moves the next page, however when you click the menu button to go back, the black arrow will still be flashing, instead of returning to its first button state. The main menu is removed before it procedes to the next screen, like so:

Code:
public function confSubMenuOneScreen():void {
subMenuOneScreen = new SubMenuOne();
removeChild(mainmenu)[code].....

View 2 Replies

IDE :: FLV Sound Continues After RemoveChild

Feb 25, 2008

I am trying to get a flv video to load on top of a parent swf. (A pop-up within flash). What I chose to do, was to put the flv player in a swf and try to load and unload it with the parent swf. This works great except when the child unloads, the music from the flv keeps playing. I am wondering if I have to do more than just a simple add and remove child. Here is what I have to load the swf when a button is clicked:

Code:
var movieLoader:Loader = new Loader();
playMovie_btn.addEventListener(MouseEvent.CLICK, showMovie);
function showMovie(event:MouseEvent):void {
movieLoader.load(new URLRequest("memories_vid.swf"));
addChild(movieLoader);
[Code] .....

Once it plays the outro animation into empty keyframes. Every attempt I have made to removeChild has not work. I still have the audio from the flv playing. How do I get "close_btn" to stop everything and to completely unload the swf?

View 4 Replies

Flash :: Video Stops And Sound Continues?

Jan 4, 2010

I have noticed a very frustrating error in flash lately. I will be watching a video in full screen mode...on any site...then all of the sudden, the video freezes and the sound continues. This does not fix automatically. I have to minimize the video from full screen to default size and then the video unfreezes and I can then go back to full screen mode.However, eventually I have to repeat this because the video freezes again.

This happens in Firefox 3.5.6 and Chrome 4.0.249.43. I am near certain I can get this to happen in any browser but I don't use other browsers to play videos so I have not tested my theory. All I know is that the problem is very consistent.
 
I am using Flash Player 10 ActiveX version 10.0.32.18 in XP Pro SP3.

View 6 Replies

ActionScript 2.0 :: Flash Movie Keeps Loading & Replaying At The Same Time?

Sep 4, 2010

I recently downloaded a template for Flash that didn't have any type of video included. I decided to include video in my completed project and for the last two months (working in CS5), I have tried to get assistance in making it work correctly...even contacting the company who MADE the template and they told me they couldn't assist because I changed the entire template & I guess they didn't want to figure it out.Here's my problem and if this has already been answered, maybe someone can just post the link directly and I'll follow it.hen the page opens up, the video starts automatically and seems to work fine and then another instance and another begin to play but not the video, just the audio. I have two videos in my movie and both do this.

View 2 Replies

ActionScript 3.0 :: Animation Pausing When Lost Focus, But Sound Continues?

Jul 9, 2010

I have an issue with an animation/movie thingy i am making

When the user for example, Switches a tab in firefox or something. The sound on the video will continue to play, but the animation will pause. Leading the animation to become out of sync with the sound.

Is there a way to make the animation continue playing even if the tab has been changed??

View 8 Replies

Professional :: Turn Off Sound When Playing FLV Movie?

May 26, 2010

I can download video from youtube as FLV.Want to play back in my Flash swf file without sound.How do I mute the sound during user playback?

View 1 Replies

Movie With Button On Stage - No Sound Playing?

Oct 17, 2010

I have 1.mp3 beside my .fla file and when I tried to run a movie test, it doesn't play any sounds. Only the stage has a glitch was it keep loop frame 1 and 2.
var mySoundReq:URLRequest = new URLRequest("1.mp3");
var mySound:Sound = new Sound();
mySound.load(mySoundReq);
mySound.addEventListener(Event.COMPLETE, playSong);
function playSong(event:Event):void {
mySound.play();
}
My test Movie with button on stage: [URL]

View 1 Replies

ActionScript 2.0 :: Playing Sound File When Movie Loaded

Aug 5, 2004

I have a problem with sounds in this movie. I have a sounds file that I would like to play as soon as the movie is loaded, but I dont want it to stream because I want to loop it and I want it to be done with AS. I saw a Tutorial where the sound would load as soon as the movie started but it wouldn't play until the play button was pressed. I want the song to play as soon as the sound is loaded. The Tutorial is Creating a Volume Control Silder. [URL]

View 5 Replies

Actionscript 2.0 :: Detect If Stream Finished Playing Sound/movie?

Apr 29, 2009

how to detect if stream finished playing sound/movie?

View 1 Replies

Professional :: Movie Clips / Sound Keeps Playing After Navigating Off Frame/page?

Aug 17, 2010

Basically I have a flash website built on different frames of the timeline, the simplest way I think.Some of these frames have movie clips embedded into them using the flv playback component class.The problem I have is the following, the site works fine and videos play fine, but whenever I navigate offa part of the website to another, from a frame to another - the sound of the clips that were playing keepsplaying on the background and never stop and it keeps building up every time I navigate of.f each page.I want to remark that I believe is not only the sound that keeps playing "invisible" but the whole clip butThis is the AS code for my buttons on an example frame, would you be so kind to tell me what I should add or change

stop();cvbtn15.addEventListener(MouseEvent.CLICK,onClick25);function onClick25(event:MouseEvent){  gotoAndStop(27);}showbtn15.addEventListener(MouseEvent.CLICK,onClick26);function

[code].....

View 3 Replies

Stop The Movie From Continues Play?

May 16, 2009

when i play the movie and click on any ball it shows the subpage one by one continuously rather than to stop as per the number of their page order.

View 4 Replies

ActionScript 2.0 :: Movie Continues After All Sounds Played?

Feb 28, 2008

I have this...

Code:
waveNoise1 = new Sound();
waveNoise1.attachSound("waveNoise1_snd");
this.waveNoise1_mc.onRollOver = function() {
waveNoise1.start(0,1);
};

Is there a way to detect if this sound has been played, and then (and only then) will the movie continue to the next frame.

p.s. can this be applied so that multiple sounds have to be played through once to continue?

View 1 Replies

ActionScript 2.0 :: Movie Clip Continues Main Timeline When Done

Apr 2, 2004

I have the main timeline of stop just as a movie clip begins to play. When that clip is done, what is the command i put into the last frame of the timeline of the movie clip to make the main movie timeline get going again?

View 3 Replies

ActionScript 2.0 :: Movie Clip Continues Main Timeline When Done?

Apr 2, 2004

I have the main timeline of stop just as a movie clip begins to play. When that clip is done, what is the command i put into the last frame of the timeline of the movie clip to make the main movie timeline get going again?

View 3 Replies

Actionscript 3.0 :: If Press Play Button While The Sound Is Already Playing It Has The Same Song Playing In The Background

Nov 13, 2010

I have a sound clip that I'm loading externally into my flash file. The code I'm using looks like this and is placed in the as layer on the first frame,

var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();
var lastPosition:Number = 0;
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();
[Code]....

View 14 Replies

ActionScript 1/2 :: Stop Other Sounds From Playing While Current Sound Is Playing?

Apr 10, 2011

I am creating a game that has 6 movieclips all on the main time line of the game. Each movie clip has three buttons that when clicked plays, pauses or stops a sound clip.When I press any of the sound clip play buttons that sound starts playing, the problem is when I click any of the other sound clip play buttons those sounds also start to play. Is there a way I can disable the other sound clip buttons while the current sound is playing then enable all of the buttons when the current sound has stopped.
 
This is the code that creates one of the sound objects

[Code]...

View 3 Replies

AS2 :: Animation Continues At Odd Point If Movie Is Loaded And Unloaded Quickly?

Feb 2, 2012

I have a flash file that has three main buttons on top. When a button is clicked the timeline moves to a that frame (designated with a label) that loads in a particular external SWF corresponding with the button. Those movies are loaded into the same empty movieclip called "presentation"using:loadMovie("splash.swf","presentation"); In one of the external loaded SWF's there is a tween animation (on first frame using TweenLite), that takes place upon loading the SWF. The issue is that when I click a button and go to another frame (which loads another SWF) mid-way through that animation, and come back to that same page with the animation. The animations starts mid-way as if it was running in the back, such as fading in things that shouldn't be faded in yet, etc..? Any clue as to why? EDIT: Maybe this is the cause? The animation code in the first frame of the loaded SWF:

//Animate the bouquet
var bFadeIn:Tween = new Tween(bouquet,"_alpha",Back.easeInOut,0,100,1,true); //106.95
bFadeIn.onMotionFinished = function() {

[code].....

View 2 Replies

Stop The Playing Sound And Start Playing The Button?

Oct 3, 2009

So I made a few buttons with sounds within them and when I publish it they work just fine. But what I want them to do is;

Say I click a Button.The sound starts playing.Then I click it again, before the sounds done playing.I want it to stop the playing sound and start playing the button I just clicked on, whether it be the same button, or a different one.Right now it just ends up sounds like an echo because it'll play it as many times as you click it.

View 2 Replies

Flash :: Playing Sound From Data Acquired From Sound.extract()?

Aug 1, 2011

I'm trying to play a sound using a technique found here (play the sound by sampling raw sound data gathered from the original with extract()), with the difference that the mp3 sound is embedded in the swf, not loaded externally. This is my code:

var soundBytes:ByteArray = new ByteArray();
var mp3sound:Sound = Sound(new Sound1_design()); // this is the embedded sound
mp3sound.extract(soundBytes, int.MAX_VALUE);

[Code]....

This works, in a way, except that the resulting sound is distorted (it has a kind of a metallic ring).

View 1 Replies

ActionScript 2.0 :: [FMX] LoadSound - Sound To Keep Playing While The Rollovers Load Sound

Jun 22, 2003

I am loading small sounds dynamically with the loadSound command. These small sounds are activated with a rollover. see script below. This works ok. however. i want the first sound to keep playing while the rollovers load sound. a bit like playing the piano. This works ok when i import all the sounds into the library and place them on their very own button. however the size of the flash movie increases to 140k. whereas when i load them dynamically the size of the movie is 20k. obviously i want to load dynamically.

But with dynamic loading each sound stops when another sound is rolled over, so that there is only ever one sound playing at once. I need to load the sound into a different level or something, so that the first sound can keep going while the smaller, shorter sounds play over the top. this is my script below. The first sound loads when the movie starts. This is the one i want to keep playing. Then there are the smaller ones with rollovers. does this make any sense? there's actually 13 little sounds.

[Code]...

View 3 Replies

Professional :: Stop A Sound From Playing If It Is Playing Already

Dec 6, 2011

ok so i have a button that plays an animation for fire when held down. and when realsed goes to and stops and frame one. when it reaches the end of the time line it goes to and plays at frame 10 and goes back to the end of the timeline. I have a sound for the fire animation that plays for the effect. The problem is the sound keeps going untill its over even if the button isnt held down. and when the playhead reaches the end of the timeline it goes to and plays and frame 10 and it replays the sound. if i hold it down it will just keep playing the sound over and over from start to finish. what i want it to do it when i hold the button down i want it to play the sound and when released it stops the sound where ever it is at. I also dont the sound to play again if there is a sound already going to stop it from playing 20 sounds at one time it gets loud and you need asprin after about 5 seconds of that.

View 2 Replies

ActionScript 3.0 :: Assign A Sound To A Soundchannel Without Playing The Sound?

May 4, 2011

The thing I don't understand is how to assign a sound to a soundchannel without playing the sound. All the examples I've seen do this.

Code:
_SoundChannel = _sound.play();
_SoundChannel.stop();

And how can I set a SoundChannel volume to zero before allocating a sound to it?

View 2 Replies

CS3 Sound Control - No Sound Playing?

Apr 16, 2010

I am trying to embed some sound controls, and have hit a dead end. I made my play and stop buttons, imported my mp3,, assigned it proper linkage, and inserted this AS2 :

[Code]...

The buttons are named "play_btn" and "stop_btn" respectively. When I export it or preview it, hitting the play button does not do anything.... I hear no sound. What could be up with this?

View 4 Replies

Professional :: Playing Scenes In Test Movie Animations Stop Playing?

Dec 4, 2011

I am using AS2 in CS5.5.I am creating a project for a class that introduced me to adobe flash.  The issue is I have gotten to a certain point about 15 scenes.  During say the 15th scene scrolling through the timeline animations works fine, playing it on test scene works fine.  When I go to play it on test movie it stops at a certain point.  At first I thought it might have been a misplaced stop action but there is none to be found.  The weird part is every other scene I create after that continues to freeze as well, the images are there, but the animations won't play.  All my previous animations play before those with the issue, it's justThese new ones won't play for some reason in test movie, but work completely fine in test scene and the timeline.

View 4 Replies

ActionScript 3.0 :: VIDEO Stops Playing, Continue Playing Flash Movie?

Aug 7, 2009

I am loading an external SWF file into my main timeline. The external SWF file contains an FLV video. At a certain point in my main timeline, the SWF file loads and plays the video. Is there a way to say...

If the VIDEO (FLV) is done playing, gotoAndPlay(X)?

View 4 Replies

ActionScript 3.0 :: Detect Cuepoints Playing From FLV Movie That Is Playing From FLV Playback Component?

Oct 9, 2009

I was wondering, what was the best way to for actionscript 3.0 to detect cuepoints playing from a FLV movie that is playing from an FLV playback component?

View 1 Replies

Professional :: Replaying A Swf Correctly With Its Music?

Oct 28, 2010

I created an eHoliday card and there is a button at the end of the swf that you can click to replay. It plays fine the first time but automatically replays at the end and there is no music the second time.

View 4 Replies

ActionScript 2.0 :: Replaying An OnEnterFrame Function?

Feb 7, 2007

Got a piece of code that moves a line of text I'm calling "eeScroller". I'm using this method because timeline and as tweens make the movement herky jerky (when the movement is slow).

What I want to do is reset the _x of eeScroller to 0.9 once it reaches the _x of -889.3

Here's what I got so far:

Code:
function movething() {
_root.eeScroller.onEnterFrame = function() {
if (_root.eeScroller._x>=-889.3) {

[Code].....

how to implement onMotionFinished if that's even the way to do it...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved