Tutorials to .com

Tutorials to .com » Website » Flash » Home Flash FLV Video Player

Home Flash FLV Video Player

Print View , by: iSee ,Total views: 11 ,Word Count: 536 ,Date: Wed, 26 Aug 2009 Time: 9:59 PM

Hello everyone, Not long ago I would CenFun Music Player adding flv video playback, where a separate show to give you a flash FLV player (only ActionScript control, do not use FLVPlayback component) and, if irregularities look to correct me.
Here's to open your Macromedia Flash Player 8 (recommended) get started!

First, a new document, set the background color black, the other by default, and then build four layers.

The first layer is used to place video components, as follows:

1, in the "library" panel ( "window" "" library "), from the" library "pop-up menu, select" New Video. "
2, in the "Video Properties" dialog box, name the video component and select "Video" (by ActionScript control).
3, the video object from the "Library" panel onto the middle of the stage to create the video object instance.
4, taking an instance of this video component, called "my_video".

The second layer is used to place video address input field, as follows:

1, on the stage at the bottom left with the text tool (shortcut T) draw an address input text box, type select "Input Text" type.
2, in the "lines of type" pop-up menu, select "single" and also that "in the text that appear around the border" is selected.
3, which take an instance of the text box named "url".

The third layer is used to let play the Start button, as follows:

1, in the "library" panel ( "window" "" library "), the New Symbol button, the button would produce its own style is good, the line can be used temporarily.
2, the new button object from the "Library" panel onto the stage, behind the address input box to create a play the Start button.
3, which plays the Start button to take an instance, called "play_bt".

The fourth layer is used to put all of the ActionScript:

/ / First, initialize
/ / Create a NetConnection object
var my_nc: NetConnection = new NetConnection ();
/ / Create a local streaming connection
my_nc.connect (null);
/ / Create a NetStream object
var my_ns: NetStream = new NetStream (my_nc);
/ / Write a play function playflv ()
function playflv (flv) (
/ / Parameter flv to play flv video address
/ / trace (flv); / / test
/ / Attach the NetStream video input signal to the Video object, namely, video components my_video
my_video.attachVideo (my_ns);
/ / Set the buffer time, units of seconds, the following 3 seconds can be set up
my_ns.setBufferTime (3);
/ / Start playing FLV files
my_ns.play (flv);
/ / Click the Start Play button to start playing
play_bt.onRelease = function () (
playflv (url.text);
/ / Get the url input box of the video file address and call the play function, play url of the flv video files corresponding to

Adobe Flash Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.