Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Cue Points to add a fade to flv

Status
Not open for further replies.

misslilbit02

Programmer
Jun 25, 2005
8
0
0
US
I'm trying to add a fade at the end of my video. I created the cue point in actionscript and now I'm trying to figure out how I fade the movie. I done this with buttons using onEnterFrame but I'm not using a button and have no clue as to what event handler would handle this. Could someone help me to accomplish this. My code is below.

import mx.video.*;
my_movie.contentPath = "tunnel.flv"
var rtn_obj:Object = new Object(); //create cue point object
my_movie.addASCuePoint(11.163, "fade"); //add AS cue point
var listenerObject:Object = new Object();
listenerObject.ready = function(eventObject:Object):Void {
rtn_obj = my_movie.findCuePoint("fade");

//don't know what should go here
}
my_movie.addEventListener("ready", listenerObject);
 
It should be more like this:
Code:
import mx.video.*;
my_movie.contentPath = "tunnel.flv";
my_movie.addASCuePoint(2,"fade");//add AS cue point
var listenerObject:Object = new Object();
listenerObject.cuePoint = function(eventObject:Object):Void  {
	fade(eventObject.target);
};
my_movie.addEventListener("cuePoint",listenerObject);
function fade(mc:MovieClip):Void {
	mc.onEnterFrame = function():Void  {
		if (this._alpha) {
			this._alpha--;
		} else {
			delete this.onEnterFrame;
		}
	};
}

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top