-
FLV cue points
Hello,
I have encoded my video and added 3 cue points, BEGIN, MIDDLE, END. What I would like to do is while the streaming movie is playing and it gets to the "MIDDLE" cue point, jump ahead to another frame in the timeline of my flash movie. Is there a way to do this without writing code from scratch? I'm not very good with code.
Thanks,
T
-
Senior Member
Have you imported the video into your movie?
- The right of the People to create Flash movies shall not be infringed. -
-
Thanks for the response. Yes I have imported the video and it's in the timeline and I can see the cue points in the parameter window.
What I'm trying to do (without writing code if possible) is have text next to the video that addresses what is going on at the beginning of the video. Then at the middle portion of the video (called "middle cue point") I was to go begin playing frames so that the middle text appears to go along with the middle of the video. So I would have a stop on frame 1 and when the middle cue point arrives in the streaming video the timeline would go to frame 2 and play until frame 20 at which point it will stop again.
Hope this makes sense.
Thank in advance,
T
-
Senior Member
I don't know you can actually do something with cuepoints when the video is imported. I know you can do something with cuepoints when the video is handled with actionscript. Without AS I think you can't do anything and it's not difficult. Check cuepoint in the flash helpfiles, onCuePoint method for video objects.
- The right of the People to create Flash movies shall not be infringed. -
-
Senior Member
I know you don't like the actionscript idea...but, maybe try this.
As long as your cue points are set up as "Event" points and you are using the FLVPlayback component...adding an event Listener could work.
Code in Frame 1 AS layer:
Code:
var MiddleCuePointListener:Object = new Object();
MiddleCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "MIDCUEPOINTNAME") {
gotoAndPlay(2);
}
};
FLVCOMPONENTNAME.addEventListener("cuePoint", MiddleCuePointListener);
stop();
Just change "MIDCUEPOINTNAME" to whatever you named your middle cuePoint and change "FLVCOMPONENTNAME" to whatever you name your FVLPlayback component. Then at frame 20 you can add your stop(); or whatever other function you want to occur. Play with that...see if that works or helps at all.
-
Thanks for the reply caroach. I tried the code and I "think" I changed it in the right places, but it didn't seem to work. Could you confirm that I did this correctly?
The name of my second cue point (the one I where I want the middle of the video to trigger the move to frame 2) is called:
2_doors
The name of my flv component is default:
FLVPlayback
(I'm not sure if you're talking about the component in the library or the content path to the video file, which is "superior_4_flash.flv")
__________________________________________________ ___________
var MiddleCuePointListener:Object = new Object();
MiddleCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "2_doors") {
gotoAndPlay(2);
}
};
FLVPlayback.addEventListener("2_doors", MiddleCuePointListener);
stop();
-
Senior Member
I think we're getting close
The FLVPlayback component is the component in the library. Rather than leaving the component name default, let's make our lives easier and give it a unique name like "playback_flv". Also, the name "cuePoint" at the end does not change to "2_doors" as it refers to our function, not the actual cue point we are listening for. So...try this:
Code in frame 1 of AS layer:
Code:
var MiddleCuePointListener:Object = new Object();
MiddleCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "2_doors") {
gotoAndPlay(2);
}
};
playback_flv.addEventListener("cuePoint", MiddleCuePointListener);
stop();
Now...something else I'm thinking could cause a problem...once the FLV movie gets to the "2_doors" cue point, I don't know if the FLV playhead will continue to advance if the main Flash movie playhead is advancing to frame 20. Again, it's something I've never played with, so this may not be an issue.
Try the code...see if it works...let me know.
Thanks!
-
Hi caroach,
I copied the code and renamed the player, but I'm sorry to say it didn't work. It played the video as usual, but didn't advance the movie frame to 2. I appreciate your help with this. Let me know if you have any other ideas.
Thanks,
T
-
Senior Member
Ckeck the comments in the bottom:
http://livedocs.macromedia.com/flash...=00002582.html
And you did not say that you are using the component. If you use the component don't import your video into the movie. Play it streaming. Probably it does not work because you have the video imported in the movie.
Last edited by cancerinform; 12-18-2006 at 08:29 PM.
- The right of the People to create Flash movies shall not be infringed. -
-
Flashkit historian
-
Don't know if you still needed anything......
Took the code posted by caroach, and added some items. They all work, text into dynamic text field, and mclip slider_mc reacts to command in if statement 2. Don't know if this might help, but are your cuepoints set as Events or Navigation? Mine are set as Event.....
Cheers
var MyCuePointListener:Object = new Object();
MyCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "CP_1") {
trace("this is cuepoint one");
my_text.text = "This is cue point one, and this darn thing works";
}
if (eventObject.info.name == "CP_2") {
trace("this is cuepoint two");
my_text.text = "This is cue point two, oh man!";
slider_mc.gotoAndStop(2);
}
if (eventObject.info.name == "CP_3") {
trace("this is cuepoint three");
my_text.text = "This is cue point tree, oh man, oh man!";
}
};
my_flvPb.addEventListener("cuePoint", MyCuePointListener);
Last edited by designforce; 12-19-2006 at 06:46 PM.
Reason: l;eft out some info
-
Hey Designforce,
Not that I'm an expert, but this looks good. I really appreciate the work that you all have invested in my little problem.
So if my cue points are:
begin
2_doors
last
Would I replace the following with the above?
this is cuepoint one
this is cuepoint two
this is cuepoint three
and lastly did you put the parentheses to bring attention to the cue points or are they (the parentheses around the cuepoints) part of the code?
Thanks once more,
T
-
Hey
Look at this, where I have CP_1, etc is what you need to replace.
So, you would put your cuepoint - begin in place of CP_1, and 2_doors in place of CP_2, and last in place of CP_3
My Code:
var MyCuePointListener:Object = new Object();
MyCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "CP_1") {
trace("this is cuepoint one");
my_text.text = "This is cue point one, and this darn thing works";
}
if (eventObject.info.name == "CP_2") {
trace("this is cuepoint two");
my_text.text = "This is cue point two, oh man!";
slider_mc.gotoAndStop(2);
}
if (eventObject.info.name == "CP_3") {
trace("this is cuepoint three");
my_text.text = "This is cue point tree, oh man, oh man!";
}
};
my_flvPb.addEventListener("cuePoint", MyCuePointListener);
WHAT YOUR'S SHOULD LOOK LIKE REMEMBER, YOU DON'T NEED TRACE STATEMENTS, BUT THEY HELP DURING DEVELOPMENT.....
var MyCuePointListener:Object = new Object();
MyCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "begin") {
trace("this is the begin cue point");
my_text.text = "This is cue point one, and this darn thing works";
}
if (eventObject.info.name == "2_doors") {
trace("this is cuepoint 2_doors");
my_text.text = "This is cue point two, oh man!";
slider_mc.gotoAndStop(2);
}
if (eventObject.info.name == "last") {
trace("this is cuepoint last");
my_text.text = "This is cue point tree, oh man, oh man!";
}
};
my_flvPb.addEventListener("cuePoint", MyCuePointListener);
-
If I might follow up here.
When I put this code into frame 1 it just plays through the movie. If I put a stop before your code on frame 1, it stops and doesn't continue when it hits the cue point "2_doors"
Hmmm. Any other thoughts? Am I doing something wrong? I hope adobe can help the AS challenged on the next version with more icon based functions. arrrrrgggg!
Thanks,
T
-
Let me think....
Can you post your code and state how you used it.
That would save some time.
......
-
sure. First off my player is called:
myflvPb
my cue points (are events) which I put in during encoding are
begin
2_doors
charles
In my timeline (in flash) I have 100 frames. what I want to have happen is on frame 1 the flash movie stops and the video plays. When the video gets to cue point 2 (2_doors), I want the flash movie to advance to frame 2 because on frame 2 I have text that will go along with what is happening in the video. I did not import the video, I'm using the flvPlayback (now called myflvPb) to access the flv movie which will be streaming.
I have put the following code on frame 1 in my flash movie:
var MyCuePointListener:Object = new Object();
MyCuePointListener.cuePoint = function(eventObject:Object):Void {
if (eventObject.info.name == "begin") {
trace("this is the begin cue point");
my_text.text = "This is cue point one, and this darn thing works";
}
if (eventObject.info.name == "2_doors") {
trace("this is cuepoint 2_doors");
my_text.text = "This is cue point two, oh man!";
slider_mc.gotoAndStop(2);
}
if (eventObject.info.name == "last") {
trace("this is cuepoint last");
my_text.text = "This is cue point tree, oh man, oh man!";
}
};
my_flvPb.addEventListener("cuePoint", MyCuePointListener);
-
Senior Member
Try this maybe
So I made a little test movie to see if this helps you.
Download the linked file and disect...
See if it helps at all.
Download File
-
Hey Caroach,
Much appreciated. That's exactly what I was trying to do!
Sorry for the late thanks. The holidays...
Thanks to all,
T
-
Hey all,
If you have time and want to see your feedback at work:
http://www.tomhepburn.com/digitalartist
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|