Example Shows How to Use Variable Parameters In Flex
By admin | December 18, 2008
Developers who have used C/C++ must knew intelligent using variable parameters could help us save a lot of time. In fact we could also use variable parameters in ActionScript. Then following is an simple function shows how to use it:
- private function sum(... nums):Number {
- var total:Number = 0;
- for(var i:int = 0; i < nums.length;i++){
- total += nums[i];
- }
- return total;
- }
Topics:
Adobe-Flex |
No Comments »
|
Tags: ActionScript, Flex, variable parameter