Thursday, 14 May 2009

ActionScript 2.0 or 3.0 ?

Well i chose 3.0

why?

Because it a bit better for my project. But was it a pain to make the video loop with no short freeze frame in the end... With a lot of research and hitting my head in the screen i did it! its perfect now! first of all i used this AS(action script):

import fl.video.VideoEvent;

player.fullScreenTakeOver = false;

player.source = "testmovie.flv";
player.autoRewind = true;
player.autoPlay = true;

function Loop(event:VideoEvent):void
{
player.play();
}

player.addEventListener(VideoEvent.AUTO_REWOUND, Loop);

which was alright, the video was looping but it had a short freeze in the end so with more shouting at my computer i came up with this (just bits and pieces from the net that i managed to put together)

import fl.video.VideoEvent;

player.play("doors_final.flv");
player.autoRewind=true;


function again(event:VideoEvent):void {
player.play();
}
player.addEventListener(VideoEvent.COMPLETE, again);

and i am very happy with this! its a perfect loop especially when i made the beginning and the ending of the video the same.




about ActionScript
ActionScript/flash tutorials
ActionScript/flash tutorials2

No comments:

Post a Comment