Groups | Blog | Home
all groups > macromedia flash flashcom > january 2007 >

macromedia flash flashcom : Dynamic Playlist with jpg thumbs


splatter2
1/31/2007 1:50:11 PM
Hi guys,

On the Dynamic Playlist the thumbnails are made by connecting to the video and
getting the relevant frame.

I have over 40 videos in my collection and lots of traffic which would mean
every client is connecting to 40 videos each time.

I would like to put in my own jpg image into the list instead of a video frame
capture.

New to all this so any help would be appreciated.

This is what creates the frame capture

nc = new NetConnection();
nc.onStatus = function( info ) { trace( info.code ); }
nc.connect( url );

ns = new NetStream(nc);
ns.onStatus = function(info) {
if ( info.code == "NetStream.Play.Stop" ) {
nc = null;
ns = null;
}
}
thumb.video.attachVideo(ns);
ns.connect();
ns.play( stream, start, 0 );

but I would like to say thumb.image = "my_image.jpg"; or something.

Any ideas?
JayCharles
1/31/2007 4:41:25 PM
You can't load a jpg image through a netstream (or into a video object), so
you'll need to use a moviecliploader instead.

Inside the thumb movie clip, replace the video object with an empty movie clip
(or create one a runtime with actionscript). Then replace all of the
netconnection and netstream code with a movieClipLoader(), and target your
movie clip in your moviecliploader.loadclip() arguments.
splatter2
2/1/2007 10:19:19 AM
Wow, Im a little lost there but I think I know what you are saying.

Trouble is how would I do that?

Lets see if I have it right, create a new movie clip symbol in the library
that is simply the picture.
Then load this in the VideoThumb.as.
I might be completely wrong there as im a newbie to Flash.

Would you have an example of the code to do that?

Thanks
JayCharles
2/1/2007 5:56:06 PM
Ideally, the images will reside outside of the .swf, and you'll load them at
runtime. That way, you don't have to recompile your .swf every time you
add/remove videos.

See the Flash 8 docs about how to use the movieClip loader class, or check the
general flash forum for discussions about it (I'm sure there are plenty).
AddThis Social Bookmark Button