ボールが横に移動するよー。

by koutan
♥0 | Line 35 | Modified 2009-08-23 19:41:07 | MIT License
play

ActionScript3 source code

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

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
        import flash.filters.DropShadowFilter;
[SWF(width=465,height=465)]
	public class WonderflASPrj extends Sprite
	{

		public var test:Sprite;
		public var txt :TextField;
		public function WonderflASPrj()
		{
			

			txt = new TextField();
			txt.x=40;
			txt.y=60;
			txt.textColor=0x00000;
		
			addChild(txt);
			
			
			
			test = new Sprite();
			test.graphics.beginFill(0xffddd,1);
			test.graphics.drawCircle(10,10,10);
			test.graphics.endFill();
                        test.filters = [new DropShadowFilter];
			addChild(test);
			
			test.addEventListener(MouseEvent.MOUSE_OVER,hallo);
			
		}
		
		public function hallo(e:Event):void{
			
			txt.text=test.x.toString()
			test.x += 20;
			
			if (test.x >400){
				test.x -=300;
			}
			
			
		}
		
		
		
		
		
	}
}