[Javascript] getting flash width and height

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Fri Aug 29 09:29:25 CDT 2003


Hi 

One of the way to get the width and height of a flash

let says that your flash tag look something like this 

OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=5,0,0,0' width='266' height='107' id=ShockwaveFlash1>
<PARAM NAME=movie VALUE='1.swf'>
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#000000>
<EMBED src='1.swf' quality=high bgcolor=#000000 width='266' height='107'
NAME='home' ALIGN='absmiddle' TYPE='application/x-shockwave-flash'
PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED>
</OBJECT

then you can do this who will work in ie and ns6 & 7

function flash_width_and_height(){
var oFlashTag = document.getElementById('ShockwaveFlash1');
var iWidth = oFlashTag.width
var iHeight = oFlashTag.height
	alert('width = ' + iWidth + '\nheight = ' + iHeight);
}

you must call this once the page as loaded like in the body or as you like 
BODY onload="flash_width_and_height()" 

Laurent 



-----Original Message-----
From: Tamer Mazen [mailto:tamer_mazen at hotmail.com]
Sent: 28 August 2003 21:34
To: javascript at LaTech.edu
Subject: [Javascript] getting flash width and height


Hi ,
Can any one tell me how to get Flash width and height using javascriot
functions .



Add photos to your e-mail with MSN 8. Get 2 months FREE*. 


DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information.  It is intended to be conveyed only to the designated
recipient(s) named above.  If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system.  Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.


More information about the Javascript mailing list