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
Similar Posts:
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
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
Nov 20, 2010
I have noticed once I unload a certain SWF, which has a video embedded into it. The SWF is removed from the stage, but I can still hear the audio from the video playing. So I presume I am actually not fully removing the SWF from the stage.
Here is a link to my site cnrdesign(dot)net
I presume its happening to all my loaded swfs, but if you click on the "work" button, and then the "Interactive" button, and then click on the first thumnail, that opens the SWF with the "MoodApp" video. If you wait for that to load and start playing and then close that window, you still hear the video playing.
Im not 100% but I think this is the code used to remove my loader.
Code:
function tweenFinished (e:TweenEvent):void{
var my_loader:Loader = Loader (e.target.obj);
my_loader.unload();
[Code]....
View 2 Replies
Feb 25, 2011
I have 10 swf's, i m displaying 1 swf for each question displaying 1 swf, but problem is i unload the swf and load the next question clip but old one is still playing sound..
View 1 Replies
Jul 4, 2011
I have an urgent issue, I have created an swf file that loads the external FLV, however when finished playing the video stops on the final frame of the FLV.What I want is for the video to unload itself.
if(_root.video1 == undefined){
vStream = "15_IT_CURVES_BECKS_700x400.flv";
}else{
[code]....
View 5 Replies
Aug 21, 2009
I'm developing a Flash application that uses several SWF-files. I have one main SWF and others are loaded into this one dynamically. One of the SWF's I'm loading is showing a video clip. This SWF contains code to load and display an FLV-file immediately after it has been loaded into the main SWF. My problem is that I can't find a way to unload this SWF. Once I've loaded it and it starts to play the video, the video keeps playing forever. Even if I remove it from the displaylist it keeps playing. I can't see it, but I hear the sound continuing.
I've recreated this problem in a small project (see code below). In this project I have a simple button that should toggle whether the video is shown or not. [URL] works as mentioned before: it automatically starts playing a .flv as soon as it is loaded. When I run this I get the following as I click the button:
Click 1: Video shows up and starts to play.
Click 2: Video is hidden, but it's still playing (I can hear the sound).
Click 3: Video is loaded AGAIN. Now I can see the video, but I hear TWO soundtracks!
[Code].....
View 2 Replies
Jun 22, 2004
I have used the following script to load a movie
but.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("scene_1.swf", "container");
container._x = 150 ;
container._y = 20 ;
}
This works great, but now when the movie scene_1.swf is finished playing I would like the movie to unload automatically and return to the mainstage and continue the scene on the mainstage.
View 5 Replies
Jun 22, 2004
I have used the following script to load a movie
but.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("scene_1.swf", "container");
[code]....
View 5 Replies
Nov 18, 2010
I have a Flash animation that loads a quick animation and then on a button click loads and external swf while at the same time moves the playhead on the timeline to frame 2 so that it has a blank stage to play on. The external swf then loads and plays. At the end of the external swf's animation I would like it to unload and then return to frame one of the containing movie. I am assuming that on the last frame of the external swf I should be putting some actionscript that will unload the movie and then talk to the initial containing flash telling it to return to frame 1.
The main swf button that loads the external swf is using a code snippet from the AS3 CS5 library and looks like this...
[Code]....
It is also using gotoAndStop(2); for the same button.
So to unload the external swf and return would I use something like... this.unload(gotoAndStop(1));
View 3 Replies
Aug 10, 2009
I want my externally loaded flv-movie to unload itself when it is done playing. I read something about cue-Points but didn't find anything useful.
View 3 Replies
Sep 23, 2010
I have a shell swf that is loading a swf. How do you have the loaded swf tell the parent loader to unload itself after the loaded swf finishes playing?
View 4 Replies
Jun 16, 2003
I want the current swf to unload and the new one to load only after a transition occurs. Is there a more efficient way to do this than if. switch()?
View 2 Replies
Aug 9, 2008
I am working on a school project that requires me to load external .swf or .jpg files. I currently have all of the buttons working and are loading an external .swf file on to the screen. The problem I am having is that when I go from one button to the next the loaded .swf stays on the screen and the next .swf gets loaded on top of it. I know that I need to unload the file but I am not sure where to put the code for the unload or what code exactly to use. I would like when the button is pressed to unload the previous loaded .swf and load the new .swf without having a separate button to unload.
[Code]...
View 3 Replies
Jul 23, 2009
I'm trying to unload an external SWF on _root to load a new one instead. I've tried (almost) everything but can't figure it out... I get this error : "Error #1010: A term is undefined and has no properties."
[Code]....
View 3 Replies
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
Dec 11, 2007
Into my main SWF, I'm loading an external SWF with anUlLoader component. This external SWF plays an FLV using thatrespective component. Everything works fine, except that when Iclose the external SWF from within my main SWF, the FLV audiocontinues to play.
View 3 Replies
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
Feb 3, 2010
A) When I hit the UP key to jump the character continues to move up as I hold the key down.
B) When I stop moving forward the frame of the stickman symbol for walking keeps playing and I want it so the frame labeled "idle" will play when I release right or left.
C) Is it possible to have an action for holding 2 keys at once? I want to have it so i can hold SPACE and RIGHT/LEFT to run.
[Code]...
View 2 Replies
May 31, 2009
Below is the function I use to remove the swf which holds an FLVPlayback component and the button that runs the function. The function stops the video then removes the swf. The swf disappears and the sound stops but if I look at the task manager I notice the video is still loading usually at about 1 meg every 5 seconds. I know I'm supposed to be able to use the closeVideoPlayer method which should stop the netstream but I don't how to make it work
function goHome(e:MouseEvent):void myMovie.stop(); this.parent.parent.removeChild(this.parent);// myMovie.closeVideoPlayer(0); meCombo.removeEventListener(Event.CHANGE,
[code].....
View 7 Replies
Dec 11, 2009
My video continues to play when I click another button, I have tried using soundMix, but that cuts off all the sound to my other videos. Iam new and have been trying to serach for this problem for over 2+ weeks.
View 1 Replies
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
Jan 25, 2010
I'm trying to fade in a button over a looping video clip however, it fades in and disappears after a few seconds. I tried adding stop() to the button but it stops the whole movie instead of just the button.
View 1 Replies
Apr 1, 2011
This was originally a tween, i converted it to code and removed the tweens.[code]....How can i loop that so the animation continues to run, because right now it only runs once.
View 4 Replies
Mar 13, 2012
I am making a platform game in flash. I have a goal class (the class which contains code for the goal sprite, where when you hit it, it continues to next part of game). Inside the goal constructor, 2 event listeners are added, they are as follows:
addEventListener(Event.ADDED, beginClass);
addEventListener(Event.ENTER_FRAME, eFrame);
The beginClass function is fine, and only runs once, but eFrame is what checks if the player has hit the goal, so it is constantly running. The problem is, once the player hits the goal, eFrame continues to run, while in a menu describing the next scene to the player. My eFrame function is below.
private function eFrame(event:Event):void{
if(hitTestObject(_root.mcMain)){
var lastScore:int = _root.mainScore;
_root.mainScore = lastScore;
while (_root.lvlHolder.numChildren > 0) {
[Code] .....
Frames 2, 3, 4, are frames with just text and a button that display a message to the player, and then the player hits continue. My problem is that eFrame is still trying to be run, but the class has not been instantiated, and the method is causing extreme amounts of lag once the player continues.
View 3 Replies
Jan 25, 2010
I'm trying to fade in a button over a looping video clip however, it fades in and disappears after a few seconds. I tried adding stop() to the button but it stops the whole movie instead of just the button.
View 9 Replies
May 11, 2010
ActionScript Code:
public function Inventory(arrayOfItems:Array, stageRef, invSprite)
{
[code]......
View 1 Replies
Mar 2, 2011
A function within a child swf is continuing to go, even after I remove the child swf from the stage... this wouldn't really matter, except that there are sound elements called from within this function, and those sounds continue to play!
[Code]....
View 2 Replies
Apr 27, 2009
I have a project in which the client would like the contents to be centered on his browser but the background to fill the whole window... this would be simple enough if the background was a solid color... the problem I am facing is that the background has a design to it (see attached). I found a good tutorial on: [URL] ...that is the basics of what I am trying to achieve, but not quite there. The RED bars on my attachment would be the center of the content...
View 4 Replies
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