tags:

views:

623

answers:

2

Hello. I'm trying to embed an external .swf file from an HTA application that consists of HTML content, javascript and vbscript. I load the swf from javascript, using swfobject.

The remote server allows 'localhost' as the originating server, and I could embed it on an HTML page on my webserver, running on http://localhost, but I need to make it work from the locally-run HTA, which I suppose uses the file:// protocol, not http://. Right now, when trying this approach, embedded swf signals an error.

I checked crossdomain.xml on the remote site and it says:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
    SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"&gt;
<cross-domain-policy>
<allow-access-from domain="localhost" to-ports="*" />
...
</cross-domain-policy>

Is there a way to make it work from my HTA app without running a webserver?

Thanks.

A: 

i'm not sure about HTA files but i know you can directly embed external .swf files into your webpage via something like

<EMBED type="shockwave-flash" src="http://path/to/file.swf" height="swf_height" width="swf_height" (other tags neccesary> </EMBED>
RCIX
A: 

No need to use file:// protocol, which I believe is simply not supported by ShockwaveFlash. Just use the name of the .SWF file and it will be loaded from the same directory as the HTA file. Or use the full path like C:\something\flash\applet.swf

The crossdomain stuff is irrelevant because you are running it all on one machine.

And the .HTA security model is much more open than the web security model, because it only works on a single machine, just like a .EXE or any other Windows application.

Michael Dillon