[thelist] Flash MX Action Script HELP NEEDED!

Diane Soini dianesoini at earthlink.net
Fri Nov 28 10:48:49 CST 2003


On Thursday, November 27, 2003, at 04:36 PM, 
thelist-request at lists.evolt.org wrote:

> I have a map of the United States. Each state is it's own button. I am
> trying to program it so that when a user clicks on a state, the
> abbreviation for that state is placed in a text field below the map. 
> So,
> if a user clicks on Georgia, California, and Colorado, then in a text
> field below the map, the user would see GA, CA, and CO.
>
> I am trying to use the LoadVariable in the action scripting, but I am
> having no luck.
>
> Could someone help me. It would be much appreciated!
>
> Thanks
> Shae Hawkins
> Web Connect
> www.web-connect.net

Are you using Flash 4, 5, MX? Is the map in Flash and the text box not? 
Or are both in Flash? I don't think load variable is the correct method 
to be using either way. If your text box and your map are both in 
Flash, then you could give each state button and your text box an 
instance name and use something more like this:

california_button.onRelease = function()
{
	setTextBoxValue("CA");
}

Or if you prefer to put your button actions on your buttons (or you 
aren't using MX):
on(release){
	setTextBoxValue("CA");
}

Also define a setTextBoxValue method in your main timeline.

function setTextBoxValue(val)
{
	mytextboxinstancename=val;
}


If you are trying to communicate between flash and HTML form fields 
then have a look at the fscommand. It's a bit complicated (to me) and I 
haven't a lot of experience using it, so maybe someone else would be 
better at explaining it, but basically you'll use that combined with 
javascript to communicate between the two.



More information about the thelist mailing list