Below is an example of using cue points for video transitions. Two external FLV files dissolve into one another. See the code below. It’s perhaps not the best coding scheme but it works for now. There is a cue point 5 seconds from the end of each of the files which trigger the dissolve.
[as]var v1List:Object = new Object();
var who = v2;
v1List.cuePoint = function(cues) {
v1.onEnterFrame = fader;
who = v2;
v2._alpha = 100;
v2.v1.play();
}
v1.v1.addEventListener(“cuePoint”,v1List);
var v2List:Object = new Object();
v2List.cuePoint = function(cues) {
v2.onEnterFrame = fader;
v1._alpha = 100;
who = v1;
v1.v1.play();
}
v2.v1.addEventListener(“cuePoint”,v2List);
function fader() {
this._alpha -= 2;
if(this._alpha < 1) {
this.swapDepths(who);
this.v1.rewind();
delete this.onEnterFrame;
}
}[/as]
No comments:
Post a Comment