Groups | Blog | Home
all groups > flash (macromedia) > november 2007 >

flash (macromedia) : How to Create Video Thumbnail,,,??


kc119
11/2/2007 12:00:00 AM
I'm stumped.. I've found one t utorial but haven't figured out how to use it in
conjunction w/ the media player component.. here is the link for it..
http://www.flashcomguru.com/tutorials/progressive_preview.cfm

if anyone could help explain step by step on where to put AS and what to do so
it pauses on video so it has a thumbnail image i would appreciate it
dzedward
11/2/2007 12:00:00 AM
create a new layer called "actions" lock the layer, and click the frame. Open
the actions panel. paste this in there

nc = new NetConnection();
nc.connect(null);
ns = new NetStream(my_nc);
ns.setBufferTime(0.1);
my_video.attachVideo(ns); // my_video is the instance name of the media player
on stage( you must click it once and type in this name where it says <instance
name>)
ns.play("http://www.yoursite.com/video.flv);

ns.onStatus = function (info) {
if(info.code == "NetStream.Buffer.Full"){
ns.pause();
}
};

then your button will tell, ns (NetStream), to play. EX:
my_btn.onRelease = function(){
ns.play();
};
kc119
11/2/2007 12:00:00 AM
**Error** Scene=Scene 1, layer=Layer 5, frame=1, Line 6: String literal was not
properly terminated
ns.play("CDDdemo2.flv);

**Error** Scene=Scene 1, layer=Layer 5, frame=1, Line 8: ')' or ',' expected
ns.onStatus = function (info) {

Total ActionScript Errors: 2, Reported Errors: 2
dzedward
11/2/2007 3:28:26 PM
You didn't put end quote on the FLV file name, should be
dzedward
11/2/2007 3:29:04 PM
sorry, just noticed I didn't in my example. My fault.

kc119
11/2/2007 3:52:01 PM
kc119
11/2/2007 3:53:00 PM
dzedward
11/2/2007 3:56:18 PM
[b]replace[/b]
ns.onStatus = function (info) {
if(info.code == "NetStream.Buffer.Full"){
ns.pause();
}
};
[b]with[/b]
ns.onStatus = function (info) {
trace(info.code);
if(info.code == "NetStream.Buffer.Full"){
ns.pause();
}
};

Tell me what traces out..
kc119
11/2/2007 3:57:52 PM
NetStream.Play.Start
NetStream.Buffer.Full


kc119
11/2/2007 4:04:56 PM
dzedward
11/2/2007 4:05:34 PM
Okay, I just noticed you are using the Media Component, well the NetConnect and
NetStream classes are not made for that. In your library panel, top right
corner just below where the close button is, you will see a little symbol with
Three lines and an arrow pointing downward. Click that and select New Video.
Hit okay, and drag that video to the stage. Give it the instance name
my_video. Test.
dzedward
11/2/2007 4:05:58 PM
kc119
11/2/2007 4:08:17 PM
kc119
11/2/2007 4:11:39 PM
dzedward
11/2/2007 4:11:47 PM
okay, you have the component on stage. Open the component inspector window,
and type the URL to the video. Then down at the bottom click the + symbol.
For name, type in, pauseIt. Then enter the time you want it to pause at, it
goes,
Hours:Minutes:Seconds:Milliseconds. Now, go back to where your previous code
was, delete it and paste this in there

var myCuePointListener:Object = new Object();
myCuePointListener.cuePoint = function(eventObject:Object){
if(eventObject.cuePointName == "pauseIt"){
my_video.pause();
}
};
my_video.addEventListener("cuePoint", myCuePointListener);
kc119
11/2/2007 4:14:21 PM
ok do yo have a flash source i can just replace w/ my vid? this is getting confusing..
kc119
11/2/2007 4:18:51 PM
okay.. do i need to replace myCuePointListener w/ the cuepoint name?

dzedward
11/2/2007 4:19:19 PM
put the component back on stage and give it the instance name of, my_video. I
told you to do that to get the NetConnect and NetStream to work.
http://www.imediapro.com/damonTesting/test/cuePoint.fla.zip. You will need to
click the component on stage, open the component inspector and enter the URL to
your video. It will pause after 2 seconds.
kc119
11/2/2007 4:29:27 PM
kc119
11/2/2007 4:30:46 PM
dzedward
11/2/2007 4:33:14 PM
So you are using the FLVPlayback Component than. Why don't you zip up your
file, and post a link to it. I'll fix it from there. You don't know enough
for me to grasp what is going on on your side. I've gone through 3 iterations
now of different possibilities.
dzedward
11/2/2007 4:33:38 PM
So you are using the FLVPlayback Component than. Why don't you zip up your
file, and post a link to it. I'll fix it from there. You don't know enough
for me to grasp what is going on on your side. I've gone through 3 iterations
now of different possibilities.
kc119
11/2/2007 4:43:35 PM
kc119
11/2/2007 4:44:22 PM
kc119
11/2/2007 4:49:38 PM
dzedward
11/2/2007 4:55:58 PM
kc119
11/2/2007 4:56:25 PM
kc119
11/2/2007 6:26:41 PM
dzedward
11/2/2007 7:02:41 PM
kc119
11/2/2007 8:19:04 PM
var myCuePointListener:Object = new Object();
myCuePointListener.cuePoint = function(eventObject:Object){
if(eventObject.info.name == "pauseIt"){
trace('CDDdemo.flv');
myVideo.pause();
AddThis Social Bookmark Button