Copy link to clipboard
Copied
I have a file (fla) that I need some assisance with. You can see the actual finished project at:
http://www.wex.org/curriculum/samples/
Free t-shirt if you solve this!
The problem or bug that still exists is the ability to get all video to stop playing when you click the close button of the video tutorials. For example load the above page and click on "Targeted Instruction" from the learning cycle (bubble at top of cycle), a new movie click is loaded by going to that frame on the timeline and shows sub nav on the right which includes "See Video" which when clicked launches a video of a teacher using this very technique.
Here's where the problem arrises....If you click on either close button, the one on the video panel or the larger "Close" button at top right everything closed and you're back at the main "Learning Cycle" Launch page. However, the video is still playing in the background!!!!! How do I get all instances and videos to close/stop when one of these buttons are clicked?
Here's the actionscript 3.0 that I have on my first frame listening for mouse events. The one I'd love to have stop all movies from playing is "cyclehome.addEventListener(MouseEvent.CLICK, closepopup);" The last listener in the "//handle events for buttons..." list.
Please, please can anyone help me with this. I'm a week or so of my time in and can't find the answer. I'll send you a t shirt if you figure it out.
Here's my code
..............................
stop ();
// handle events for buttons ...
home.addEventListener(MouseEvent.CLICK, clickSection);
targetedInstruction.addEventListener(MouseEvent.CLICK, clickSection);
skillDrill.addEventListener(MouseEvent.CLICK, clickSection);
revisionAssignment.addEventListener(MouseEvent.CLICK, clickSection);
verbalWarmup.addEventListener(MouseEvent.CLICK, clickSection);
journalWriting.addEventListener(MouseEvent.CLICK, clickSection);
overShoulder.addEventListener(MouseEvent.CLICK, clickSection);
sharing.addEventListener(MouseEvent.CLICK, clickSection);
closing.addEventListener(MouseEvent.CLICK, clickSection);
feedback.addEventListener(MouseEvent.CLICK, clickSection);
bnLongDoc.addEventListener(MouseEvent.CLICK, downloadpdflongdoc);
cyclehome.addEventListener(MouseEvent.CLICK, closepopup); << This one is the one I'd like to stop all video playback....
// function to download pdf
function downloadpdflongdoc (evtObj:MouseEvent)
{
var targetURL:URLRequest=new URLRequest("http://www.wex.org/downloads/lessons/WEXLongDocuments.pdf");
navigateToURL(targetURL);
}
function clickSection (evtObj:MouseEvent)
{
// go to section clicked on
gotoAndStop (evtObj.target.name);
}
function closepopup (evtObj:MouseEvent)
{
// go to section clicked on
gotoAndStop (evtObj.target.name);
}
...................................................
Thanks in advance
Rich
INDUSTRY11
Boston
Copy link to clipboard
Copied
This is a matter of the garbage collection never cleaning itself.
You have to assist the collection by doing these 3 things.
To unload swfs or Videos,
You have to StopandUnload() for swf and for videos unloadAndStop()
You have to make sure to remove all Eventslisteners,
and the variables that once held those references have to be set to null
Copy link to clipboard
Copied
Hi iFezec,
Where and how should these appear in the code I provided? Thanks in advance. Rich
Copy link to clipboard
Copied
You don't need to stop all the videos. You only need to stop the one that is playing. So to do that make sure you save a reference to the video whenever you start playing one. Then when you click that button simply stop the video just like you would normally. The best bet is probably to pause the video, and then remove all the objects as best you can.
Copy link to clipboard
Copied
Hey buddy, Thanks for getting back to me.
Can you show me in my code how to do this. I'm not an AS3 programmer. Thanks.
Copy link to clipboard
Copied
I sorted this out on my own. A simple instancename.stop(); line I added to the function of the listening mouse event for the close button.