views:

126

answers:

1

I've got a bunch (say, 1k) of data in Flex, and I want to get that data to an HTML page, where some JavaScript will slice-and-dice the data and generate a report.

What's the simplest way to get it there?

I've considered passing it as part of the url, for example:

navigateToUrl("report.html?data=" + serialized_report_data)

But, apart from being more than a little bit hacky, URLs aren't supposed to be "that long", so it could cause problems.

Alternately, I could use an HTTPService to post the data to a server, which would send a URL back to Flex, then Flex could navigateToUrl that URL, which would show the data. This would work, but it also seems more complex than it needs to be.

So, is there any better way?

+4  A: 

Read about the ExternalInterface. You can pass data back and forth between Javascript and Flash in the same browser.

Glenn
I'd thought about that, but the problem is that it's in the same browser window. I want the reports to open in a new window.Now, I guess I could use ExternalInterface to pass the data to JavaScript in the *same* window, then let that JavaScript do the messy business of opening up a new window… But that's starting to get pretty complex >_<
David Wolever
Use ExternalInterface to put the data in a form and the cause the form to POST itself to the report page.
Guss