Hello guys,

i'm in dire need of a javascript that i'm unable to write myself and couldn't find anywhere on the internet in form of a tutorial. unfortunately im also too short on time to learn javascript from scratch. neglecting javascript is surely a mistake i need to correct in the future, but right now my butt is on the line...


what i have:

  • i have got a flash .swf file that is embed with 100% width and 1200px height in a .html file
  • different amount (height) of content in the flashfile. so if you click on a link in the navigation, the ExternalInterface is handing over the new height to javascript.

it looks like this:

Actionscript 3 Code:
testbutton.addEventListener(MouseEvent.CLICK, sendToJS);
 
    function sendToJS(e : MouseEvent) : void
    {
        if(ExternalInterface.available)
        {
            ExternalInterface.call("fromAS", <font color="Red"><b>2000</b></font>);
        }
    }


what i need:

  • a javascript that catches the red marked integer from the actionscript above and replaces the height of the embed flash object in html
  • it may not reload the whole website, just somewhat extend or shrink the scrollable area
  • a default value, because flash can't be displayed if the height is a empty variable


to put it in other words:

HTML Code:
<object classid="clsid:xxx" width="100%" height="<font color="Red"><b>MyValueFromFlash</b></font>" id="MyFlash" align="left">
<param name="movie" value="MyFlash.swf" />
<param name="quality" value="best" />
......
...


while searching the internet for a solution, i read that someone at stackoverflow already programmed something like that. he didn't even post the code like it was the easiest thing to write... yet i sit here and my hair turns grey because of that.

i'd be very thankful for any help or advice


best regards