|
-
Optional Parameters
Hi all,
I've got a simple question:
is it possible in 3DFA to give your functions optional parameters?
Code:
// c shall be the optional parameter
function myFunction(a,b,c) {
trace (a,b);
trace (a,b,c);
}
myFunction(1,2,3); // everthing is ok...
myFunction(1,2); // 3DFA shows an error
Error:
function myFunction(a,b,c) was given 2 parameters when 3 were expected on line 9 myFunction(1,2)
Anyone knows how to solve this?
Thanks,
leifi
-
Senior Member
Last edited by kusco; 08-06-2007 at 10:35 AM.
Cheers,
kusco
(3DFA Support Team)
-
-
Senior Member
The next release of 3DFA, due later this week, allows the use of optional parameters for functions - for both Flash 8 and 9 export.
You can define a function ...
function my_function (a, b=42, c="hello", d=true)
{
}
... and you can specify between one and four parameters when calling the function.
Cheers,
kusco
(3DFA Support Team)
-
Cool! Thank you for this fast response!
Maybe I have some more ideas for 3DFA...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|