Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-12-2010, 03:43 PM   #1
ralphiedee
Member
 
Join Date: Aug 2008
Posts: 41
Default unloadAndStop or stop stream needed

I've been banging my head trying to get this done, I have a partial solution and it works by having an unload button on stage which I cannot have. What I need is a variable or another set of event listeners for the existing buttons that will remove any stream "unloadandStop" BEFORE ANY btn function that calls the next swf.

THE STREAM IS GENERATED BY AN INSTANCE OF SLIDESHOW PRO IN THE EXTERNAL SWFS NOT THE.FLV PLAYER

Heres what I have:
ActionScript Code:
// var Xpos:Number = 0; var Ypos:Number = 0; var swf:MovieClip; var loader:Loader = new Loader(); var defaultSWF:URLRequest = new URLRequest("swfs/home.swf"); loader.load(defaultSWF); loader.x = Xpos; loader.y = Ypos; addChild(loader); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Btns Universal function function btnClick(event:MouseEvent):void {     removeChild(loader);     var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");     loader.load(newSWFRequest);     loader.x = Xpos;     loader.y = Ypos;     addChild(loader); } // Btn listeners home.addEventListener(MouseEvent.CLICK, btnClick); bio.addEventListener(MouseEvent.CLICK, btnClick); commercial.addEventListener(MouseEvent.CLICK, btnClick); //remove stream listeners and function unload_btn.addEventListener("click",afterClick); function afterClick(e:MouseEvent):void {     loader.unloadAndStop();

Last edited by CyanBlue; 03-12-2010 at 05:29 PM. Reason: AS Tag applied...
ralphiedee is offline   Reply With Quote
Old 03-12-2010, 04:51 PM   #2
ralphiedee
Member
 
Join Date: Aug 2008
Posts: 41
Default

Man this must be real hard as I cannot find a solution. I went ahead and made a zip with all the files

main.swf

home.swf

commercial.swf


the slideshow pro is in the commercial.swf and you will see folders for the swfs and video.


This set of files works only because there is an unload btn on the stage, I need this to work without the unload btn.


hope this is a little easier to figure out.


files are here

http://www.mediafire.com/?jzmiznhyn4t
ralphiedee is offline   Reply With Quote
Old 03-12-2010, 06:12 PM   #3
skaliam
Registered User
 
Join Date: Mar 2010
Posts: 4
Default

hi is there a way to remove a parents child movie clip?

this is what i thought it might be?

removeChild(MovieClip(parent).myLoader);
skaliam is offline   Reply With Quote
Old 03-12-2010, 06:37 PM   #4
tadster
tadster
 
tadster's Avatar
 
Join Date: Feb 2009
Location: Texas
Posts: 2,111
Default

i don't really get what your after, but, you should be doing something like this:
ActionScript Code:
function btnClick(event:MouseEvent):void {     loader.unload();     var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");     loader.load(newSWFRequest);     loader.x = Xpos;     loader.y = Ypos; }

that's it, no afterClick
__________________
www.actiontad.com - ActionScript and JavaScript sitting in a tree...
tadster is offline   Reply With Quote
Old 03-14-2010, 06:20 PM   #5
ralphiedee
Member
 
Join Date: Aug 2008
Posts: 41
Default

thx , that unloaded the swf but not the stream. I got it to work by using

SoundMixer.stopAll();

rd
ralphiedee is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.