views:

122

answers:

1

Is there a way to rewite (or hijack) an absolute URL request made from a flash (swf) file in a browser?

Eg

I have a flash application that is requesting http://example.com/myImage.png

The code in the flash application cannot be changed but I want to be able to either use another flash or some javascript to write that URL as the image is beging requested - to something like

example.com/myImage.png?u=123456

A: 

You could have a chance of doing it your are talking about an AS2 swf. The AVM1 is very permissive for that kind of dirty tricks, but AVM2 won't allow you.

So, assuming an AS2 SWF, you could write a wrapper swf that hijacks either MovieClipLoader or loadMovie or whatever the original swf is using (you might have to decompile it to know).

The hijacking bit would be rather straight forward, something like:

_global['MovieClipLoader'] = MyClass;

Once MyClass gets the calls, you add whatever you want and then make the actual call.

Having said that, I know the _global trick works for custom classes, but not sure it does for native classes like MovieClipLoader.

Sorry, that's the best I can come up with :/

Juan

Zárate