A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: THE most simple question ever...

  1. #1
    Flash RPG Analyst
    Join Date
    Dec 2001
    Location
    Lancaster, Ohio
    Posts
    72

    THE most simple question ever...

    Flashkit Members,

    Help me out here... ive been toying with this for an hour now...

    i have a game im working on, so when you hit NEW GAME it asks
    you to put a name in a text entry field called 'savename'.

    so im now trying to make it so if theres nothing in the box when you hit ok... itll say something like...

    "If you dont enter a save name, your game will not be saved. Is this ok?" with a yes or no button, yes SKIPPING the save feature... no just making it go back so you can enter a name.

    now i already have the message box ready and everything... but i cant get it to where if anything else is entered it just goes forward in the save process....

    am i making sense? i hope so.. heres the button code.

    ----------------------------------------

    on (release, keyPress "<Enter>") {
    if (savename == "") {
    message.gotoAndStop(2);
    stop();
    }
    if (savename == " ") {
    message.gotoAndStop(2);
    stop();
    }
    }

    ----------------------------------------

    So from here you can see how if NOTHING is entered or just a space..
    itll bring up my error message giving the warning...

    NOW how do i use ELSE? to make it bypass the error and just continue normally if there IS SOMETHING IN THE TEXT BOX... anything i try.. when the error comes up it plays the scene out as well...

    thanks for your time in looking


    and thanks again

    -Clint Remley-

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    code:

    on (release, keyPress "<Enter>") {
    if (savename == "" || savename == " "){
    message.gotoAndStop(2);
    //stop(); //What's this stop action for?
    } else {
    //Do something else...
    }
    }


  3. #3
    Flash RPG Analyst
    Join Date
    Dec 2001
    Location
    Lancaster, Ohio
    Posts
    72
    so very beautiful...

    thanks #1 for making it condenced using less lines...

    thanks #2 for curing my headache...

    i knew it had to be something so simple yet so far in the back
    of my mind...

    thanks so much oldnoobie!!

    -Clint Remley-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center