View Full Version : Need help with a dynamic FLVPlayback

05-21-2008, 02:01 AM
ActionScript 3.0 and Flash CS3 is what I am using. I am a super n00b when it comes to action script. I just started messing with it a few days ago and I'm playing with the built in stuff for flv videos.

My problem is setting the flv dynamically. I've managed to mess with the skins and get one to look like i want it but I lack any knowledge in action script and its error terminology. Here is how i am trying to set the path hard coded just till I get it to work:

FLVPlayback.contentPath = "moviegen.flv";

FLVPlayback is the default name for the player object im guessing but I get this error when I try to modify it any:

1119: Access of possibly undefined property contentPath through a reference with static type Class.Now I'm assuming there is a way to do this so can anyone help?

P.S. On another note its not a big deal because fixing this problem I think will fix the other. I've read that the flvplayer will resize auto for the video it is playing is this true? If not I was going to set the width and height of the FLVPlayback to the stage height/width. Any opinions on the correct way to go about this?

05-21-2008, 08:56 PM
You shouldn't give your FLVPlayback an instance name of FLVPlayback. That could cause compiler confusion. Try to change the instance name.

If you aren't sure what the instance name is, click on the component on the stage once, and it will show in the properties box.

05-22-2008, 02:59 AM
FLVPlayback is what flash gave the component when I imported the video. You would think flash wouldn't give something it did automatic a name that would cause problems right?


never mind I got what you where saying. I am a flash n00b so forgive me confusion. I found the instance box and now i got it working how i want. My next question is how would i make it so whatever flashvar i set it sets it to that?

05-22-2008, 04:35 AM
What do you want to do specifically?

05-22-2008, 05:17 AM
I want to be able to specify which video my player uses via a flashvar

would it be as simple as doing:

myflvplayer.source = myflashvar;


05-22-2008, 05:41 AM
Hey guys, I've set up a few sites using this sort of functionality. In my sites (which were all coded with ActionScript 2), I've assigned an instance name to an FLVPlayback component. When I wanted to play a movie, either dynamic or coded into the script, I used the play() function and supplied the filename as an argument.

In an example where the component has an instance name of 'movie_flv':


Of course, this is all in AS2 but, perhaps it can help.

05-22-2008, 10:36 AM
It would be something like

instancename.contentPath = _level10.url;
and then when you put the flash on your page you would use a flashvar titled url.

<object type="application/shockwave-x-flash" data="yourflash.swf" width="#" height="#">
<param name="flashvars" value="url=video.flv">
I can't remember if you need to have an ampersand before url=.

05-23-2008, 09:19 PM
OK I got everything working fine what I actually had to do since its action script 3 was this:

videoPlayer.source = root.loaderInfo.parameters.url;

because that level10 example wasnt working.

My next question is a bit more complicated. The project im working on imports a skin and I've modified the skin with a button that goes to a link how would i change that url from my current project or do i need to make it dynamic in the fla of the skin? Im really lost on this one maybe its a bit over my head but thats how i got so far with php just dive in! :)