Read Beau's blog post first.
This is a simple demo of using Beau's/Ted Patrick's flex widget and AS3 ExternalInterface class to resize the widget's html wrapper (div). Check the page source for the very simple JavaScript resize function. Then check out flex widget's ExternalInterface call below. As you can see, instead of a fixed-size SWF, the widget is 100% by 100%, thus filling it's html container. Now, it's only a question of resizing the html div-container using JavaScript to match the size of the flex application each time it's content changes.
As you can see, it's totally possible to use, for example, flex repeaters on an HTML page.
- Jussi - contact me: jussi.soini(at)elisanet.fi
You'll need to wait a while for the widget to load (there's no progress indicator, just be patient). When it has loaded, CLICK THE BUTTON at the bottom of the panel and see how the html layout changes to match the resized widget.
Here's the code for the flex app. This goes inside the mx:script block.
public function resizeWrapper(w:int, h:int):void {
var s:String;
if (ExternalInterface.available) {
var wrapperFunction:String = "resizeFlexContainer";
s = ExternalInterface.call(wrapperFunction, w, h);
}
else {
s = "Wrapper not available";
}
trace(s);
}
Demo adaptation of Beau Scott's flex widget which in turn is an adaptation of Ted Patrick's FXWidget.
[ history.htm ]
You are viewing a mobilized version of this site...
View original page here