A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Flash Video Player - Add a Full Screen Option

  1. #1
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522

    Flash Video Player - Add a Full Screen Option

    I want to add a button to my custom Flash Video Player that will make the video blow up full screen. I've seen this done with the YouTube and other Flash Video Player websites. Does anyone know the code how to do this?

    PS - I'm using this code for my video player:

    code:


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

    // NetStream setup
    var ns:NetStream = new NetStream(nc);

    // attaching NetStream
    video.attachVideo(ns);

    // playing external flv
    ns.play("myflv.flv");

    Foochuck
    http://www.myspace.com/foochuck

  2. #2
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    Im having the same problem doing exactly the same thing. Iv asked so many people about this, but its seems to be a secret of some sort. Did you ever get this problem fixed?

  3. #3
    Senior Member foochuck's Avatar
    Join Date
    Aug 2000
    Location
    Estero, FL
    Posts
    522
    Quote Originally Posted by lighthugger
    Im having the same problem doing exactly the same thing. Iv asked so many people about this, but its seems to be a secret of some sort. Did you ever get this problem fixed?

    No luck yet. If I find anything, I'll post it here. Please do the same.
    Foochuck
    http://www.myspace.com/foochuck

  4. #4
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    Im looking into it as we speak, as soon as i find something that works i will post here...

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Here you go.

    Code:
    maximizeButton.onRelease = function() {
    	Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
    }
    replace maximizeButton with the name of your button's instance.

    You also have to include
    Code:
    <param name="allowFullScreen" value="true">
    and

    Code:
    allowFullScreen="true"
    in the embed tag.
    Last edited by XBSHX; 06-15-2007 at 03:17 AM.

  6. #6
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    Im not 100% with you on this one?

    Do I attach the following code top the button?

    maximizeButton.onRelease = function() {
    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
    }

    And where is the following code inserted?
    <param name="allowFullScreen" value="true">

    Thanx for you help on this matter...

  7. #7
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Quote Originally Posted by lighthugger
    Im not 100% with you on this one?

    Do I attach the following code top the button?

    maximizeButton.onRelease = function() {
    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
    }

    And where is the following code inserted?
    <param name="allowFullScreen" value="true">

    Thanx for you help on this matter...
    maximizeButton.onRelease = function() {
    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
    }
    is the actionscript that you use for your button, the <pram name="allowFullScreen" value="true"> you add to the html for embedding the .swf, hope this helps.

  8. #8
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    Im getting the following error:

    There is no property with the name 'displayState'.

    Whats this about?

  9. #9
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Quote Originally Posted by lighthugger
    Im getting the following error:

    There is no property with the name 'displayState'.

    Whats this about?
    hmm, did you change the name of the button from maximizeButton to the name of your button?

  10. #10
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    I changed the name of the button to maximizeButton

    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";

  11. #11
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Quote Originally Posted by lighthugger
    I changed the name of the button to maximizeButton

    Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
    did you give the button an instance name of maximizeButton?

  12. #12
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    yeah

  13. #13
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    hmm, I'm not sure then... maybe its a Flash 8 problem since I tested the code in Flash CS3 (9), its Actionscript 2 code though so I dunno lol.

  14. #14
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    im using flash 9

  15. #15
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Quote Originally Posted by lighthugger
    im using flash 9
    where are you putting the actionscript? in the button or in a frame on a script layer, or an external .as file?

  16. #16
    Junior Member
    Join Date
    Jun 2007
    Posts
    8
    Iv got it working! Thanx, iv just one problem, it wont work in Opera, Firefox, or Netscape...

  17. #17
    Junior Member
    Join Date
    Jun 2007
    Posts
    21
    Quote Originally Posted by lighthugger
    Iv got it working! Thanx, iv just one problem, it wont work in Opera, Firefox, or Netscape...
    did you put allowFullScreen="true" in the <embed> tag for your swf? you need both the <pram name="allowFullScreen" value="true"> and the allowFullScreen="true" in the <embed> tag.

    This is what I use
    Code:
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','640','height','512',"allowFullScreen", "true",'title','Video Player','src','newplayer','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','newplayer' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="640" height="512" title="Video Player">
        <param name="movie" value="newplayer.swf" >
        <param name="quality" value="high">
        <param name="allowFullScreen" value="true">
        <embed src="newplayer.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="640" height="512" allowFullScreen="true"></embed>
      </object></noscript>
    where newplayer.swf is the name of your .swf
    And change the width and height to your .swf's dimensions.

  18. #18
    Senior Member
    Join Date
    Feb 2002
    Location
    UK
    Posts
    436
    lighthugger - how did you fix your problem? I also get the error...

    There is no property with the name 'displayState'.



    thanks a lot!

  19. #19
    Junior Member
    Join Date
    Mar 2001
    Posts
    6
    Was there any resolution to the displayState error? Thanks!

  20. #20
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299
    Would you guys know a way to have an auto-exit from full screen, once the movie is done?
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center