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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash 8 video cue points

Status
Not open for further replies.

multichild

Programmer
Jan 28, 2006
76
GB
Im looking to use cue points to bring up animated text in a movie clip on cue.

All i seem to be able to find is the use of cue points to build a nav, but ive done that, but wondered if anybody new of any tutorials or had any help.

Ive got a guy talking on a white background, and as apple do it i want to bring up text animations or graphics on cue.

cheers

Lee

Accend Web Solutions

 
If you're using NetStream then you will do something like:

[tt]//
NetStreamInstance.onCuePoint = function(infoObject:Object):Void {
if(infoObject.name == "boo"){
trace("boo");
}
}
//[/tt]

If you're using FLVPlayback component:

[tt]//
var listenerObject:Object = new Object();
FLVPlaybackInstance.addEventListener("cuePoint", listenerObject);
listenerObject.cuePoint = function(infoObject:Object):Void {
if(infoObject.info.name == "boo"){
trace("boo");
}
}
//[/tt]

Kenneth Kawamoto
 
Hi there,

thanks for that much appreciated.

In between this conversation i came across this bit of code and tried it and it works well, but I wanted to know how to add extra code to it to use more cue points and with that more output. Can you help me with this too.

var cuePt:Object = new Object();
cuePt.time = 1;//whatever time u want
cuePt.name = "CuePt1";// any name to cue point
myFlv.addASCuePoint(cuePt);


var listenerObject:Object = new Object();

listenerObject.cuePoint = function(eventObject:Object):Void {
// write whatever u want to execute
};
myFlv.addEventListener("cuePoint", listenerObject);

Accend Web Solutions

 
You can add any numbers of cue points using ActionScript and FLVPlayback component:

[tt]//
var cuePointArray = [{name:"cuePt1", time:1}, {name:"cuePt2", time:2}, {name:"cuePt3", time:3}];
for (var i = 0; i<3; i++) {
myFLV.addASCuePoint(cuePointArray);
}
//[/tt]

Kenneth Kawamoto
 
Hi Kenneth,

Much apprecite your help, but my skills arent up to yours in terms of codeing.

Could you assist me in adding that code above in the code I originally supplied.

Do we still need the listener, and how do I use commands to control animations with those cue points.

var cuePt:Object = new Object();
cuePt.time = 1;//whatever time u want
cuePt.name = "CuePt1";// any name to cue point
myFlv.addASCuePoint(cuePt);


var listenerObject:Object = new Object();

listenerObject.cuePoint = function(eventObject:Object):Void {
// write whatever u want to execute
};
myFlv.addEventListener("cuePoint", listenerObject);

Cheers

Lee

Accend Web Solutions

 
var listnerObject:Object = new Object();
myFLV.addEventListener("cuePoint", listnerObject);
listnerObject.cuePoint = function(eventObject:Object):Void {
trace(eventObject.info.name);
};
var cuePointArray = [{name:"cuePt1", time:1}, {name:"cuePt2", time:2}, {name:"cuePt3", time:3}];
for (var i = 0; i<3; i++) {
myFLV.addASCuePoint(cuePointArray);
}

Kenneth Kawamoto
 
Im sorry if im being dumb kenneth, but thank you very much for you help.

Where do I put the seperate, or how do i deal with the seperate commands to call different actions when i cue point is reached?

Lee

Accend Web Solutions

 
Thanks Kenneth i got there,

i used some if statements and all works great.

I'll post the code for anybody else to have if needed.

// Start Cue Point
var listnerObject:Object = new Object();
Player.addEventListener("cuePoint", listnerObject);
listnerObject.cuePoint = function(eventObject:Object):Void {
//trace(eventObject.info.name);

if (eventObject.info.name == "cuePt1"){
_root.Anim_Movie.gotoAndPlay("Cue1");
}

};

var cuePointArray = [{name:"cuePt1", time:3}, {name:"cuePt2", time:10}, {name:"cuePt3", time:15}];
for (var i = 0; i<3; i++) {
Player.addASCuePoint(cuePointArray);
}
// End Cue Point

Accend Web Solutions

 
I have a question about the netstream setup. I want to gotoAndStop on a frame when a cuepoint is reach. Will the written below do that?

"
//
NetStreamInstance.onCuePoint = function(infoObject:Object):Void {
if(infoObject.name == "End"){
gotoAndPlay(10);
}
}
//
"

If not what will exactly do i have to do.
 
Hi there,

I havent used netstream before, but from looking at the code, it doesnt seem to be any problem with that.

Using the array to create the names, and it should be ok.

Have you tried it?

Lee

Accend Web Solutions

 
I was able to make this work, i'm new to actionscript so i had trouble at first, but now it works. Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top