Skip to main content
Participating Frequently
December 17, 2009
Question

Simple AS3 question (I think)

  • December 17, 2009
  • 1 reply
  • 915 views

Hi,

I made a simple page with several buttons that play music, but then decided I wanted a video (flv) to first play automatically, and when that ends the page with the buttons appears. How can I do that? Right now I have four layers using one frame. Layer one has the AS code, two has the text, three has the buttons and the fourth layer has a background image.

Thanks in advance

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 17, 2009

add an flvplayback component to your fla, assign its source and attach a listener for the complete event.

rodn29Author
Participating Frequently
December 17, 2009

thanks for the quick reply. I am new to AS so would it besomething like this: addEventListener(FocusEvent.FOCUS_IN,PlayFLV);

would I take the code I already wrote and put it on frame 2 and insert the new code on frame 1?

kglad
Community Expert
Community Expert
December 17, 2009

i don't know what you have in frame 2 but, if your component's name is flv, your video-related code would be something like:

flv.source="path/yourflv.flv";

flv.addEventListener(VideoEvent.COMPLETE,videoCompleteF);

function videoCompleteF(e:Event){

// do whatever.  video is complete

}