Forum Moderators: open

Message Too Old, No Replies

Flashvars and video component

Making the flash 8 flv player component load dynamically

         

AndieR

7:31 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Hello,

I'm really lost on doing somthing so smple I really think I'm a dimwitted person now.

I've been trying to drag the flv player that comes with flash 8 into my scene, set some parameters in the components inspector and then... load the movie through flashvars in my html...

And I just don't know here to put and what to put in the fla file to make it load the movie this way.

Any help would be really really greatly appreciated!

Thank you
Andrea

Richard_N

7:52 pm on Oct 10, 2005 (gmt 0)



you need to link to the flv file from the swf and call it in as you do with external jpg's.

Create a new large enough flash file>

from the Libry menu choose New Video>

place an instance on the stage and resize it to fit the video file, give it an instance name of VideoHolder>

to load and play the video with a button attach this code to your first frame.(make the button obviously first)

video_btn.onRelease = function() {
myVideo_nc = new NetConnection();
myVideo_nc.connect(null);
newStream_ns = new NetStream(myVideo_nc);
VideoHolder.attachVideo(newStream_ns);
newStream_ns.play("whatever.flv");
}

Just upload whatever.flv and the swf to the same folder on your site and embed the swf as usual

AndieR

8:17 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Hello,

Thank you for your reply, but the fact is that I can't specify the name of my video in the fla file. I need to retrieve it with Flashvars in the embed code of the html file...

I know how to set my flashvars in the html but I have no idea how to link my flv player in the fla source to load the flashvars from the html...

Thank you,
AndieR

Richard_N

8:52 pm on Oct 10, 2005 (gmt 0)



why can't you define the movie name?

Richard_N

8:54 pm on Oct 10, 2005 (gmt 0)



or are you ripping a movie from someone else/another domain maybe?

AndieR

8:59 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Hello,

I can't define a static flv name in my fla because the final swf will only be a player and I will be passing the name and path of the video file through a dynamic php source and flashvars combiation in the page the player will load into.

So if the visitor chooses to click on the link 1 in the php page I will pass on the path to link 1 through flashvars and if he chooses to click on link 2 in the php page I'll reload it with link 2 path in the flashvars again etc.

Thank you!,
AndieR

Richard_N

9:10 pm on Oct 10, 2005 (gmt 0)



Ok well just define a new variable in actionscript and read it in to the script I gave you instead of whatever.flv