SO each array

by pleclech forked from forked from: SO randomize venue (diff: 49)
♥0 | Line 27 | Modified 2013-04-25 17:37:49 | MIT License
play

ActionScript3 source code

/**
 * Copyright pleclech ( http://wonderfl.net/user/pleclech )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/mLhCM
 */

package {
    import flash.events.MouseEvent;
    import flash.utils.setTimeout;
    import com.bit101.components.TextArea;
    
    public class FlashTest extends TextArea {
        public function FlashTest() {
            width=400
            height=400
            setTimeout(doTest, 500)                        
        } 
        public function doTest():void {
            try {
                var ar:Array = ["hello", 1, "world", 2];
                ar.forEach(
                    function(elm:*, index:int, arr:Array):void{
                        trace("got elm : "+elm+" at index : "+index);
                    }
                );
            } catch (e:*) {
                trace(e);
            }
        }

        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
    }
}