larsxe
07-01-2007, 11:33 AM
I have a Flash movie whose only task in life is to display a line of text that's passed to the movie as a flashVar. I want to resize the movie dynamically in the browser window so that it only takes up the minimum amount of space necessary to display the text.
I'm trying to accomplish this by setting the movie width and height in the browser to 100%, containing the movie in a DIV, and then calling a JavaScript function from ActionScript that resizes the DIV to whatever width and height the text that was passed to the movie happened to be.
I'm calling the JavaScript function from ActionScript by using:
getURL("javascript:myResizeFunc(" + textWidth + "," + textHeight + ")");
directly in the main timeline.
The problem is, if I have multiple instances of these movies in a page, the first movie's getURL is called fine, but the remaining movies getURL function calls do absolutely nothing. No errors, just... nothing.
So... are there any known issues with getURL under IE6? I have tried using fscommand instead, to no avail.
I am using SwfObject to load the movie, with Flash Player 9.
Are there other techniques available for achieving the desired result (resizing the movie in the browser based on content). For instance, could you tell the Stage to "take up whatever space you need to"?
I'm trying to accomplish this by setting the movie width and height in the browser to 100%, containing the movie in a DIV, and then calling a JavaScript function from ActionScript that resizes the DIV to whatever width and height the text that was passed to the movie happened to be.
I'm calling the JavaScript function from ActionScript by using:
getURL("javascript:myResizeFunc(" + textWidth + "," + textHeight + ")");
directly in the main timeline.
The problem is, if I have multiple instances of these movies in a page, the first movie's getURL is called fine, but the remaining movies getURL function calls do absolutely nothing. No errors, just... nothing.
So... are there any known issues with getURL under IE6? I have tried using fscommand instead, to no avail.
I am using SwfObject to load the movie, with Flash Player 9.
Are there other techniques available for achieving the desired result (resizing the movie in the browser based on content). For instance, could you tell the Stage to "take up whatever space you need to"?