views:

107

answers:

4

Is there any way to embed Flash completely in HTML, without reference to an external SWF file? I ask because I would like to send an HTML file as an email attachment that the recipient will open in a browser and fill out as a form. The last step is that they will copy the result to their clipboard, paste it into a new message, and email it back. I cannot reliably copy to the clipboard with JavaScript because of the security issues, but there are simple Flash apps to add that capability.

I know I could just display the response text (which will be Base64 encoded) to the recipient and have them copy/paste, but it would be nice to provide this small convenience to them.

Also, so you are aware, the text is often too large to include in an email using mailto.

Yes. This needs to be done via email. The users have slow, occasional satellite email access and no other data connection to the interwebs. To make things worse, I cannot make them install anything. It is a difficult situation.

+4  A: 

You could always send them a PDF instead, since PDFs support interactive forms. You'd need one copy of Acrobat (or a similar tool, there are alternatives out there) and your users need free copies of Acrobat Reader. Results can be sent back as a PDF or in XML form for processing. PDF form validation is pretty advanced and can include Javascript.

El Zorko
This will take a lot more time for me to get up and running, but it is a valuable suggestion.
PeterAllenWebb
+2  A: 

You could try encoding the SWF in a data: URL.

brianary
My thought exactly, althought I don't know if it will work with a swf. Here's another link http://ejohn.org/blog/embedding-and-encoding-in-javascript/
Justin Johnson
You could use a data: URL, and as far as I know that'd be the only way to do it, but data: URLs are not well supported across browsers, so look into that before you use it.
thomasrutter
Interesting. This is new to me. I'll definitely check it out even if I don't use it.
PeterAllenWebb
Actually, since IE8, data: URLs are almost universally supported. Obviously IE7 cannot use them, in IE8 they aren't directly navigable (only useful for embedding small images in HTML and CSS, e.g.), and no one should be supporting IE6 at all anymore anyway. But Mozilla Gecko, WebKit and Opera (Presto) have all fully supported data: URLs for a very long time. http://a.deveria.com/caniuse/#feat=datauri
brianary
A: 

Even if you did embed the .swf in the email as a MIME attachment or in a data url, there doesn't seem to be any way to tell the player to load the movie from that data url, e.g:

<object .....>
    <param name="movie" value="cid:TheEmbeddedSWFData" />

as you would with HTML emails with embedded images. As far as I can tell, the player expects to load the .swf using regular HTTP GET requests only. No "please send me the embedded data within email #632523462423 with CID of 'blahblahblah'".

What about compiling the .swf using Adobe Air or any of the .swf-to-.exe compilers?

That way you just attach the resulting executable, the client saves it to their machine, runs it, and the Flash application runs as a regular program, no browser required.

Marc B
A: 

You cannot include Flash in emails. 90% of email systems will mark it as spam or strip it out.

Give me a link to the file or use a PDF as El Zorko said.

Darryl Hein
The users don't have Internet connections so a link wouldn't work anyway.
Gabe
Then I'd say your only option is to have a email with something like first name: ... last name: ... etc
Darryl Hein