Guest User

Untitled

a guest
Jun 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stop();
  2.  
  3. //Code to get the built in classes for Tween and Ease
  4. import fl.transitions.Tween;
  5. import fl.transitions.easing.*;
  6. import fl.transitions.TweenEvent;
  7. import flash.events.MouseEvent;
  8.  
  9. //Code to animate the pages in from right to left using the Tween class.
  10. var aboutTween:Tween = new Tween(about_mc,"x", Elastic.easeOut, 1008, 0, 3, true);
  11.  
  12. //Listener for when to start video
  13. aboutTween.addEventListener(TweenEvent.MOTION_FINISH, startVideo);
  14. //Create function to start the video playback called startVideo
  15. function startVideo (vid:TweenEvent):void {
  16.    
  17.     //Insert trace to help with debugging
  18.     trace ("start video");
  19.     //Code to start playback
  20.     about_mc.video1.play();
  21. }
  22.  
  23. //Code to stop video when page changes
  24. //Listener for when to stop video
  25. mainmenu.addEventListener(MouseEvent.CLICK, pauseVideo);
  26. //Create function to stop the video playback
  27. function pauseVideo (vid:MouseEvent):void {
  28.    
  29.     //Trace for debugging
  30.     trace ("stop video")
  31.     //Code to pause playback
  32.     about_mc.video1.pause();
  33. }
  34.  
  35. //Make relevant buttons visible
  36. mainmenu.visible = true;
  37. about.visible = false;
  38. cc.visible = false;
  39. gallery.visible = false;
  40. videos.visible = false;
  41. cast.visible = false;
  42. characters.visible = false;
Add Comment
Please, Sign In to add comment