Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text boxes and entering values

Status
Not open for further replies.

Molenski

IS-IT--Management
Jan 24, 2002
288
DE
Hi there,

I am just messing about and creating a little quiz thing for a friend of mine.

I'm using some text boxes and asking the person to type yes or no in there and then clicking on a button which takes you to the next frame.

Thing I'd like to happen is that if my mate doesn't enter the word 'yes' or enters the word 'no' the movie can't go to the next frame.

I've got an idea that I need to assign a name in the 'Properties' box to each text box and then somehow or other if the value entered in that box doesn't match 'Yes' maybe a dialogue box needs to appear from somewhere.

Am I even close or am I talking complete nonsense? What would be even better would be a couple of check boxes with the correct one having to be checked before the movie can move to the next frame via a button.

Thanks for any help in advance.

Molenski

 
Yeah, name the box then just check for the response:

on (release) {
if (_root.text_box_name.text=="yes") {
gotoAndStop(10);
} else if (_root.text_box_name.text=="no") {
gotoAndStop(20);
} else {
gotoAndStop(30);
}
}
 
Thanks a lot for this, it worked really well. Got another question if that's OK!!

When answering wrong you are now taken to another frame and on that is a button that you click - the idea is that this takes you back to the original frame. Only trouble is I have used the 'previous' option with 'go to and play' hoping this would take me back to the frame I just came from - but as you probably know it just takes you to the previous frame. The only way round this I can think of is to create all different frames with different code behind each button. I'm sure this is the wrong way. Even better would be a timer on that frame that after a couple of seconds took you automatically to the frame you came from.

What do you think? I'm sure it's possible but I've looked on the web and can't really find anything.

Thanks again in advance.

Molenski
As my bessie bud Kev always says - "Get involved!!!"
 
not sure I understand....

If you just need a way to go back to a certain frame, then just put a gotoAndStop(FrameNumber); in the button you need...

am I not understanding?
 
Hi again,

What I meant was I only want to create 1 frame containing the 'You've typed in the wrong answer - click here to go back' but there are several questions on different frames so I can't use the same gotoAndStop(FrameNumber); as it will always take me back to the same frame but my mate may have come from a different frame. Does that make any sense?

For example if she answers a question on frame 2 wrong it will take her to a frame e.g.frame 10 that says 'you just got that wrong click here to go back' and behind the button it will take you back to frame 2. Then let's say she goes to frame 3 and gets it wrong it will take her to frame 10 again but when she clicks it will go back to frame 2 instead of where she came from, frame 3.

Maybe I am just losing it but I would of thought that there would be a sort of - go to where you just came from - thingy in there somewhere! Maybe I'm not even doing it the right way - seemed OK at the time!

Is that any clearer?

Thanks for your help.

Molenski
As my bessie bud Kev always says - "Get involved!!!"
 
ok that makes sense... what I have done in the past in similar situations is to have a separate mc in a layer above the content, have it stopped at a frame that has no content, then if they answer a question incorrectly- send that mc to a frame that says "Sorry...." or whatever and put a close button on it to send it back to its original frame... this way you have like an alert box...

otherwise I would stor the _currentframe in a variable at the frames that have questions the just use that to go back to the orginal frame....

make sense?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top