Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Smile Need help with a dynamic FLVPlayback

    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?

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.

  • #3
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    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?



    EDITED:

    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?
    Last edited by digitalfiz; 05-22-2008 at 03:07 AM.

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    What do you want to do specifically?

  • #5
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    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;

    ??

  • #6
    New Coder
    Join Date
    Nov 2007
    Posts
    72
    Thanks
    0
    Thanked 1 Time in 1 Post
    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':
    Code:
    movie_flv.play('video.flv');
    Of course, this is all in AS2 but, perhaps it can help.

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    It would be something like
    Code:
    instancename.contentPath = _level10.url;
    and then when you put the flash on your page you would use a flashvar titled url.
    Code:
    <object type="application/shockwave-x-flash" data="yourflash.swf" width="#" height="#">
    <param name="flashvars" value="url=video.flv">
    </object>
    I can't remember if you need to have an ampersand before url=.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •