View Full Version : cuePoint listener for MediaDisplay only partially works?
mrand01
07-14-2004, 04:07 PM
First off, I would like to say, that I have never had this problem before with any of my other scripts...so I don't know why this isn't working here. For some reason, when the MediaDisplay component gets to a cuepoint, it knows it got there, but it can't trace the name of the cuepoint (normally this works fine). Here's the code:
objListen.cuePoint = function(objEvent:Object) {
trace ("cuepoint hit");
trace (objEvent.name);
if (objEvent.name == "cue1") {
placeScreen(2);
} else if (objEvent.name == "cue2") {
placeScreen(46);
} else if (objEvent.name == "cue3") {
placeScreen(56);
} else if (objEvent.name == "cue4") {
placeScreen(66);
}
}
md1.addEventListener("cuePoint", objListen);
I get both traces, and it comes out like this:
cuepoint hit
undefined
What gives?
GregRohman
08-11-2004, 02:42 PM
Use "objEvent.cuePointName" instead of "objEvent.name" to get the name of the cuepoint that was hit.
The documentation is incorrect. I found this just recently on another site, as I was having the same problem.
-Greg
rtchavez
11-08-2004, 07:08 PM
First of all, Thank you Greg for your post. I was having the same problems as mrand01 with the objEvent.name being "undefined". However, I'm having touble with the listener not hitting the first cue point.
Basically I have a list box that displays the current steps with those steps being the cue points, so when I use the "on(change)" event with the list box it goes to the correct time. Here is my code to play the cue:
on(change){
this._parent.Audio.medDisplay.play(this.selectedIt em.data.attributes.cue)
}
Where it data is an XMLNode object.
Now my example uses a mp3 with 2 cue points defined (1st as 1s and 2nd at 26s). If I let it play from the beginning it *does* hit the first and the second. However when I change the selected item back to cue 1, I do not get the correct cue point. Here is my output from a trace:
name dim_numbers, 1
name dim_handset, 26
name dim_handset, 26
where dim_* is the name of the cuePoint and the ##'s are the cuePointTime.
What I did was let it start. *cuePoint-1 hits*, let it play till it hits cuePoint-2. Then after it has passed cuePoint-2, I *change* the selected item back to the first and I get the 3rd trace. Some how it's not switching back to the 1st cuepoint.
Sorry if this sounds rather confusing. Any help would be greatly appreciated.
Thank you.
I had recently posted this already but had screwed up the rating. I meant to give this a 4 but used my mouse scroll and made it a 1 rating. Sorry about that. I deleted the original in hopes to re-rate it but no luck.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.