static class from constructor

by pleclech forked from SO object living (diff: 74)
♥0 | Line 23 | Modified 2011-09-06 23:01:11 | 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/iUkk
 */

// forked from pleclech's SO object living
package {
    import flash.events.Event;
    import flash.utils.setTimeout;
    import flash.utils.getQualifiedClassName;
    import com.bit101.components.TextArea
    
    public class FlashTest extends TextArea {
        public static var foo:String="bar"
        private static var bar:String="foo"
        public function FlashTest() {
            width=400
            height=400
            setTimeout(doTest, 500)                        
        }
        public function doTest():void {
            trace("static access to public var via prototype.constructor ==> " + prototype.constructor.foo)
            trace("static access to private var via prototype.constructor ==> " + prototype.constructor.bar)
            trace("name of the constructor => " + getQualifiedClassName(prototype.constructor))
        }
        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
   }
}

Forked