Flex SWF in a cfwindow
I had a thought the other day about a good use case for a Flex application within a cfwindow and went about trying to test the concept. In my initial testing I had some difficulty getting the SWF to load. I assumed it had something to do with the Active Content JavaScript files that Flex HTML wrappers use to include the SWF in the HTML template.
Long story short I decided to go back and RTFM where I found this caveat:
Adobe recommends that you include all custom JavaScript in external .js files and import them on the application's main page, and not write them inline in code that you get using the source attribute
The catch here is including external JS files in the main page, not the source of the window (which is what I had been trying to do).
So moving the external JS includes from the HTML wrapper to the main page seems to work flawlessly.
Here is a simple demo.
Here's the code:
<script src="AC_OETags.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript" src="history.js"></script>
<cfwindow name="test" source="helloworld.html" initShow="true">
</cfwindow>
Stay tuned to see why I wanted to do this :)
Thanks to Dan Vega for whipping up the quick Flex app for me!



Any idea how to get a pdf into a cfwindow?
index.cfm:
<cfajaximport tags="cfwindow">
<a href="##" onClick="ColdFusion.Window.create('theWindow', 'hasChart','chart.cfm')">Click here</a>
chart.cfm:
<cfchart>
<cfchartseries type="pie">
<cfchartdata value="25" item="things">
<cfchartdata value="25" item="stuff">
<cfchartdata value="50" item="shenanigans">
</cfchartseries>
</cfchart>
Any suggestions would be much appreciated.
As a workaround try using a JPG chart.
Or try putting the chart inside an <iframe> - that *might* work - but probably not...