FORUMS: list search recent posts

converting video to flash?

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
converting video to flash?
on Jan 30, 2006 at 1:25:25 am

I have a video i exported out after effects as flash, it plays and every thing but i would like to add a play, pause button and a time marker to the video using flash. For example, if you go to and view the promos for the new premiere or AE it is in flash and at the bottom of the video it has a play and pause button, how would i accomplish this using flash?

Return to posts index

Chris Figat
Re: converting video to flash?
on Jan 30, 2006 at 2:49:26 pm

Two different things, when you seen video being played and paused in Flash it's usally an FLV file that's been exported from AE (an actual video file). if you've exported to a flash format (SWF) from AE you can just add buttons that stop and start the animation by creating a button and assigning an action to it.

Check out Lee's tutorials on here for some great info on how to use FLV files in flash. his tutorials are for Flash MX 2004 but the same principles apply to Flash 8.


Return to posts index

Re: converting video to flash?
on Jan 30, 2006 at 5:15:42 pm

As Chris said, it is a different process if you have FLVs or SWFs, but the concepts are the same.

If you're using FLVs, the only thing that Lee's Tutorial wouldn't cover would be the time marker, which is probably the most complicated of your requests in either FLV or SWF situations.

If you are dealing with SWFs, all you need is a pause and play button (with instance names pauseBtn and playBtn for this example), and the following code:

pauseBtn.onRelease = function() {

playBtn.onRelease - function() {

The Time Marker in itself is not that difficult ("_root._currentframe / 12" will give you the position of your main timeline in seconds), the probem is getting the output to actually look like time. I would do it sort of like this (assuming you have a dynamic text field on your stage to display your Time Marker called showTime and you're running at 12 Frames Per Second):

timeLoop.onEnterFrame = findTime;

function findTime() {
var t:Number = _root._currentframe / 12; //set "12" to your framerate
var tc:String = new String();
var min:Number = Math.floor(t/60);
var sec:Number = Math.round(t%60);
if (sec<10) {
tc = ( min.toString() + ":0" + sec.toString() );
} else {
tc = ( min.toString() + ":" + sec.toString() );
showTime.text = tc;

{most of this code was taken from Lee's Timecode Class ( ) and assumes you don't want hours}

If you were working with FLVs the code would be pretty much the same, but you would use "ns.time" to get the current time in seconds of your FLV, so you would replace the line:

var t:Number = _root._currentframe / 12;


var t:Number = ns.time;

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved