Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-27-2011, 08:11 AM   #1
stargazer1682
Member
 
Join Date: Apr 2011
Posts: 50
Question [AS2] Input Text Box to Dynamic output, no cursor, can't type

This is a loaded question, I'm sure, but what might cause a text box, set to input, to not allow you to type in it, when the program is exported? At the end of a game I'm working on (a pre-existing game my employer wants me to update, so all the script and everything else is already there) there's a display of the user's score and what not; and there's a box for them to type their name and click a button that puts all the stats in a form. For some reason when you run the game and try to click on the box to fill in the name, the mouse doesn't turn into the text tool when you mouse-over, it doesn't give you the cursor when you click on and you can't write anything in it.
Just to see if I was doing it wrong, I opened a blank project, created an input text box and it worked fine. I even went a step further, testing outputting it to a second dynamic text box on another frame; and it worked perfectly.

I've tried changing the box, replacing it, set the instance name and variable, putting it on a separate layer; I even went into my test project, copied the input text box and pasted it into the game, and still it wont let me input into it.
Does anyone have an idea what might be going on?
stargazer1682 is offline   Reply With Quote
Old 04-27-2011, 09:21 AM   #2
benjio21
Senior Member
 
Join Date: Jan 2011
Location: uk
Posts: 502
Send a message via Skype™ to benjio21
Default

Might help if you showed the code.

Also have you embedded the fonts???

Ben
__________________
as3 is like marmite ("you either hate it or love it");
benjio21 is offline   Reply With Quote
Old 04-27-2011, 04:47 PM   #3
stargazer1682
Member
 
Join Date: Apr 2011
Posts: 50
Default

yes, embedded fonts. (also, forgot to mention before, actionscript 2).
The script is straightforward:
ActionScript Code:
nameOutput=nameInput;
I made the variable of input text box nameInput, and the variale for the dynamic output text box, nameOutput (I made the instance names similar, adding Here to the end, to distinguish instance and variable; don't know if it makes a difference, but I would imagine it might. The input text box is set to input and the output is set to dynamic. I tried it this way after trying to use the text boxes and script already in place.
This is the script originally in place, I changed the variables when I tried the way above, so they wouldn't conflict (I left it in place to hand the result of the output, since nothing else correlates to an data input by the user).

This is the original script:
ActionScript Code:
// function saveRecord(record:String, field:String, now:Object, score:Object):Void {     var so:Object = Object(SharedObject.getLocal(record));     so.data.record = record;     so.data.field = field;     so.data.now = now;     so.data.score = score;     so.flush(); } // function loadRecord(record:String, score:Object):Object {     return Object(SharedObject.getLocal(record)).data.score; } function getnow(record:String, now:Object):Object {     return Object(SharedObject.getLocal(record)).data.now; } // // saveNowTime_txt.text = TestTime; saveFieldName_txt = "Driving Test"; saveDateValue = dateTextField; saveFieldValue = "Your driving IQ was "+intResultTest+"%"; saveFieldValue_var = "Your driving IQ is "+intResultTest+"%"; loadFieldValue_txt.text = loadRecord(saveRecordName_txt.text, saveFieldName_txt.text); loadFieldDate_txt.text = getnow(saveRecordName_txt.text, saveFieldName_txt.text); // // btnContinue.onRelease = function() {     saveRecord(saveRecordName_txt.text, saveFieldName_txt, saveDateValue, saveFieldValue);     Display.gotoAndStop("Reset");     gotoAndStop("startFrame"); }; if (saveRecordName_var == "" || saveRecordName_var == undefined) {     warningMsg2 = "Enter your name,\nno \"spaces\", please"; } else {     warningMsg2 = "Your score is saved..."; } //

I don't know why the line for the name output is
ActionScript Code:
saveFieldName_txt = "Driving Test";
as "Driving Test" wasn't the variable assigned to the name input box....
And since I tried the simplified way at the top in a new project and it worked, I don't know why it wont work; the mouse doesn't turn into a text tool when you mouse over, you don't get the cursor when you click on it (you can faintly see it as you click, but disappears when you release the mouse button) and you can't type in it. I even tried putting the new, simplified input box in a different layer, in there was something about that layer impeding the use of the text box.
stargazer1682 is offline   Reply With Quote
Old 04-28-2011, 03:46 AM   #4
stargazer1682
Member
 
Join Date: Apr 2011
Posts: 50
Question

post deleted

Last edited by stargazer1682; 04-29-2011 at 12:27 AM.
stargazer1682 is offline   Reply With Quote
Old 04-28-2011, 04:37 PM   #5
stargazer1682
Member
 
Join Date: Apr 2011
Posts: 50
Default

post deleted

Last edited by stargazer1682; 04-29-2011 at 12:29 AM.
stargazer1682 is offline   Reply With Quote
Old 04-29-2011, 08:22 AM   #6
stargazer1682
Member
 
Join Date: Apr 2011
Posts: 50
Default

Well, I know what the problem is, I even managed to fix it and get the box to work properly....but I didn't save the work. I was tinkering with an (only slightly) previous version of the work, seeing what would did what; and it worked, and I was happy, and I was going to go into the more current version and make the change; and thinking it was just thing that had to be changed, I closed to the older version and opted not to save....I was wrong, and I'm idiot......

The problem is, the input box and the output dynamic box share the same instance name, as well as the same variable. Now, one would think that finding the right names in the actionscript and applying them to the proper box would be it...apparently not. Apparently not only did the original programmer mix-up naming them, while they kept the names they intended to give them in mind for some of the script, some of it apparently has to change to reflect the new name, which is the part that I apparently change, and now have no idea what those changes were...

This is the script:
ActionScript Code:
// function saveRecord(record:String, field:String, now:Object, score:Object):Void {     var so:Object = Object(SharedObject.getLocal(record));     so.data.record = record;     so.data.field = field;     so.data.now = now;     so.data.score = score;     so.flush(); } // function loadRecord(record:String, score:Object):Object {     return Object(SharedObject.getLocal(record)).data.score; } function getnow(record:String, now:Object):Object {     return Object(SharedObject.getLocal(record)).data.now; } // // saveNowTime_txt.text = TestTime; saveFieldName_txt = "Driving Test"; saveDateValue = dateTextField; saveFieldValue = "Your driving IQ was "+intResultTest+"%"; saveFieldValue_var = "Your driving IQ is "+intResultTest+"%"; loadFieldValue_txt.text = loadRecord(saveRecordName_txt.text, saveFieldName_txt.text); loadFieldDate_txt.text = getnow(saveRecordName_txt.text, saveFieldName_txt.text); // // btnContinue.onRelease = function() {     saveRecord(saveRecordName_txt.text, saveFieldName_txt, saveDateValue, saveFieldValue);     Display.gotoAndStop("Reset");     gotoAndStop("startFrame"); }; if (saveRecordName_var == "" || saveRecordName_var == undefined) {     warningMsg2 = "Enter your name,\nno \"spaces\", please"; } else {     warningMsg2 = "Your score is saved..."; } //

The instance name for both the input and output boxes is presently set to saveRecordName_txt
The variable is set to saveRecordName_var

From looking at the code, one of the boxes is supposed to use saveFieldName_txt for either the variable or instance name. Based on the naming convention for the other set of names, I would assumes it's meant to be the instance name (although when I had it working, I swear I put in the variable). What I do know is, the way I had it working, applied the changes to the input box, mean saveRecordName(_txt or _var) should be the right names for the output box.
Now, what I don't see if the saveFieldName counterpart for the variable; all I see is SaveRecordName_var, leaving me to conclude that somewhere in there, at least one case of SaveRecordName_var should be something else - whatever the variable for the input box is. It shouldn't matter what it is, so long as it's the same in the box properties and the script.

So can someone help me figure out which of these things is not like the other? I don't know how I happened to change the just the right thing by pure chance, and now can't repeat it again. Which parts refer to the input text box variable or instance, and which refer to the output? Knowing that, I can't distinguish the two, and hopefully make it work...again....
stargazer1682 is offline   Reply With Quote
Reply


Thread Tools
Display Modes 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. The time now is 10:49 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.