2009年08月07日 金曜日

Phase01(ActionScript 3.0による数学・物理学表現[入門編]から)

| 12:11 | Phase01(ActionScript 3.0による数学・物理学表現[入門編]から) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 を含むブックマーク はてなブックマーク - Phase01(ActionScript 3.0による数学・物理学表現[入門編]から) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 Phase01(ActionScript 3.0による数学・物理学表現[入門編]から) - ActionScript(AS3)やFlexを勉強しようと思ってはじめた日記 のブックマークコメント


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:comp="*" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">


	import flash.events.MouseEvent;
	import flash.events.TimerEvent;
	import flash.geom.Point;
	import flash.utils.Timer;
	import models.Circle;
	import mx.core.UIComponent;

	public class Phase01 extends UIComponent{
		public var obj:Array;
		public var timer:Timer;
		public var rollovered:Boolean;

		public function Phase01():void{
			obj = new Array();
			for(var i:Number=0; i<10; i++){
				obj.push(new Circle());

			for(var j:Number=0; j<obj.length; j++){
				obj[j].x = 100;
				obj[j].y = 100;
				//obj[j].addEventListener(MouseEvent.MOUSE_OVER, onOver);
				//obj[j].addEventListener(MouseEvent.MOUSE_OUT, onOverOut);

			var s:Circle = new Circle();
			s.x = 100;
			s.y = 100;
			s.addEventListener(MouseEvent.MOUSE_OVER, onOver);
			s.addEventListener(MouseEvent.MOUSE_OUT, onOverOut);

			timer = new Timer(33);
			timer.addEventListener(TimerEvent.TIMER, loop);

		public function onOver(event:MouseEvent):void{
			rollovered = true;

		public function onOverOut(event:MouseEvent):void{
			rollovered = false;

		public function loop(event:TimerEvent):void{
			for(var i:Number=0;i<obj.length;i++){
				var koko:Point = new Point();
					if(i == 0){
						koko.x = 100 + 80;
						koko.y = 100;
						koko.x = obj[i-1].x + 80;
						koko.y = obj[i-1].y;
					if(i == 0){
						koko.x = this.stage.stageWidth + 140;
						koko.y = this.stage.stageHeight/2  -140;
						koko.x = obj[i-1].x;
						koko.y = obj[i-1].y;
				obj[i].x += (koko.x - obj[i].x)/8;
				obj[i].y += (koko.y - obj[i].y)/8;


package models
	import flash.display.Sprite;

	public class Circle extends Sprite{
		public var s:Sprite = new Sprite();
		public function Circle():void {

		public function create():void {
			s.graphics.drawCircle(0, 0, 50);


AkoAko2013/03/15 16:48That's a cunning answer to a challeingng question

baksyfowxdmbaksyfowxdm2013/03/18 21:14yEYkaJ <a href="http://cfjmsbgzkzof.com/">cfjmsbgzkzof</a>

spgqntxtrspgqntxtr2013/03/19 07:14sT9F5e , [url=http://hkfdkmnqolzr.com/]hkfdkmnqolzr[/url], [link=http://tyhkflaefmtf.com/]tyhkflaefmtf[/link], http://cwwqkmocsjxu.com/

MarioMario2015/09/30 15:05YMMD with that anwrse! TX

LeticiaLeticia2015/10/09 07:33Always a good job right here. Keep rolling on <a href="http://yucqbuigpz.com">thghoru.</a>

KarimKarim2015/10/09 11:57Hi, Humming Bird. I just wanted to say thank you so much for tnkiag the time to tell others about what is going on and being a warrior for God. I am a Police Officer and I am able to drive around and patrol while listening.I know God will bless you for all your hard work. Thanks so much ! God Bless, Malinda http://llayxsfoac.com [url=http://njnzim.com]njnzim[/url] [link=http://wjqsxjvovzz.com]wjqsxjvovzz[/link]

MandeMande2015/10/10 06:39AFAIC <a href="http://xnfvqib.com">th'ats</a> the best answer so far!

AfricaAfrica2015/10/12 07:10Hi hummingbird its trobe65 i watend to know how i can send you some news articles and some pictures of the new muslim tempel being built beside us.. love you and all the news, and biblical insight that you do. I learn alot from it.Trobe65 http://iomkcvzd.com [url=http://oxpgfldmp.com]oxpgfldmp[/url] [link=http://kqnwdncbns.com]kqnwdncbns[/link]