The McLeodGaming forums were permanently closed on April 30th, 2020. You are currently viewing a read-only archive.
View unanswered posts | View active topics It is currently Fri May 15, 2020 1:58 am

Forum rules


IMPORTANT

This Forum is for Flash related questions ONLY! Do not ask questions about spriting, Game Maker, Photoshop, or anything else not related to Flash.



 [ 7 posts ] 
[Question] Using input text fields to define variables. 
Author Message

Joined: Sat Jun 04, 2011 9:12 am
Posts: 2
Gender: Male
Well, I've ben trying to make it so that when someone enters a number into an input textbox, the number becomes a ball's speed. I've been searching for the past couple hours, and the closest thing I could find was how to make another textbox say the same as the input textbox. Here's the code for that:

Code:
myTextBox1.addEventListener(TextEvent.TEXT_INPUT,textInputHandler);

function textInputHandler(event:TextEvent):void{
        myTextBox2.text=event.text;
}


I changed the code a bit to closer suite the needs of the presentation, but it sill won't work.

Code:
BallVelocityText.addEventListener(TextEvent.TEXT_INPUT,textInputHandler);

function textInputHandler(event:TextEvent):void{
   ballSpeed=event.text;
}


Any help would be greatly appreciated.
By the way, I'm using CS5.5 AS3


Tue Sep 27, 2011 11:26 pm
User avatar

Joined: Fri Jan 02, 2009 6:02 pm
Posts: 7283
Location: Australia
Country: Australia (au)
Gender: Male
MGN Username: Tid
Currently Playing: Deep™ The™ Game™
I can't remember what the exact function for it is, but you can convert strings into integers (numbers) with a certain function. Don't bother trying this exact phrasing because I know it's wrong, but it's something along the lines of variable.toNumber = variable2

_________________
ImageImageImageImage
Ask me anything!!!
Special thanks to Steven for my beautiful Deep avatar! <3


Wed Sep 28, 2011 2:23 am
WWW

Joined: Sat Jun 04, 2011 9:12 am
Posts: 2
Gender: Male
Tid wrote:
I can't remember what the exact function for it is, but you can convert strings into integers (numbers) with a certain function. Don't bother trying this exact phrasing because I know it's wrong, but it's something along the lines of variable.toNumber = variable2


Thanks, I'll try to find it. I was thinking it was something along the lines of that. (For some reason I didn't think it would be a function, I guess my head doesn't work to well that late when it comes to Flash)


Wed Sep 28, 2011 6:26 pm

Joined: Thu Nov 17, 2011 3:16 am
Posts: 1
Location: Chicago,Illinois,USA
Gender: Anime Girl
Thanks a lot i was searching for this for very long time, actually i recently join this forum and i hope got lot of such useful information in future.

_________________
Online Diploma


Thu Nov 17, 2011 3:25 am
WWW
User avatar

Joined: Sun Sep 28, 2008 1:38 am
Posts: 2286
Location: The Wonderful Land of Aus
Gender: Anime Girl
No you weren't you filthy piece of metallic s***

_________________
Image
Parents - Ray fletcher, Blue Mage(?)
Married to - Deux
Children - Geno


Thu Nov 17, 2011 3:26 am
WWW
User avatar

Joined: Fri Jan 02, 2009 6:02 pm
Posts: 7283
Location: Australia
Country: Australia (au)
Gender: Male
MGN Username: Tid
Currently Playing: Deep™ The™ Game™
oh snap

_________________
ImageImageImageImage
Ask me anything!!!
Special thanks to Steven for my beautiful Deep avatar! <3


Thu Nov 17, 2011 6:07 am
WWW
User avatar

Joined: Sun Sep 28, 2008 1:38 am
Posts: 2286
Location: The Wonderful Land of Aus
Gender: Anime Girl
Slow night for mods, it's been a few hours and this topic still isn't locked

_________________
Image
Parents - Ray fletcher, Blue Mage(?)
Married to - Deux
Children - Geno


Thu Nov 17, 2011 6:17 am
WWW
Display posts from previous:  Sort by  
 [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.