This content has been marked as final. Show 11 replies
FLV and SWF are two different formats. FLash Video is a way of encoding video files, ShockWave Format is for regular Flash files.
A SWF file can wrap around an FLV and have it inside of it and in that case you could use loadMovie, loadMovieNum, or the MovieClipLoader class to load and play that SWF – which just happened to contain and FLV.
But for a straight FLV file you need to use either the Media components or the NetStream class to load and control it.
Read the help files for all of these things and you will get a much better understanding. PS: Don't do a search, just go to the ActionScript and Component Dictionaries in the help files. There you will find entries for each of these things and all their capabilities.
Hey, thanks a lot for the advice. I'm sure I'll find some useful info. It's hard when you don't know what to search for in the first place.
> Here's where I'm confused. I know Flash uses FLV files and somehow
> SWF's into FLV's upon playback? Am I wrong?
Yes .. you are completely wrong.
> okay, I'm a little confused
> because in no tutorial does it show you how to loadMovieNum with an FLV
That's because yu cannot laod and FLV with loadMovieNum .. that is for
loading SWF (and some image formats).
That is the secret of the help files for actionscript: Don't search. Almost always you will get too many hits about topics that won't help you. Instead go right to the dictionaries for the Actionscript language and/or the components. There you can fairly easily find the class or component you need. Then everything you can do with it will be laid out right there. Sometimes if you are just totally lost, do a search until you find a page that has a Class that you need and then go directly to that page.
hi drag a video component from component panel
name it my_video
var my_video:Video; // my_video is a Video object on the Stage
var my_nc:NetConnection = new NetConnection();
var my_ns:NetStream = new NetStream(my_nc);
this code will hep you to play flv file dynamically
Thanks for the code, Darr. This brings up a question, though:
I have imported 5 separate flv videos into five separate frames, and I am using gotoAndStop to go to each frame to play each video. Is there a disadvantage to doing it this way? It seems to work fine, and I'm pretty sure it is not embedded and loading dynamically.
Can you tell me what the advantages are to using NetStream to attach the video over the method I am using? I would like to make my webpage with the most efficient code I can figure out. Thanks for any advice.
If you have imported them into the frame then they are most likely embedded. How big is your published SWF file? When published do you have to put the html, swf, and five FLV files onto your website to make it work?
The advantage to external files dynamically called is that the original SWF will load quicker, allows the Flash plug-in to better manage memory usage, and (this is the best part!) the external FLVs can have a different frame rate from the swf file.
My published swf is about 1MB. The videos are all around 2MB each. My guess is that they are getting loaded as needed, and are not embedded. Is there an easy way to find out?
Moving my swf from its original file folder to the desktop and clicking on the movie links, the movies do not play. I am guessing that this means that the SWF is getting the video from the original file folder. I am relatively new to web design, so I'm never completely sure.
Thanks for the info and all the help. I'll try to return the favour some day.
That would indicate that they have indeed been linked and not embedded. So I'm a little bit confused by what you meant by "I have imported 5 separate flv videos into five separate frames."
My guess is that on five different frames you have put an instance of the media playback component and set the source to be the respective five files? To my mind it would be better to have one instance of the media player and use the code to load different movies into the same one as needed.
Also 1MB is rather large for something going to be delivered over the web.
The Macromedia/Adobe components work fine (for the most part) when used exactly as intended. They add a fair amount of heft to your published file – especially when compared to what they do. Not that the media components add that much to your 1MB total, but you can get the size down by using the NetStream technique. Of course you then need to make your own player and, depending upon what features you need, that can be a fairly simple or daunting task.
There used to be good tutorials at gotoAndLearn.com, but last time I was there I didn't see where they had gone.
This is how I linked to my flv videos:
I selected the keyframe on which I wanted to have the video play.
I chose Import Video
Selected my FLV
Selected Skins, etc
The video componed then appeared on stage.
I resized the video to appear where I wanted it to.
Moved on to the next frame where I wanted the next video to appear.
I am pretty sure that this has made 5 separate video components in the website. Would this be the cause of such a large file size? I have many graphics and tweens throughout that probably contribute, as well as an external MP3. I made a mistake on the file size, as it is actually 673kb. Still too big? There are around 12 graphically-intensive pages.
I will check out gotoAndLearn.com.
gotoandlearn is awesome.