In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: SO object living

Get Adobe Flash player
by pleclech 07 Sep 2011
    Embed
/**
 * Copyright pleclech ( http://wonderfl.net/user/pleclech )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/zpcb
 */

// forked from pleclech's SO object living
package {
    import flash.utils.describeType;
    import flash.events.Event;
    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 {
            var a:Value = new Value();
                a.str = "a";
            var b:Value = new Value();
                b.str = "b";
            const changeValue: Function = function( to: String ): void
            {
                trace( this );
                this.str = to;
            }

            changeValue.apply(a,["c"]);
            trace( a.str ); // "c"
            changeValue.call(a, "d");
            trace( a.str ); // "d"
            changeValue("e");
            trace( a.str ); //d

        }
        public function trace(...args):void {
            text=text+args.join(", ")+"\n"
        }
    }
}
class Value
{
    public var str:String;
}