Log in

View Full Version : Monitor Flash-initiated HTTP requests



postrational
02-23-2008, 05:10 PM
I have a webpage, on the webpage an emedded SWF file. The Flash animation makes requests to an external server to download additional data.

I can monitor what HTTP requests are being made using Firebug under Firefox, or using Safari's Activity monitor.

I would like to be able to pass this information into a JavaScript. Is that possible? Is it possible to access the information about what HTTP requests are being made by a Flash program in JavaScript? Are there other possibilites to do this programatically?

Michal

Medyman
02-25-2008, 02:40 PM
I would like to be able to pass this information into a JavaScript. Is that possible? Is it possible to access the information about what HTTP requests are being made by a Flash program in JavaScript? Are there other possibilites to do this programatically?

Michal

There could be a way. It depends on what kind of functionality you're trying to achieve. Can you expand on what the end benefit of passing this into a javascript function would have?

postrational
02-25-2008, 02:58 PM
Hey, thanks for replying.

First of all I would like to just get the URL of the requested file, so I can pass it to JavaScript.

I would also love to see the HTTP headers being sent, but that's secondary.

Medyman
02-25-2008, 11:31 PM
Hey Postrational...

Sorry if I got your hopes up. But it turns out that it is not possible. I had an initial theory but upon some further research, i came across this:

http://kb.adobe.com/selfservice/viewContent.do?externalId=b06f1712&sliceId=1

Now, that is dated 2005..but I doubt there has been much improvement.

There might be ways to do in AS 3.0 and/or Flex (look into the URLRequest and/or URLRequestHeader class). This is what made me think that it might bave been available in AS 2.0, but I guess I jumped the gun.

I'm assuming you're using AS 2.0. If I'm wrong, let me know and we might be able to experiment to figure something out. I've only used URLRequest class once and that was to append a HTTP Header, not really to retrieve it. So, I'm not too familiar about how to go about doing that but it should be possible.