Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Timer Issue & Video Event issue

$
0
0

Sadly, I know enough AS3 to be dangerous, so I need a little help on this.

 

 

I have a banner, that I pull in youtube videos with.

I have set it up with 3 movie clips, inside another movie clip, on the stage, and need to do the following:

 

 

Frame 1:

Pulls the youtube video without sound (I've got this set up), and after 15 seconds, if there is no action by the viewer, it goes to Frame 2 and stops.

 

 

Frame 2:

Cues up a youtube video (have this set too) that is static, and the user can press the play button to watch the video.

 

 

Frame 3:

If at any time the user presses a button, on Frame 1 or 2, then they are forwarded to Frame 3, where the video plays with sound. After the video ends, it needs to hop back to Frame 2 and stay there.

 

 

 

 

The problems I'm running into:

 

 

I have this code on Frame 1:

 

 

stop();

var firstPause : Timer = new Timer(15000, 1);

var p:MovieClip = parent as MovieClip;

 

 

firstPause.addEventListener(TimerEvent.TIMER, firstStop);

 

 

function firstStop (e:TimerEvent) : void {

          p.gotoAndStop(2);

}

 

 

firstPause.start();

 

 

This seems to work fine. However, the timer is applying to the whole main movie clip, so when people go to Frame 3, it waits 15 seconds, and throws people to the second frame, with the video in the third frame still playing under the static video.

 

 

The other thing I'm trying to do, but have not yet figured out, is to have the action script sense when the youtube video ends (I'm pretty sure I need to use getPlayerState() and onStateChange for this) and push it to the second frame. But I can't come up with the code for it to save my life.

 

Any help at all would be appreciated. I can also post the code I'm using throughout the project, if that would help.


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>