Results 1 to 2 of 2

Thread: SWFObject 2.0

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default SWFObject 2.0

    hello, in the previous version of swfobject i was able to adjust my flash file according to the screen size like this
    Code:
    <script type="text/javascript">
    	var screen_height = screen.height;
    	if (screen_height >= 850) {
    	var so = new SWFObject("swf/main.swf", "main", "1024", "768", "8", "#ffffff");
    	}else if (screen_height <= 849 && screen_height >= 0) {
    	var so = new SWFObject("swf/main.swf", "main", "768", "576", "8", "#ffffff");
    	}
    	so.write("flashcontent");<!--75% of the original-->
    </script>
    but how can i express this in the new SWFObject 2.0
    Code:
    <script type="text/javascript">
    	var flashvars = {};
    	var params = {};
    	var attributes = {id:"flashcontent"};
    	swfobject.embedSWF("swf/main.swf", "flashcontent", "1024", "768", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
    </script>

  2. #2
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    well, i got lucky and figured out most of it
    Code:
    <script type="text/javascript">
    	var flashvars = { };
    	
    	var attributes = {id:"flashcontent"};
    	<!--swfobject.embedSWF("swf/main.swf", "flashcontent", "980", "750", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);-->
    		
    	var screen_height = screen.height;
    	if (screen_height >= 769) {
    	var params = {wmode:"Transparent", scale:"noscale", quality:"high", bgcolor:"#000000", allowscriptaccess:"samedomain", allowfullscreen:"true"};
    	var so = new swfobject.embedSWF("swf/main_mc.swf", "flashcontent", "980", "750", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
    	}else if (screen_height <= 768 && screen_height >= 0) {
    	var params = {wmode:"Transparent", quality:"high", bgcolor:"#000000", allowscriptaccess:"samedomain", allowfullscreen:"true"};
    	var so = new swfobject.embedSWF("swf/main.swf", "flashcontent", "735", "563", "9.0.0", "swf/expressInstall.swf", flashvars, params, attributes);
    	}
    	so.swfobject.embedSWF("flashcontent");	
    	
    </script>
    but i have a video inside and when it goes to full screen, the settings are screwy

Bookmarks

Posting Permissions

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