• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Free T-shirt for the first person to solve this....Stop all video playback in all Movie clips. Help? Here's my issue and code. Thanks!

Community Beginner ,
Oct 27, 2009 Oct 27, 2009

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

TOPICS
ActionScript

Views

617

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 27, 2009 Oct 27, 2009

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 28, 2009 Oct 28, 2009

Copy link to clipboard

Copied

Hi iFezec,

Where and how should these appear in the code I provided?  Thanks in advance. Rich

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 28, 2009 Oct 28, 2009

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 28, 2009 Oct 28, 2009

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 04, 2009 Nov 04, 2009

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines