all groups > flash actionscript > october 2006 >
You're in the

flash actionscript

group:

simple form if/else for gotoframeandplay


simple form if/else for gotoframeandplay psm9640
10/7/2006 2:42:13 PM
flash actionscript:
Hey Guys,

I have a form in a swf with a button and an if/else statement in the button
action to determine which frame to go to if certain conditions are met. The
second "else if" clause is working but the initial "if" seems to be bypassed
any time I try to test it (and it's testing for a blank value). What happens is
the action goes right to the final "else" condition and launches the form. What
am I doing wrong?

The form is setup with an input text box with variable name "zip".

Here's the button action:

on (release) {

if (zip eq "") {

gotoAndPlay(15);

} else if (zip.length < 5 && zip.length > 1) {

gotoAndPlay(5);

} else {

getURL ("theform.php", "_blank", "POST");
}
}

-Peter
Re: simple form if/else for gotoframeandplay kglad
10/7/2006 3:59:50 PM
that's not testing for a blank value. to test for one blank or space you
should use:



if (zip eq " ") { // you should use the double equal (==) instead of eq

// and if you want to test if zip is undefined you should use:

if(zip==undefined){
Re: simple form if/else for gotoframeandplay psm9640
10/8/2006 3:09:07 PM
Re: simple form if/else for gotoframeandplay kglad
10/8/2006 3:16:22 PM
AddThis Social Bookmark Button