;

PDA

Click to See Complete Forum and Search --> : Import FlV--why?


jimventola
09-16-2005, 10:10 AM
I see that I can import an flv into km just as I can import an swf. But searching here on flv and reading the threads on netstreaming and flv players and downloading the examples, I have learned that you use actionscript to play an flv.

The user manual talks of importing flv but gives no further instructions. So why do we import them? Is this just what you have to do before you can use the actionscript code or is there an easier way to control an imported flv?

With all the reading and studying of downloaded files, I still cannot make a flash file to play an flv. I love the movie overview feature of KM, but somehow I must be missing an essential step in the process.

Bottom line: why does km have an import flv feature and how is it used?

tmoore935
09-16-2005, 11:10 AM
I looked at macromedias flash 8 and it imports and embeds flv files at your choice. But an embeded flv is a very big swf file. Streaming a flv makes more sense because of the large files.

Here is an example of a FLV player which you probably saw already:
http://www.flashkit.com/board/showthread.php?t=647294

Can you get the flv player to play with what I uploaded?

jimventola
09-16-2005, 04:29 PM
Thanks for the reply and thanks for the flv players you have shared.

So it seems that importing an FLV sort of defeats the purpose having the flv separate and then doing a "progressive download" type of "streaming"? But I also read on a Swish forum that someone did research and finds that embedding an SWF does NOT produce a larger file than FLV or one of inferior quality in most cases. So now I am not sure if I should be spending all this time on playing separate FLV files in the first place.

Still, I think that now that Macromedia is using the new On2.com codec (they now sell Flix) it might be that FLV video will be superior to embedded .swf. Comments?

Yes, I have seen the Sheryl Crow and the other rock videos played from KM files. They work fine from the links and the downloaded test video does play locally. (I suppose I could just rename my file "smallz.flv" and use the .fun file that plays that video, but that isn't getting me any learning.)
Altogether, I think I have downloaded three flv players for KM: scrow.fun and test.fun and flvtest.fun. One that I downloaded even lets you have a list of videos to play--it works fine in the link, but I cannot sort it out locally.
I use movie overview to study the actionscript and I experiment to try to get them to work, but I am still pretty lost. Why, for example, can one not have a separate play and pause button, (as someone says he has discivered)? Where do I put these codes? How do I create the video object that the codes talk to? As you can see, I am like first year Latin student trying to read Vergil: I get a word here and there and some of what I see makes sense, but I need a trot.

There is an excellent audiovisual tutorial series at gotoandlearn.com (Lee Brimelow) that shows how to do it in FlashMX 2004, step by step. Apparently, to play an FLV file residing in the same folder, I would need only this code in Flash:

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);

ns.play("myvideo.flv";

He says that the first line creates the video object, the television set to use a metaphor. The third line establishes the cable link, to use the same metaphor. "theVideo" is the rectangular object that will contain the flv; it resides on another layer from the actionscript. The last lines are clear enough, except the (ns) bit.

But I read in a coment to one of the flv players I downloaded that "KM doesn' allow us to create only a video object." Not sure what that means,but I do have the code that is used instead. Unfortunately, that code is for controlling the video and I am still at the level of wanting to learn merely playing it.

The .fun files that people post are helpful but frustrating if you are missing some key information. What would be great is if someone who has got this working would produce a step by step guide. (That could then make it into the next edition of the Users' Guide as an alternative to importing.)

Again, thanks for the help.

tmoore935
09-16-2005, 07:34 PM
I can't answer all your questions but when you import a flv into koolmoves, its actuall streamed. So mabye import is a bad name. My player is less than 40k and my videos are 16meg. So for me, I think it is better to do it this way. At least it can start to play even before it is all loaded.

http://www.flashkit.com/board/showthread.php?t=641972&page=1
Wbrants put some coments in his uplaoded version.

This is how I built mine. Then I looked at another and figured out how to load the seconds in a text box. Then I guessed and made a loader bar. (Quite simply seconds played/total seconds = length of the bar.) Then I figured out how to make the actionscript figure it all out so that All I have to do is import a flv and I am done. I still have not made the player go to the next video on its own. And my graphics are simply not there yet. I have used koolmoves before you could add action script and what I do know I learned here. And I have plenty more to learn.

I don't know why the play and pause can't be seperate. When i did it the thing locked up. If you can figure it out, let me know

As far as why flv needs all this coding, the way its set up and all was determined by the ones who created it and I have know idea who that is. And macromedia sort of leads flash in its own direction.

Someone else can be more specific because this is all I know at the moment. I did read a lot about it at macromedia.com using there own search engine.

jimventola
09-16-2005, 10:24 PM
Thanks again. Maybe I should start at the beginning. W.Brants says "it is easy" and that we should "Open the video you first want to play like you normally do or create a dummy and set that to play. If the flv movie is named flv1, you can do some nice tricks by adding some code to buttons." And then he gives some code for manipulating the playback. But....

What does he mean by "open a movie as you normally do"? What does he mean by "create a dummy"?

tmoore935
09-16-2005, 10:32 PM
What does he mean by "open a movie as you normally do"? What does he mean by "create a dummy"?

Ask him.

I do know the flv doesn't have to be named flv1. flv1 is what koolmoves calls it.

If you really have problems with this still, I can give a step by step way of doing it with what I have posted. As for now I am going to bed. I get up at 5:15 am.

w.brants
09-17-2005, 01:12 AM
When you import a flv movie, KoolMoves actually creates a movieclip with a video object inside it and some code to load the movie you specified.

Sometimes people want just an empty object and let the user choose what video to play. What I call a dummy is if you would create a flv movie with no content that is zero seconds long so you can specify that one.

Because of the structure KM uses to set up the video playback you'll need actionscript to change the video. Using actionscript you can load another video file into the same object. That's what my example showed.

jimventola
09-17-2005, 09:51 AM
Thanks for that explanation.

When I play your file in a browser, I get a message saying that it references files in [that browser but allowing me to navigate] and then it runs with no video. Clicking does nothing.

I have in that fokder two other files: "smallz.flv" and "video1.flv" (which is another flv renamed when I noticed that name in movie dependencies in your fun.)

What I cannot see in the action script shown in Movie Overview is where the actual flv filenames are brought into the program. I tried just importing the flv files, but of course that is not doing it.

How does KM know the filename of the flv? I see the actionscript in the listbox in your movie, but I can't see how that would work. (In my limited experience with BASIC, I would expect that a variable would have to be assigned a filename somewhere. I just can't find anything like that. Even in the fun files that DO play for me (because the flv is hardwired in?), I'll be darned if I can find the flv filename anywhere in the fun.)

I really like your "FLV Player 1" and once I can populate the listbox properly, it will be a great tool. Thanks again.

w.brants
09-17-2005, 10:07 AM
How does KM know the filename of the flv? I see the actionscript in the listbox in your movie, but I can't see how that would work.

When you look at the behavior tab of the listbox properties you'll find 'Items' the filenames are stored in this list.

The line of actionscript attached to the listbox_root.flv1.netStream.play(this.getValue()); gets the value of the listbox and starts playing the file.

jimventola
09-17-2005, 10:46 AM
Thanks again. I saw the items "video1.flv" and "video2.flv" but didn't think they were actual file names, since they lacked quotation marks. How small things trick us.

And I just did a simple experiment of making a movie with background color and importing an flv. (You mentioned that import flv adds some actionscript, so I thought I would try to find the flv object and the code.) At that point, thougn, siimply exporting to browser played the video. Wow. Who knew playing an flv was that simple?

So it seems that import flv creates an object containing the flv and the code to play it automatically and that code is invisible to us. Moreover, we need to write the actionscript to stop or otherwise control the move. Is that right so far?

w.brants
09-17-2005, 11:15 AM
Is that right so far?

That's exactly how it is :thumbsup:

jimventola
09-17-2005, 02:55 PM
Now I have a new problem. I discovered Necromanthus' FLV player and am able to get it to play one of two flv files locally. But when I upload the files to my html server and open the web page, I see the player but no files play. Why might that be? I made sure to transfer the flv files as binary, and the .html and .swf files are clearly working. But somehow the player is not finding the videos. Is it a path issue? Is my college server blocking me from getting the .flv into the .swf somehow?

tmoore935
09-17-2005, 04:07 PM
I got necromanthus file to play right away. I just changed the name of the files in the two buttons.
http://www.diversioncentral.com/video/necro_flv.html


My html is transfered as ascii but the swf and flv are transfered as binary. These are the defaults on the ftp software that I use.

Are you using 56k or cable/dsl. What I create is done with cable and slower connections are discriminated against.

jimventola
09-17-2005, 05:25 PM
Thanks for the info. It turned out to be my server--I tried on another server and it works perfectly.

(Oh, and what a treat on your link: Jimi Hendricks on acoustic guitar and looking young and happy and healthy.)

Now to try to understand why and how it works. It was easy to use Necromanthus' player--I just called the files the way he wanted them. But that doesn't mean I know what I am doing. I hope someday I will at least be able to load files no matter what they are called!

Nothing beats trial and error and the kind help of folks here on the forum. Flash, Swishmax, and KM elude me because they use a different paradigm from the one I first learned--BASIC and Comal on a C64. I used to just print out the program listing and lie in bed reading until it all made sense. That's not so easy with KM because the code is not all in one place and a lot of it is not visible. But back then the bulletin boards were at 300 baud, so getting help was a tad slower.

Thanks again for all your help!

tmoore935
09-17-2005, 05:52 PM
I get a lot of replies about jimi. i guess i could set up a special jimi link to view some other stuff. I even have the original "Experience" promo and Foxy lady. Ill probably be breaking the law but thats kool.