-
Senior Member
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
-
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?
-
Senior Member
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
-
Im looking into it as we speak, as soon as i find something that works i will post here...
-
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.
-
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...
-
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.
-
Im getting the following error:
There is no property with the name 'displayState'.
Whats this about?
-
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?
-
I changed the name of the button to maximizeButton
Stage.displayState = Stage.displayState == "normal" ? "fullScreen" : "normal";
-
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?
-
-
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.
-
-
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?
-
Iv got it working! Thanx, iv just one problem, it wont work in Opera, Firefox, or Netscape...
-
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.
-
lighthugger - how did you fix your problem? I also get the error...
There is no property with the name 'displayState'.
thanks a lot!
-
Was there any resolution to the displayState error? Thanks!
-
Bmcc*81
Would you guys know a way to have an auto-exit from full screen, once the movie is done?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|