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: flash on 2012-6-27

Get Adobe Flash player
by bkzen 27 Jun 2012
/**
 * Copyright bkzen ( http://wonderfl.net/user/bkzen )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/1Vg4
 */

// forked from whirlpower's flash on 2012-6-27
package
{
    import flash.display.Sprite;
    
    public class Main extends Sprite
    {
        public function Main()
        {
            Tracer.init( this );            
            
            var xml:XML = XML( 
                '<data>\n' +
                '<node huga="moga_001"/>\n' +  
                '<node huga="hoge_001"/>\n' +  
                '<node huga="hoge_002"/>\n' +  
                '<node huga="unk_001"/>\n' + 
                '</data>'
            );
            Tracer.add( xml );
            
            var xmlList:XMLList = xml.node.(/hoge.*/g.test(@huga));
            Tracer.add( xmlList );
        }
    }
}

// trace template -------------------------------------

    import flash.display.*;
    import flash.text.*;
    
    internal class Tracer
    {
        private static var text : String = "";
        private static var viewText : TextField = new TextField();
  
        public static function init( _container:DisplayObjectContainer ):void
        {
            viewText.defaultTextFormat = new TextFormat( "MS UI Gothic", 12, 0xDDDDDD );
            viewText.width  = 465-10;
            viewText.height = 465-10;
            viewText.selectable = false;
            viewText.text = "view trace";
            viewText.x = 5;
            viewText.y = 5;
            viewText.mouseWheelEnabled = true;
            
            var s:Shape = new Shape();
            s.graphics.clear();
            s.graphics.beginFill( 0x000000, 0.5 );
            s.graphics.drawRect(0, 0, 456, 456 );
            s.graphics.endFill();
            
            var c:Sprite = new Sprite();
            c.mouseChildren = false;
            c.mouseEnabled  = false;
            
            c.addChild( s );
            c.addChild( viewText );
            
            _container.addChild( c );
            
        }
        
        public static function add( t:String = "tracer" ):void
        {
            text += t + "\n";
            viewText.text = text;
            viewText.scrollV += 1;
        }
    }