Looping an FLV, (my own personal reminder)

Okay here’s some short lines of Actionscript 2 and 3, hardly worth blogging about, but its code I always forget and then have to go sift through old files for, so I’ll use the Coding category of the blog to try and remember I’ve noted this for later…

For Actionscript 2: If you have an FLV playback component on stage you want to loop forever, give it an instance name of myFLV, and in your Actions panel paste in…

myFlv.complete = function(eventObject:Object):void {

this.play();

};

For Actionscript 3: If you have an FLV playback component on stage you want to loop forever, give it an instance name of myFLV, and in your Actions panel paste in…

import fl.video.*;

function onFLVComplete(event:VideoEvent):void {

event.target.play();

}

myFLV.addEventListener(VideoEvent.COMPLETE, onFLVComplete);

And remember for point out the video file (.flv) you want to playback, you can do that in the Component Inspector window, in Parameters, under Source.  Or with code,

myFLV.source = “yourfile.flv”;

And wise, bad teacher sez… learning to program isn’t about memorizing lines of code, but memorizing where you last wrote those lines of code.

Advertisements

7 thoughts on “Looping an FLV, (my own personal reminder)

  1. Great, thanks. Hey how’d you get a 20 minute video into YouTube? I thought the cap was 10 minutes these days. You grandfather-clause that in somehow?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s