開発環境 Apache Flex SDK 4.12.1
FlashDevelop 4.6.1
実行環境 Microsoft Windows 8.1 (64bit)
プロジェクトの種類 ActionScript 3/AS3 Project
プロジェクト名 test

Main.as
package 
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
 
	/**
	 * ...
	 * @author 
	 */
	public class Main extends Sprite 
	{
		private var circle:Shape = new Shape();
 
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			graphics.beginFill(0x404080);
			graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
			graphics.endFill();
 
			circle.graphics.lineStyle(3, 0xffff00);
			circle.graphics.drawCircle(0, 0, 100);
			circle.x = stage.stageWidth / 2;
			circle.y = stage.stageHeight / 2;
			addChild(circle);
 
			stage.addEventListener(MouseEvent.CLICK, clickHandler);
		}
 
		private function clickHandler(e:MouseEvent):void 
		{
			circle.x = e.localX;
			circle.y = e.localY;
		}
 
	}
 
}
 

test.html
<html>
<head>
<title>test</title>
</head>
 
<body>
<center>
 
<h1>test</h1>
<embed src="test/bin/test.swf" width="640" height="480"></embed>
 
</center>
</body>
</html>
 
最終更新:2014年05月09日 09:44