#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    houston
    Posts
    94
    Rep Power
    12

    Text box displays “level0”


    Looking for answer to problem. Cant’ find anything on this.

    When I make a “dynamic” or “ input” text field it initializes with “level0” displaying in the text field.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    12
    Rep Power
    0
    Have you got something entered in the "Var:" field on the properties bar when you've got the text box selected?

    (assuming your using Flash MX)
    Last edited by wa90; March 11th, 2003 at 01:31 PM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    houston
    Posts
    94
    Rep Power
    12
    Yes I am using MX and yes I have entered a name in the “var” field.

    I thought I had seen something on this before but I can’t seem to find it. Either that or I just imagined it. The boxes work, I place a button on the page and attach some code to have it perform some math functions on the values in the boxes and it works just fine and the Dynamic Text field displays the correct answer when you click the button. It’s just that both the Dynamic Text field and the Input Text field display “level0” when the page first opens. To enter a value in the Input Text field you have to backspace over the “level0” and then enter the value you wish to enter. I tried entering in a default message in the design stage but when I test the page it displays “level0” plus the message I entered at design time. I tried entering a null / empty string, still no luck.
  6. #4
  7. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    what do you have in the variable field? i find it odd that your text field would display "level0" instead of "_level0" in the first place... unless you have only the lowercase and numerals embedded of the character set (not includeing "_" basically). If you are not explicitly setting the value of your text field by saying:

    text_instance_name.text = "level0";

    or

    text_variable_name = "level0";

    then the only way that it could be assigning that value is if your variable name of your text field references the _root or _level0 timeline somehow, and you don't have the "_" included in your character embedding...

    As a work around, i'll make a function that will clear the contents out of each text box when the focus is set. For example, if your text field was called "myText_txt" as an instance name, i would say:

    myText_txt.onSetFocus = function(){
    this.text = "";
    }

    the only problem is that it would clear the text every time the focus is set... which means even if the value is not "level0" and they click off and back on the text field, it will reclear it. If you're positive that the value is "level0" you can just do a simple if statement in the function:

    myText_txt.onSetFocus = function(){
    if(this.text == "level0") this.text = "";
    }

    but i'm pretty sure it has to do with your varible naming...

    cheers,

    bret
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    houston
    Posts
    94
    Rep Power
    12
    Yeah I think it is referencing the time line for some reason. Nowhere is level0 entered as any kind of value. But that’s OK as soon as I read your post I realized it was simply a mater of declaring the value of the variable in the first frame then as soon as the user enters a new value it replaces the value that the variable is initialized with. Stupid me, I should have thought of that.

IMN logo majestic logo threadwatch logo seochat tools logo