ggalan
02-21-2010, 12:42 PM
hello, in the previous version of swfobject i was able to adjust my flash file according to the screen size like this
<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
<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>
<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
<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>