Thanks everyone.
I couldn't get it to work in Flash, so I hid a form in my HTML wrapper, passed the user input data to it with a Javascript function and then sent it to the server through another Javascript call.
Probably could be cleaned up, but it works.
Thanks again.
-A

function flashTxt(txt1, txt2, txt3, txt4, txt5) {
        document.getElementById('txt1').value = txt1;
        document.getElementById('txt2').value = txt2;
        document.getElementById('txt3').value = txt3;
        document.getElementById('txt4').value = txt4;
        document.getElementById('txt5').value = txt5;
}
</script>
<script>
function submitform()
{
  document.myform.submit();
}
</script>




On Feb 21, 2008, at 1:37 AM, Muzak wrote:

What your database looks like and variable names in your Flash application, have (and shouldn't have) no impact on each other. Afterall, you'll be sending/loading data through some script/ webserver/remoting, so you can *massage* your data before sending it to Flash and vice versa.

So saying that you need to name variables:
   var f#1700253695;
   var f#31
is nonsense ;-)

var myReallyCoolFlashVariableForAnEmailAddress = "[EMAIL PROTECTED]";

Send that to your server side script, which then stores it in the database (or whatever).



----- Original Message ----- From: <[EMAIL PROTECTED]>
To: "Flash Coders List" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, February 21, 2008 10:14 AM
Subject: Re: [Flashcoders] variable with # sign


Thanks for getting back to me.
I'm targeting Flash Player 8.
Essentially, I am creating an HTML form in Flash, but I'm running
into trouble because the form refers to database field names with
symbols I can't place in a variable name and I need to pass the
variable name with the data.

The form in my FLA has input fields for First Name and Email address.
Each input field has a Var associated with it.
The First Name field's Var is "f:1700253695"
The Email field's Var is "f:31"

Then in Actionscript I have variables for the "hidden" fields that
would be used in an HTML version of the form (not sure if this is
necessary) and a submit button function to send the variable names
and their values to the sign-up form on the server.
var f#1700253695 = "TEXT:First%20Name";
var f#31 = "TEXT:Email%20Address";

submitBtn.onRelease = function(){
getURL("http://www.topica.com/f/p.html";, "","GET");
}

The problem I'm having is that the database on the server requires
either the colon or the # sign in the field name, but I can't figure
out how to publish the SWF with them.
If there isn't a way, I think I will use the ExternalInterface API to
send my field values to a form in my HTML wrapper and send the data
from there. I'm not well versed in Javascript so I'm trying to avoid
that if possible.

Any help would be greatly appreciated.

Thanks again.
-Alex


On Feb 21, 2008, at 12:50 AM, Martin Klasson wrote:

this[f#31] = "TEXT:Email%20Address";

This could work for you I guess, it wont give you a compiler error,
but I would revise the code since I wouldnt suggest this "ugly" solution.

If you could show more code on how you are sending the data,
as well as what Flash Player version you are targeting there would
easier to give you a more helpful hand if you want the solution to
be more legit than the solution above.

/ Martin


2008/2/21, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

Hi.
I need to pass a variable to a email sign-up form and it needs to be
named f#31

I have it written:

var f#31 = "TEXT:Email%20Address";

Flash gives me an error when I try to publish this and I assume its
because the variable name has the # sign. How do I get around this?
I've tried escape sequences to no avail.

Thanks!
-Alex
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




--

Martin Klasson
Flash Developer
Parkgatan 9-11
S-411 24 Göteborg
Sweden
Office +46 (0) 31 711 54 50
Cell +46 (0) 730 964 561
[EMAIL PROTECTED]
www.kokokaka.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to