Thanks Nathan, this worked!!! :-D
From: [email protected] Date: Wed, 5 Oct 2011 03:59:55 -0400 Subject: Re: [SWFObject] flash toggle fullscreen button won't work with SWF object 2.0 To: [email protected] try replacing: swfobject.embedSWF("index.swf", "content", "100%", "100%", "6.0.0"); with: var flashvars = {} var params = {};params.allowfullscreen = "true";var attributes = {};swfobject.embedSWF("index.swf", "content", "100%", "100%", "6.0.0", false, flashvars, params, attributes); Didn't test it but should work if you are using the latest SwfObject.-Nathan On Wed, Oct 5, 2011 at 3:18 AM, Alayna de Graaf <[email protected]> wrote: Thanks Nathen, I had already seen this version of the code, but if you look at my code you will see I have a bit of an adaption as what I am using uses scale, except for if the user has a very small screen - then in that case it puts on scroll bars. I looked around and read many forums to get the version I have. I don't write javascript so I am fairly limited in my knowledge and options! Do you know if the code I have can be modified? OR, the code you have given me below perhaps could be modified to inculde the scaling options I use for my websites? Some of my clients have a very small lap top - so I am designing with their needs in particular in mind - but it's is a very useful modification on SWF object 2.0 due to the scaling options.. Sorry to be a pest - could you have a read of my code, or suggest how I could modify what you sent me to do what I require? Thanks again. Alayna. From: [email protected] Date: Wed, 5 Oct 2011 02:20:52 -0400 Subject: Re: [SWFObject] flash toggle fullscreen button won't work with SWF object 2.0 To: [email protected] I would follow this structure: <script type="text/javascript">var flashvars = {}; var params = {};params.allowfullscreen = "true"; var attributes = {};swfobject.embedSWF("untitled.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes); </script> There is a neat little tool that will generate everything for you for SwfObject. I think many of us here use it. You can't go wrong using it as well. You can check it out here: http://www.bobbyvandersluis.com/swfobject/generator/index.html Nathan Mynarcik [email protected] On Wed, Oct 5, 2011 at 1:50 AM, Alayna de Graaf <[email protected]> wrote: Hi Nathan Thanks for your advice and quick response. I was on the right track as I thought it had something to do with 'allowFullscree' - I have been trying to put that in my code in the correct place but I still can't get it working. Would you mind having a look at the code I sent you and suggesting exactly where I write that line you suggested Into and how to write it exactly. Thanks so much Alayna. From: [email protected] Date: Tue, 4 Oct 2011 14:00:02 -0400 Subject: Re: [SWFObject] flash toggle fullscreen button won't work with SWF object 2.0 To: [email protected] make sure you are passing the parameter 'allowFullscreen = true' in your swfobject. This should allow the FS toggle.Nathan Mynarcik [email protected] www.mynarcik.com On Tue, Oct 4, 2011 at 11:13 AM, Alayna11 <[email protected]> wrote: Hi - toggle button code in flash is clashing with swf object 2.0 code. I am posting both the flash AS2 (yes AS2) code below and also my swf object 2.0 code. I want the toggle button to go fullscreen when pressed but it is not responding (I have the toggle code on the button, and rest of code is on first frame). The swf object code is in the html file. I then want the flash page to scale to whether the user has a small screen or large - so the file always looks the same, except for when the users have a very small screen - then I have some code in the jsp that puts scroll bars on the small screen. Any ideas on how to fix this would be most appreciated.. It works fine when I don't have the swfobject 2.0 code in the html. - Thanks.... THE FLASH CODE: //Don't scale the movie when the stage size changes Stage.scaleMode="noScale"; //Align the stage to the top left Stage.align = "TL"; //Function to toggle between fullscreen and normal size //the toggle fullscreen button calls this function when pressed function toggleFullScreen(){ //if normal size, go to fullscreen, else go to normal size if(Stage["displayState"]=="normal"){ Stage["displayState"]="fullScreen"; }else{ Stage["displayState"]="normal"; } } //Create a listener for each time the Stage is resized var resizeListener:Object = new Object(); //Called each time the stage is resized resizeListener.onResize = function () { //Move the button to the center of the screen toggleFullScreenButton._x=Stage.width/2; toggleFullScreenButton._y=Stage.height/2; } //Add the listener to Stage Stage.addListener(resizeListener); SWF OBJECT CODE AND RESIZE SCREEN CODE: <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> //<![CDATA[ function getViewportSize() { var size = [0, 0]; if (typeof window.innerWidth != "undefined") { size = [window.innerWidth, window.innerHeight]; } else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) { size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; } else { size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; } return size; } function createFullBrowserFlash() { swfobject.createCSS("html", "height:100%;"); swfobject.createCSS("body", "height:100%;"); swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:770px; min-height:390px;"); window.onresize = function() { var el = document.getElementById("container"); var size = getViewportSize(); el.style.width = size[0] < 770 ? "770px" : "100%"; el.style.height = size[1] < 390 ? "390px" : "100%"; }; window.onresize(); } swfobject.embedSWF("index.swf", "content", "100%", "100%", "6.0.0"); if (swfobject.hasFlashPlayerVersion("6.0.0")) { swfobject.addDomLoadEvent(createFullBrowserFlash); } //]]> </script> -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en. -- You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.
