I’m wondering if its possible to resize flash with javascript. I can’t change any code in the flash object alone all I have is html, javascript and php to work with.
Heres what I’ve found so far:
var changeMe = document.getElementById("content_embed");
changeMe.height = yy;
changeMe.width = xx;
if (navigator.userAgent.toLowerCase().indexOf("safari")!=-1) {
var changemeObject = document.getElementById("content_object");
changeMeObject.height = yy;
changeMeObject.width = xx;
}
}
Content Embed is the embed tag and content object is the object tag in the flash. This works in chrome (and probably firefox) but not ie.
In internet explorer I get the error: Unable to set value of the property 'height': object is null or undefined
Here is the example page I have been using:http://futuregamespc.com/behind/Popup/
Can anyone help? Thanks guys, you’re what makes this site awesome.
Yes it is possible.
But, please use swfobject whenever you display flash in your website.
The below given is a sample of the call to swfobject
As you can see,
heightandwidthare passed are parameters.Read swfobject documentation for more details.
Update: Here is another good write up on using swfobject on the Adobe site itself.