2
votes

swfObject embed has the following signature,

swfobject.embedSWF(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn)

with width and heigth required attributes,

What can I do to signify dynamic height and width.

4

4 Answers

3
votes

after reading this answer and browsing some more on the net i came up with a solution to the problem.

I have a flex application with several rooms and each room has a different height.

what i did is set swfobject with the minimum height that I need for my application.

In the construct of my flex application i attached to the ResizeEvent and MoveEvent events of the components in my application, so whenever an object moves or resized I can easily calculate the new height of my application.

when I catch one of these events I call a resizeSwfObject javascript function and I pass it the new desired height.

that javascript function sets a new value on the .style.height attribute of the flash object container/element.

Kfir

1
votes

It's not possible for the browser to determine the size of the application and change the object's size automatically based on that.

1
votes

Create a container element, and set the width/height of the container to whatever you desire. Then embed the SWF with 100% width and 100% height inside your container.

See this StackOverflow question: Resize an SWF when loading it with SWFObject

0
votes

I am not entirely sure what you mean by dynamic height and width, but as far as I know, you need to specify width and height either in pixels or percent (of the surrounding element), and I don't know of any way to let the size of the swf decide, like you can do for example with an img tag, by leaving out width and height.