252 ActionScript: Create a Form with Conditional Logic and Send Data
11.
Type
gotoAndStop("confirm")
Press Enter or Return, and type
again and type
};
// Stops the playhead at Frame 1.
stop();
// Adds conditional logic for the Submit button that
// validates user input.
this.submit_btn.onRelease = function(){
if (url_txt.text == null || url_txt.text ==""){
gotoAndStop("error");
} else {
gotoAndStop("confirm")
}
};
Pass data out of a SWF file
You can send data from a Flash application in various ways—for example,
in this lesson you send data to a web server to load a web page in the
browser. After the
else
Flash go to the URL the viewer enters in the input text field.
1.
In the Script pane, place the insertion point in front of the line that
reads
gotoAndStop("confirm")
2.
In the Actions toolbox, select Global Functions > Browser/Network and
double-click
getURL
3.
With the insertion point between the
"http://"+url_txt.text
SWF file.
(Do not leave spaces in the code.) Your script should look like the
following:
stop();
this.submit_btn.onRelease = function(){
if (url_txt.text == null || url_txt.text ==""){
gotoAndStop("Error");
} else {
getUrl ("http://"+url_txt.text);
gotoAndStop("Confirm")
}
};
in the Script pane.
and then press Enter or Return
},
. Your script should appear as follows:
statement, you'll add the ActionScript to have
.
.
getURL()
to specify the data that should pass from the
parentheses, type
Need help?
Do you have a question about the FLASH 8-FLASH and is the answer not in the manual?