Link to home
Start Free TrialLog in
Avatar of blue-genie
blue-genieFlag for South Africa

asked on

does AS3 have a variable amount of parameters option?

assume i want to create a function that will call different methods in the webservice and pass the required parameters for that method. how would I do this?
 
public function callWSDL(action:String, ....):void
		{
			switch (action)
			{
				case "login":
					WSDLAction  = "login";
					op.something(); 
					break
				case "register":
					WSDLAction  = "register";
					op.somethingelse(); 
					break;
			}
		}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cyan specified what you needed.  
Uuups ... sorry ... didn't see that. Must have bin a simoultaneous post.
It would be nice if EE would modify the posting for on screen updates as well as the question list..
But nevertheless my second post offers a second option that also answers the question asked.
Avatar of blue-genie

ASKER

you guys rock!!!
posting another question now. ... go check it out.

(Genie wishes she paid attention to OOP 101);
A funcky one with this syntax is that the optional arguments need to be positioned at the last...
   function optionalParameters(a:Number=null, b:String="default") { }

So, you cannot do this...
   function optionalParameters(a:Number=null, b:String="default", c:String) { }

OOP...  Who cares about that???  The only thing that comes out of my mouth is oops all the time when I try to use OOP...  :p

CyanBlue
no cb i've been having a fab day with other peoples classes.
why is this protected? why is that static, no i need that, let me in .......