Advertisement
angelhdz12

Last Video Reached

May 9th, 2015
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //This event will be dispatched when the last video is reached (finished playing)
  2. container.vid.addEventListener("lastVideo", function():void
  3. {
  4.     trace("Last video reached!");
  5.     //Show banner code here
  6.     var banner:Banner = new Banner();
  7.     banner.x = stage.stageWidth /2 - banner.width /2;
  8.     banner.y = stage.stageHeight /2 - banner.height /2;
  9.     var t:Tween = new Tween(banner.scrollingTxt, "x", null, banner.width + banner.scrollingTxt.width, - banner.scrollingTxt.width, 5, true);
  10.     t.looping = true;
  11.     addChild(banner);
  12.     setTimeout(function()
  13.     {
  14.         t.stop();
  15.         t = null;
  16.         removeChild(banner);
  17.         banner =  null;
  18.     }, 20000); //20 seconds duration
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement