Posted By

heathbo on 01/23/13


Tagged


Versions (?)

Pass in an varying number of parameters.


 / Published in: ActionScript 3
 

This allows a varying amount of parameters to be passed into a function. Which is helpful if the amount of parameters passed in could change. The trace in this example returns test3.

  1. testfunction("test1","test2","test3","test4")
  2.  
  3.  
  4. function testfunction(...testValues)
  5. {
  6. var values:Array = new Array();
  7. values = testValues;
  8.  
  9. trace(testValues[2]);
  10. };

Report this snippet  

You need to login to post a comment.