I recently found out about coreyoneil collision detection kit for flash as3 and I'm trying to figure out his codes so I can adjust them for my project.
I have some difficulty understanding what the ... means in the CollisionList function of the class. Could anyone tell me what it means?
Here is the class: https://github.com/tamagokun/Flash-libs/blob/master/com/coreyoneil/collision/CollisionList.as
I haven't done much flash, but I have seen this in other languages like Lua and Java. Googling it can't find me any verification on it though, so I'm kind having faith in my knowledge of other languages.
But, in other languages that use it, the ... must always be the last variable passed to the function. You can append as many parameters to the end of it as possible. Then then name of it (... objs) in your case is an array to access these objects.
Example in a nutshell:
public void printList(... objs)
{
for (int i = 0; i < objs.length; i++)
{
printLine(objs[i])
}
}
Then if you were to call the following:
printList("Thing 1", "Thing 2", "Thing 3");
You would get this output:
Thing 1
Thing 2
Thing 3
EDIT: I finally found a page with a tutorial about it. Scroll to the bottom. http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7f56.html