Jump to content

Flash input boxes


music_lp90

Recommended Posts

Hi, I am trying to figure out how to get the value that is entered into a flash input box. Using the text tool, I created a text box and set it to Input text. I gave it an instance name of mc_length and a variable name of $length. How can I access the value now with my actionscript once a user clicks on my button named mc_draw?Here's the code where I need the input value:

mc_draw.onPress = function() : Void {	$dynamicName = "a" + $i;	$i++;	/*instanceName, layer, Xwidth, Yheight, Xplacement, Yplacement */  	newRect($dynamicName, $i, INPUT VALUE NEEDS TO GO HERE, 6, $placeObjX, $placeObjY);}

Thanks!

Link to comment
Share on other sites

Hi justsomeguy, thanks for the help. I can get the value now, but for some reason it comes out completly different if I get the value from the input box or if I hard code the value right into the function that needs the value from the input box.Here's the section of code:

mc_draw.onPress = function() : Void {	$dynamicName = "a" + $i;	$i++;	/*instanceName, layer, Xwidth, Yheight, Xplacement, Yplacement, allowDrag */  	newRect($dynamicName, $i, mc_length.text, 6, $placeWallX, $placeWallY, $wallColor, "yes");}

If in the function I hardcode a number like 10 in place of mc_length.text, the rectangle that is drawn is much shorter than if I enter 10 into the input box and use mc_length.text. Why might that be?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...