i wonder if someone can help me!

i have created a .swf file that i am using in dreamweaver, but on my Action Scripting, it only references the email and not the subject nor body.

this is my code on my button

button_mc.onPress = function() {
	getURL("mailto:me@company.com"+"?subject=Answer"+"&body=Yes");
};
button_mc.onRollOver = function() {
	this.gotoAndStop(2);
};
button_mc.onRollOut = function() {
	this.gotoAndStop(1);
};

your help will be much appreaciated

Dani AI

Generated

As noted, the mailto URI needs a single ? before the first query parameter and & between subsequent parameters (subject, body, etc.). The formal syntax is in RFC 6068. The common confusion is HTML encoding versus string contents inside Flash.

If the code is inside a Flash ActionScript string (AS2 or AS3), use a literal & in the string. Using the HTML entity & inside an ActionScript string will send the literal & to the mail client and the parameters won't parse. Conversely, when writing a plain HTML href="mailto:..." attribute you should escape ampersands as & in the HTML source. To avoid surprises, build and inspect the final string inside Flash before calling the URL call.

Example (AS2 pattern — encode spaces/special chars with escape()):

getURL("mailto:me@company.com?subject=" + escape("Answer") + "&body=" + escape("Yes"));

If using AS3, use encodeURIComponent and navigateToURL instead.

Troubleshooting checklist:

  • Trace or display the final mailto string to confirm it contains ?subject= and &body= (no & inside the SWF).
  • Test a plain HTML mailto: link in your page to ensure the system mail client handles subject/body as expected.
  • URL-encode spaces and newlines (%20, %0D%0A) or use the appropriate encode function.
  • Confirm a default mail client is configured on the machine (webmail handlers may behave differently).
  • If nothing opens, try different browsers and check Flash security/wmode settings or consider exposing the mailto link in HTML instead of through the SWF.

Following those points will fix the most common causes of subject/body being ignored.

Sorry, just after i posted this, i realized that the ? should be a &

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.