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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Flash movie height possible within HTML?

Status
Not open for further replies.

kaidomac

Technical User
Oct 23, 2004
24
0
0
US
I am working on a website where there will be a Flash navigation menu on the left side. However, the first page will not have that menu; instead, it will have another .swf file. Same width, different height. My question is this: is there any way to have the HTML automatically adjust the height of the Flash file to whatever the height actually is? This would save me some headache because (1) I could use the same code on all of the pages, and (2) if we ever updated the height of the navigation .swf file I wouldn't have to re-code 50+ pages by hand. Here's a code sample:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="width="130" height="450">
<param name="movie" value="shared/nav.swf" />
<param name="quality" value="high" />
<embed src="shared/nav.swf" quality="high"
pluginspage=" type="application/x-shockwave-flash"
width="130" height="450">
</embed>
</object>

This is going within a table cell, by the way. So, the .swf on the first page may be width="130" and height="200", which is different only in height from the navigational .swf file. We may add more links on the side in the future, too, and I don't want to have to go in and manually change all of those height="450" to height="500". However, Macromedia says that the height is a required attribute here:


I tried out it just for kicks and it shrinks the .swf file. Bummer. Are there any workarounds for this?
 
Ah, I just found one workaround: creating a class in my master CSS file that references both the height and width. This way I just need two classes, one for the main page .swf and one for the navigational .swf. Also, if I ever update the height in the future, I just have to update the master CSS class for that .swf file.

Just curious though, any other workarounds? A dynamic-resizing code chunk would be great :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top