HomeAboutCategoriesVideosLinks


Stop Nested FLVPlayback Component AS3

And yet another Flash Actionscript 3.0 problem, with which I'd like to share the solution I found.



Flash Actionscript 3.0 CS3, Nested FLVPlayback ComponentThe problem was I had an FLVPlayback component and I nested this in 4 different movieClips to play 4 different videos. The nest was 2 levels deep. Now the problem I had was, whenever I played one video, and moved on to another MC, the video/audio kept on playing. I needed to stop that, otherwise I'll continuously overload the file if I play back and forth.

Through all the forums, all I've ever encountered was a revision of solutions pointing to the myVideo.stop(); command where 'myVideo' is your FLVPlayback instance name. This always lead me to errors I don't know about. I'm no pro here I'm sorry -_- so this option is crossed off.

I then looked at other options such as an event handler that could possible stop the video upon 'exit frame' or whenever the you leave the frame to move to another that's holding another video. Then again, there is no such "EXIT_FRAME" or "onLeave" type of Event despite having "ENTER_FRAME".

But hey, I found this code that did the trick.

flVPlaybackInstance.addEventListener(Event.REMOVED_FROM_STAGE, stopPlay);
function stopPlay(e:Event)
{
flVPlaybackInstance.stop();
}


Using Event.REMOVED_FROM_STAGE, whenever you leave the nested MC to move to another nested MC, you remove the previous MC from the stage and you automatically stop that. This removes the option of manually adding events and functions to your buttons that's supposed to stop other videos.

Just note that you should replace 'flvPlaybackInstance' with the proper names, movieclips, instances, and nestings as fit.

If it helps, I used this FLVPlayback Component Tutorial from Republic of Code :)

Good luck hope that helps!

Older news items:
  • Flickering MovieClip Buttons in Actionscript 3.0
  • Exclude Own IP from AWStats Results
  • Building a Site Up and Online
+/- Add New Search
+/- Write comment
Your Contact Details:
Comment:
Security
Security Image
Please input the anti-spam code that you can read in the image.


Powered by !JoomlaComment 4.0 beta2
 
  • Wakeboarding Near Manila
  • Memorandum No. 1 FOR Noynoy Aquino
  • KPOP Video with Filipino Sub
  • Ironlak and the Graffiti Scene of Manila
  • Quirino Grandstand Hostage Crisis
  • WoW Cataclysm Collector's Edition and Deathwing Pet
  • Why I Currently Dislike the World of Warcraft
  • Dont Lie, Just Teleport
  • Jejemon in Denial
  • Vampires Suck Movie Trailer
  • Cute Kids Arguing
  • Remaining 3 Letter LLL .CO Combinations
  • 5 Sundays 5 Mondays 5 Tuesdays
  • Jejemon in Denial
  • Chinese Beat Up Noynoy Game
  • Mouse Trap Survivor
  • Quirino Grandstand Hostage Crisis
  • WoW Cataclysm Collector's Edition and Deathwing Pet
  • Ironlak and the Graffiti Scene of Manila
  • Remove Virus that Shuts Down CMD
  • PLDC Mode Yet Again
  • Vampires Suck Movie Trailer
  • Wakeboarding Near Manila
  • Memorandum No. 1 FOR Noynoy Aquino
  • Why I Currently Dislike the World of Warcraft

Personal - Top Blogs Philippines

Follow me, Kenneth Tan of NotOffline, on Twitter! :)
  • Skysenshi
  • View From Ayala
  • Pinoy Potter's Chronicles


HomeArchiveDisclaimerContactSitemap

Copyright © 2009-2010 NOTOFFLINE.com All Rights Reserved
Webdesign & Layout Originally Made for NotOffline.com