TwelvestoneFlash

check value of input text


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
dave_boo
 
2008-07-21

never had this particular scenario come up before, so I'm at a loss as to how to proceed ...

if i was making a 'test' in flash - and the question was 'An octagon has how many sides?'

I would have an input text box and a button to 'submit' it. If the answer is correct, the swf would advance to Scene 2, and if incorrect to Scene 3. How hard is this to do inside Flash itself (without querying outside files)?

Any help appreciated.

persist
 
2008-07-21

in the submit button event you'd do a quick check.

if(answerField.text == 8 || answerField.text == "eight"){ timeline.gotoAndPlay("scene2"); }else{ timeline.gotoAndPlay("scene3"); }

dave_boo
 
2008-07-22

thanks persist - i like your solution better than what i came up with - little less code bloat

submit_btn.onRelease = function() { answer = answer_txt.text; if (answer == "8") { gotoAndStop("correct"); } else { gotoAndStop("wrong"); } }; var answer:String = ""; stop();

scudsucker
 
2008-07-22

...Scene 2, and if incorrect to Scene 3

I strongly advise you to use frame labels (all on one timeline), and NOT scenes.

Around 1/2 the questions in the Newbie forum at Flashkit relate to scenes; they cause far more confusion than they are worth.

JLM
 
2008-07-22

Concurs

baron ruhstoff
 
2008-07-22

Assuming the test has more than one question, Skinner's string util might prove useful.

dave_boo
 
2008-07-22

Originally posted by: scudsucker

I strongly advise you to use frame labels (all on one timeline), and NOT scenes.

no **** - i havent used scenes since flash 4, but sometimes you gotta pick your battles with the boss

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

check value of input text