Flash :: Sound Keeps Playing After External Swf Was Unloaded

Oct 14, 2010

I have a flash application, some kind of a play-list that loads external SWF video player (I don't have code access to that external file), so users can watch the video or skip to another one. When user switches to another video new SWF file is being loaded.

The problem: If user didn't finish watching the video and skips to the next then I unload previous SWF file (unloadAndStop()) and load a new one. And because the previous SWF was playing it is not actually unloaded, it is still playing on the background (I hear two audio tracks: current and previous).

View 1 Replies


Similar Posts:


Flash :: Unloaded AVM1 Swfs Trace Out As Unloaded But Memory Is Not Freed For The AVM2 Machine

Mar 29, 2010

I have a large project built in as3. Part of its main functionality is to load and unload various as2 swfs. The problem is that the memory ins't free up once they are unloaded.

I have access to the as2 swfs code base and destroyed all objects, stopped and killed timers, listeners, removed from stage, destroyed all the MovieClip.protoypes that were created. They look to be clean as far as the AS2 debugger show no remnants of the object after the destroy function is run. In AS3 i've closed the local connection, cleaned all references/listeners to the AVM1Movie and ran Loader.unloadAndStop(). The trace out in flex says the swf was unloaded but looking at windows task manager the memory usage never drops to when it was before the as2 swf was loaded. Each as2 swf can take up to 80 megs each time it's run so memory gets eaten up fast and loading and unloading a few as2 files.

At this point if the AS2 swfs are unloaded the only thing that I can assume that could be left is MovieClip.prototype and/or _global, _root variables add during the AS2's run time. But i've gone through those and can't find anything else that might be sticking. Has anyone ever seen problems before with the AVM1 machine not freeing up its memory?

View 2 Replies

IDE :: Audio From Unloaded Swf Keeps Playing?

May 28, 2009

I'm trying to load a successive series of swf, each containing audio, into a loader. As each ends, it's unloaded and the next one loads. I'm using the following code:

Code:
var ldr:Loader = new Loader();
var c:int = 0;

[code].....

View 2 Replies

ActionScript 3.0 :: Audio From Unloaded Swf Keeps Playing?

May 28, 2009

I'm trying to load a successive series of swf, each containing audio,into a loader.As each ends,it's unloaded and the next one loads.I'm using the following code:

[CODE]var ldr:Loader = new Loader();var c:int = 0;var clips:Array = new Array("dmt1.swf","dmt2.swf","dmt3.swf","dmt4.swf")addChild(ldr);ldr.load(new URLRequest(clips[0]));
addEventListener(Event.ENTER_FRAME, loading);[/CODE]...........

Each swf loads just fine, but the audio from the previously loaded swf start playing again, so there's a layered audio mishmash.

View 1 Replies

ActionScript 3.0 :: Unloaded Multimedia SWF But Video Still Playing

Jul 25, 2011

I'm creating an eLearning interface to load other multimedia rich SWF contents. As from the title, I do unloadAndStop() the multimedia rich SWF and the SWF disappeared from the stage. However, video content from the unloaded SWF were still playing.

According to Adobe:
Code:
As a result, the following occurs for the child SWF file and the child SWF file's display list:
Sounds are stopped.
Stage event listeners are removed.
Event listeners for enterFrame, frameConstructed, exitFrame, activate and deactivate are removed.
Timers are stopped.
Camera and Microphone instances are detached
MovieClips are stopped.

The 2nd problem I face will be, after unLoadAndStop() my parent font type also change to "Times New Romans" although I have embedded the the font type to the flash. I have to reload the parent to get back the design font type.

View 7 Replies

ActionScript 3.0 :: Stop Sound Once Video Unloaded?

Feb 21, 2009

I am loading swf's that have an flv embedded on the timeline. When the user selects from the menu I unload the swf and load another. This is working fine, but the audio from the first swf's video keeps playing. How can I kill this first videos audio track?

View 3 Replies

ActionScript 3.0 :: Playing External Sound Files In IPhone App

Mar 21, 2011

I'm porting a simple application from browser-based to iPhone. It plays some external sound files. There are 2 main steps:

1) Load an external XML file that contains sound file paths.
2) Load the sound files.

Can this be done with iPhone or do I need to move everything into the .fla file and then just publish it to iPhone?

View 3 Replies

ActionScript 3.0 :: External Swf Wont Stop Playing Sound?

Jun 28, 2011

I have created a form that has some buttons that open external swf files.Problem is when I close the external swf the audio keeps playing.If I turn off sounds the sound starts again when I load a new external swf.Here is the relevant portion of code;

function playMyMovie():void{ myrequest=new URLRequest(myMovie); myloader =new Loader(); myloader.load(myrequest); function movieLoaded(myevent:Event):void {  stage.addChild(myloader);  var mycontent:MovieClip=myevent.target.content;  mycontent.x=100; [code]....

View 15 Replies

ActionScript 3.0 :: Sound Doubling Up When Playing External MP3 Files?

Sep 25, 2009

I've created an audio player with actionscript 3 which plays one of 55 different sounds, depending on a variable set from which button a user clicks on. It works fine for the first 1 or 2 plays, but after that the sound begins to double-up, or even triple-up. I'm using the code below./First I declare a few variables:

var sound:Sound;
var controller:SoundChannel;
var pausePos:Number = 0;
var audioReset:Boolean = false;
var playerObject:Object = new Object();//

The sound functions are placed within another function so that it can be called again once a new button is selected:

function audiofunc() {

//if the user is selecting a second audio file, it runs this "audioReset function to try to clear the EventListeners[code]....

audiofunc(); I'm assuming that somehow an EventListener isn't getting removed, so it's causing a few versions of the audio file to play at once. If I trace the value of pausePos, it starts to appear in multiples (the same number, but 2, 3 or 4 times) after a few plays of the different audio files.

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 3.0 :: External Swf Sounds Will Not Stop When Unloaded

Jun 23, 2009

Main swf loads an external swf which has a linear voice-over. User can watch/listen the whole 5 minute piece and then main movie carries on OR User can click to go on without viewing/listening to the whole show. Using removeChild, I can kill the visuals, but the voice track still goes on. i added a SoundMixer.stopAll line, and it does kill the current VO clip, but the next one will play in a few seconds. In the external swf, i'm using timers to delay slide advancement while the voice over plays. Seems like I came across some info that says I cannot fully unload like this with timers in my external swf.

Does this sound like a plausible source of the problem? If so, what is the best way to kill/nullify the timers in the external swf?

View 1 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

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

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

Actionscript 3 :: Flash Sound Not Playing

Feb 8, 2011

I have a [code]...

If I directly add "playBeep()" in the AS3 code, then it plays the sound. I have added allowscriptaccess=always in the embed code.

View 1 Replies

Flash :: Stop A Sound From Playing In As3?

Sep 14, 2011

I have this code in the second frame to play a song, and it works fine. The class of the sound in my library being "MySound". var snd:MySound = new MySound snd.play(); Now I need the song to stop playing from a latter frame.

View 1 Replies

Playing Sound When Flash Is Loaded?

May 14, 2009

I have buttons with sound attached in over state and that works just fine, but this means that you are going to hear sounds only when you move cursor over button, how can i make some background sound to play from the moment flash is loaded, even when buttons are inactive, my background image looks like some electrical equipment and and i want to make it sound realistic (sound clip must to be set to loop) and must to start at the moment flash is loaded?

View 1 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

ActionScript 2.0 :: Flash - Animation With Sound Not Playing In Mac?

Jul 29, 2011

I have made a 5 min animation with stream sound. Its playing perfectly in PC. But in mac,its not playing. Stream sound starts from frame 60. So mac plays the swf plays till 60 frame, after that it pauses. I tried importing different sound format (wav, aif, mp3) and tried with all sound export setting but the problem remain same; its playing only till 60. When i removed the sound, it played till end. Even with event sound, it plays till end. But with stream sound, the problem. The problem is only in mac; in pc its perfect.I am using VMware Mac OS x leopard in window xp for testing purpose. I tested it in laptop with mac; but the problem is same. What could be the solution?

View 1 Replies

Professional :: Flash - Animation With Stream Sound Not Playing In Mac?

Jul 29, 2011

I have made a 5 min animation with stream sound. Its playing perfectly in PC. But in mac, its not playing. Stream sound starts from frame 60. So mac plays the swf plays till 60 frame, after that it pauses. I tried importing different sound format (wav, aif, mp3) and tried with all sound export setting but the problem remain same; its playing only till 60.When i removed the sound, it played till end. Even with event sound, it plays till end. But with stream sound, the problem. The problem is only in mac; in pc its perfect.I am using VMware Mac OS x leopard in window xp for testing purpose.

View 2 Replies

Flash :: Playing One Sound At A Time In Called From Javascript?

Jul 15, 2010

I'm working on a site, for kids, which has a small avatar in the corner that talks.The avatar is a flash file and the plan is to determine what it says through a mix of javascript and ajax.

Unfortunately when I make the flash file play an Mp3 file through JavaScript, I can't seem to stop the sound.. so when I keep clicking on a link which causes it to talk, I hear the sound repeated x times.

The odd thing is, when I attach the very same code to a button in flash, there seems to be no such limitation. It seems as if it won't store anything in global variables when calling from JavaScript.

View 2 Replies

Flash - Playing Sound Object With Desired Point

Jun 17, 2011

I'm trying to make a player with EQ, get the data in the Sound object, but for some reason with the desired point to play it I can not play it right from the start of the track.

_out_snd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
_channel = _out_snd.play(pos);
function processSound(event:SampleDataEvent):void {
_samples = new ByteArray();
var len:Number = buf[trackDesc].sound.extract(_samples, BUFFER_SIZE);
[Code] .....

View 1 Replies

Actionscript 3 :: Playing A Sound In Flex (Flash) And Hearing Nothing

Jan 19, 2012

I'm doing a by-the-book sound playback in Flex and I can't hear it.

I tried this:

var snd : Sound = new Sound();
snd.addEventListener(Event.COMPLETE, function(e : Event) : void
{
snd.play();

[Code].....

But I hear nothing. Launching the same mp3 file in vlc plays it fine. So yes, my speakers are turned on. :)

It's not the loading. I can see it's actually loading those 40k bytes fine, and if I give the wrong URL I do get an IOError. It's as if it's playing but nothing can be heard.

View 1 Replies

Actionscript 3 :: Sound Clip In Flash Not Playing Properly?

Feb 26, 2012

I'm working on an interactive flash software which consist of playing audio and showing slideshows, for each slideshow there is a corresponding sound clip.

To organize the sound so I can easily pause and play it, I make the sound as movie clips and put them on one layer. When there is a slide change, I put a keyframe that consist of the corresponding sound movie clip for the slide, and delete the previous sound movie clip from the stage.

However, when I do gotoAndPlay() to the beginning of slide 2 from slide 3, the sound for slide 1 started playing too. I'm confused since I have deleted the first sound movie clip just before the beginning of the slide 2.

View 1 Replies

ActionScript 2.0 :: Sound Effects Not Playing On Flash Game

Jul 23, 2011

I've been working on a flash game, and recently added in sound effects. However, the sound effects only seem to play the first half-second of the audio file whenever I call on them to. I have been using the standard code.

ActionScript Code:
on (rollOver) {
if (_global.sound) {
_global.SFX1.start(0,1);
}}

But the sound effect only plays through a small amount of the audio. Also, the sound effects are not very stable, and will only play the butchered audio if there is some time in between clicking on several buttons. The odd thing is that I took the same code to another flash file, and the audio played through all the way with no problem, not requiring any additional time to play the sound effect again. I used the same code to load the sounds, which is

ActionScript Code:
onClipEvent (load) {
_global.Music1 = new Sound();
Music1.attachSound('Music1');
_global.Music2 = new Sound();
Music2.attachSound('Music2');
[Code] .....

View 8 Replies

ActionScript 2.0 :: Playing Sound In Flash Site Background

Oct 10, 2002

How do I get a sound to play throughout the entire flash site in the background? Go to [URL] and you will see what I mean. Its a great site by the way! In this "crucial limit" site, he has tunes playing in the background, and they keep playing despite how deep you navigate through the site, no matter what button you press, the song continues to play without stopping. [URL]

View 2 Replies

ActionScript 2.0 :: Information That Can Be Pulled From Currently Playing Sound In Flash To Base Animation Off?

Nov 24, 2004

I wanted to make a visulisation based on sound, like a winamp plug in.The only thing that even remotely looks like it uses sound information is the sound players on FlashKit. (although they might be faking it)url...Is there any information that can be pulled from a currently playing sound in Flash to base a animation off ?

View 3 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







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