Ted Patrick’s FXWidget
Official Flex/AIR evangelist, Ted Patrick, has put together a simplified generated template project for Flex components (called FXWidget) in an attempt to make it easier to use flex as page-components rather than full applications. It includes the SWFObject library from Geoff Stearns and reduces the line count in the out-of-the-box index.template.html file from 108 to a mere 26. It’s far from complete, but a definite step in the right direction.
I’ve put together an extension of this library to add some more functionality and to restore the browser-history feature of flex that is included in the original template file. In my extensions, I’ve side-stepped the IE7 issues people were having in relation to loading the SWF in a script tag by loading it by preloading it through prototype.js’s Ajax.Request method and used an onComplete closure to trigger the loading of the SWF object. I have yet to add deep-linking back to the template (Flex3).
This marks my first contribution back to the Flex community, to which I hope to contribute as much as I can. My updates this site have been… well there just hasn’t been any for a while. I’ve been “heads-down” programming at my new job since December, up to my eyeballs in Flex and FDS. Things are settling down now, so I hope to have more time to share what I’ve learned.
Click here to download the Flex2 project.
Click here to see the output examples.
Good work, Ted!
He’s not self-proclaimed, he’s officially an evangelist at Adobe.
Noted and corrected. Thanks.
Im having some issues using this with a flex project using yahoo maps as3 kit. Works in safari and internet explorer but not firefox? Any ideas on what could be going on? Also have you made any updates or improvements to this since the last post?
Thanks,
Thanks Beau and Ted!
Here’s a small demo I did with it. Instead of a fixed-size widget, I’ve used a 100%-by-100% widget in a div container which can then be resized to match the widget as it stretches with new content. It’s done with an ExternalInterface call from the flex app to a JavaScript function which then resizes the div container.
http://www.elisanet.fi/jjsoini/flexwidget/