Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash movies width/height

Status
Not open for further replies.

801119

Programmer
Apr 10, 2000
311
SE
Grettinsgs all...

Is there a way to read the width / height of a flash movie of unknown format?

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Not quite sure what you mean by "of unknown format", as you really need to know in advance the width/height of the movie before placing it on the page.

The following works, but onloy because the width and height are known in advance:

Code:
<HTML>
<HEAD>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--

	function findDimensions()
	{
		var flashMovieObj = document.getElementById('flashMovie');
		alert(flashMovieObj.width);
		alert(flashMovieObj.height);
	}

//-->
</SCRIPT>
</HEAD>
<BODY>

<div id=&quot;globalnav&quot;>
	<object id=&quot;flashMovie&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot;[/URL] width=&quot;756&quot; height=&quot;88&quot;>
		<param name=&quot;movie&quot; value=&quot;[URL unfurl="true"]http://www.macromedia.com/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79&quot;[/URL] />
		<param name=&quot;quality&quot; value=&quot;high&quot; />
		<param name=&quot;scale&quot; value=&quot;noscale&quot; />
		<embed id=&quot;flashMoveiEmbed&quot; src=&quot;[URL unfurl="true"]http://www.macromedia.com//swf/globalnav/globalnav_en_us.swf?fpReqMinor=79&quot;[/URL] type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer&quot;[/URL] quality=&quot;high&quot; scale=&quot;noscale&quot; width=&quot;756&quot; height=&quot;88&quot;></embed>
	</object>
</div>

<BR>Click <a href=&quot;javascript:findDimensions();&quot;>here</a> to find dimensions of Flash movie...

</BODY>
</HTML>

Hope this helps!

Dan
 
No, think of it like this.

When you add an image to a site it will be the same size as the image, without adding width=&quot;z&quot; height=&quot;x&quot;
But when you add a flash-move and don't add width=&quot;z&quot; height=&quot;x&quot; then the movie gets smaller (least for me it does) and I want the movies to be width=&quot;560&quot; but then the hight isn't changed and since I don't know the ratio it's impossible for me to determine the hight of the flash-movie.

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Aaah..

Then you'd specify just the WIDTH parameter, and use the SCALE parameter with a value of &quot;showall&quot;. This keeps the aspect ratio of the movie as per its original size.

Using the above example, you can see that I've changed the WIDTH property and removed the HEIGHT property altogether:

Code:
<div id=&quot;globalnav&quot;>
    <object id=&quot;flashMovie&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot;[/URL] width=&quot;456&quot;>
        <param name=&quot;movie&quot; value=&quot;[URL unfurl="true"]http://www.macromedia.com/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79&quot;[/URL] />
        <param name=&quot;quality&quot; value=&quot;high&quot; />
        <param name=&quot;scale&quot; value=&quot;showall&quot; />
        <embed id=&quot;flashMoveiEmbed&quot; src=&quot;[URL unfurl="true"]http://www.macromedia.com//swf/globalnav/globalnav_en_us.swf?fpReqMinor=79&quot;[/URL] type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer&quot;[/URL] quality=&quot;high&quot; scale=&quot;showall&quot; width=&quot;456&quot;></embed>
    </object>
</div>

See this page on Macromedia's site for more details:
Hope this helps!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top