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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Question

Status
Not open for further replies.

jammer1221

Programmer
Jul 30, 2003
352
US
Hey everyone,
I am having a problem with putting a function in flash. I've never actually had any flash training so I was just guessing it was sorta like javascript. Well heres my function
Code:
function send_text (var1,var2,var3) {
if (var1) {
	getURL(var1+"____________"+sample);
}else if (var1 && var2) {
		getURL(var1+"______"+var2+"______"+sample);
}else if (var1 && var2 && var3) {
		getURL(var1+"___"+var2+"_____"+var3+"____"+sample);
}else{
	getURL("NOTHIN");
}
Thanks in advance for the help
Matt
 
It is a lot like javascript, which means if you write the function like that you will be required to provide 3 variables or the function will return an error.

A switch statement might get you what you need... try this:

Code:
function send_text (myVar) {
	switch(myVar){
		case "1" :
			getURL("var1___________sample.htm");
			break;
		case "2" :
			getURL("var2___________sample.htm");
			break;
		case "3" :
			getURL("var3___________sample.htm");
			break;
		default:
			trace("That's no good");
	}
}

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top