Created
March 11, 2015 11:00
-
-
Save seaders/c246d4c01898cf3f94de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package | |
| { | |
| public class FunctionyTest | |
| { | |
| public function FunctionyTest() | |
| { | |
| functionAccepter(noArgs); | |
| // output: noArgs function called | |
| functionAccepter(someArgs, "asdf", 1234); | |
| // output: someArgs function called with asdf 1234 | |
| } | |
| private function noArgs():void | |
| { | |
| trace("noArgs function called"); | |
| } | |
| private function someArgs(s:String, n:int):void | |
| { | |
| trace("someArgs function called with " + s + " " + n); | |
| } | |
| private function functionAccepter(f:Function, ...args):void | |
| { | |
| f.apply(this, args); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment