Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-22-2009, 07:22 PM   PM User | #1
Divinem7
New to the CF scene

 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Divinem7 is an unknown quantity at this point
Embed Form ID into Flash

I'm a web designer for a large nonprofit and I'm currently trying to test an email submission form we want to embed in a Flash Advertisement. Basically we will be placing our Flash ad on a large website and I just wanted to make sure a quick email signup was possible. I've used the guildelines outlined from tutorials like this one but have run into the problem that our Form Data Processor page (http://www2.aspca.org/site/Survey) needs a Form Id to be specified so it knows which survey to post the results to. In HTML, the form looks like this.

<form name="survey_11460" id="survey_11460" method="POST" action="http://www2.aspca.org/site/Survey" >

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top">


<td width="5%" class="req" align="right" nowrap="nowrap">
&nbsp;
</td>

<td>
<span class="Explicit">Your Info:</span><br />



<table border="0" cellspacing="4" cellpadding="0">

<tr style="position:absolute;left:-9999px">
<td colspan="3">
<input type="hidden" name="cons_info_component" id="cons_info_component" value="t" />
</td>
</tr>
<tr>
<td width="1%">

<p>*</p>

</td>
<td nowrap="nowrap">
<p><label for="cons_email">Email: <span style="position:absolute;left:-9999px">Required</span></label></p>

</td>
<td>
<input type="text" name="cons_email" id="cons_email" value=""
size="32"
maxlength="255" />
</td>
</tr>
<tr>
<td width="1%">
<p>&nbsp;</p>
</td>
<td colspan="2">
<input type="hidden" name="cons_mail_opt_in" id="cons_mail_opt_in" value="t" />
<input type="checkbox" name="cons_email_opt_in" id="cons_email_opt_in" checked="checked" />

<label for="cons_email_opt_in" class="wrapable">
<span class="Explicit">Yes, I would like to receive updates about important animal cruelty and pet care news.</span></label>
<input type="hidden" id="cons_email_opt_in_requested" name="cons_email_opt_in_requested" value="true" />
</td>
</tr>
<tr>
<td width="1%">
<p>&nbsp;</p>
</td>
<td colspan="2">
<input type="checkbox" name="s_rememberMe" id="s_rememberMe" checked="checked" />

<label for="s_rememberMe" class="wrapable">
<span class="Explicit">Remember me. <script> document.write('<a class="Smaller" title="View Privacy Policy (opens new window)" href="'); document.write("javascript:MM_openBrWindow('http://www2.aspca.org/site/PageServer?pagename=whatsthis&printer_friendly=1','Description','toolbar=no,scrollbars=yes,resizable =yes,alwaysRaised=yes,dependent=yes,width=700,height=500')"); document.write('">What\'s this?</a>'); </script> <noscript> <a class="Smaller" href="http://www2.aspca.org/site/PageServer?pagename=whatsthis&printer_friendly=1" title="View Privacy Policy (opens new window)" target="_blank" >What's this?</a> </noscript> </span>
</label>

<a class="Smaller" title="View Privacy Policy (opens new window)"
onclick="javascript:MM_openBrWindow('http://www2.aspca.org/site/PageServer?pagename=privacypolicy&printer_friendly=1','Description','toolbar=no,scrollbars=yes,resiz able=yes,alwaysRaised=yes,dependent=yes,width=700,height=500'); return false;"
href="http://www2.aspca.org/site/PageServer?pagename=privacypolicy&printer_friendly=1" title="View Privacy Policy (opens new window)" target="_blank" > </a>

</td>
</tr>

</table>
<br />
</td>

</tr>

<tr>
<td colspan="3" align="center">
<input type="submit" name="ACTION_SUBMIT_SURVEY_RESPONSE" id="ACTION_SUBMIT_SURVEY_RESPONSE" value="Submit" class="Button" />
</td>

</tr>
</table>
<input type="hidden" name="SURVEY_ID" id="SURVEY_ID" value="11460" />
<input type="hidden" name="USER_HAS_TAKEN" id="USER_HAS_TAKEN" value="null" />
<input type="hidden" name="SURVEY_IGNORE_ERRORS" id="SURVEY_IGNORE_ERRORS" value="TRUE" />
<input type="hidden" name="QUESTION_STAG_APP_ID" id="QUESTION_STAG_APP_ID" value="" />
<input type="hidden" name="QUESTION_STAG_APP_REF_ID" id="QUESTION_STAG_APP_REF_ID" value="" />
<input type="hidden" name="QUESTION_STAG_CTX_TYPE" id="QUESTION_STAG_CTX_TYPE" value="" />

<input type="hidden" name="ERRORURL" id="ERRORURL" value="http://www2.aspca.org/site/PageServer?pagename=test_testy_test" />

<span style="display:none">
<table border="0"><tr><td>
<label for="denySubmit">Spam Control Text:</label>&nbsp;
<input type="text" name="denySubmit" id="denySubmit" value=""
alt="This field is used to prevent form submission by scripts." />&nbsp;Please leave this field empty
</td></tr></table>
</span>
</form>

I'm new to Flash and am justing bumping my head into a wall looking at all the available online tutorials to even see if this is possible.

Any help would be appreciated.
Divinem7 is offline   Reply With Quote
Old 07-23-2009, 09:33 AM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
If you need the ID from the form tag itself, then no. However if you need the values of the hidden input fields, that is possible.

You will use the LoadVars.send method

http://livedocs.adobe.com/flash/9.0/...=00001789.html

Quick example that you can build from

Code:
var my_lv:LoadVars = new LoadVars();
// Set variables for form
my_lv.SURVEY_ID = "11460";
my_lv.SURVEY_IGNORE_ERRORS = "true";
my_lv.QUESTION_STAG_APP_ID = "";
my_lv.QUESTION_STAG_APP_REF_ID = "";
my_lv.QUESTION_STAG_CTX_TYPE = "";
// Set variables from entry blanks
my_lv.SURVEY_IGNORE_ERRORS = emailAddress.text;
my_lv.send("setscore.cfm", "_blank", "POST");
__________________
jeremy - gnomeontherun
Educated questions often get educated answers, and simple questions often get simple answers.
gnomeontherun is offline   Reply With Quote
Reply

Bookmarks

Tags
code, flash

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:32 PM.


Advertisement
Log in to turn off these ads.