ゲージの描き方と動作のさせ方 (2)
四角のゲージを表示する代わりに、重なった丸が広がっていくように改造する。
// forked from Megumi221's forked from: #3 MouseRecord forked from: #2 Loop forked from: #1 LikeATimeLine WonderflBook Interactive2 // forked from Murai's #3 MouseRecord forked from: #2 Loop forked from: #1 LikeATimeLine WonderflBook Interactive2 // forked from Murai's #2 Loop forked from: #1 LikeATimeLine WonderflBook Interactive2 // forked from Murai's #1 LikeATimeLine WonderflBook Interactive2 package { import flash.display.Sprite; import flash.events.Event; [SWF(width="465",height="465",backgroundColor="0xFFFFFF",frameRate="30")] public class WonderflBook extends Sprite { private var _timeGage:Sprite; private var _timeGage2:Sprite; private var _frameCount:uint=0; private var _frameCountLimit:uint=150; public function WonderflBook(){ init(); } public function init():void{ _timeGage=new Sprite(); _timeGage.graphics.beginFill(0x55FF22,0.5); _timeGage.graphics.drawCircle(0,0,1); _timeGage.graphics.endFill(); _timeGage.x=stage.stageWidth*0.5; _timeGage.y=stage.stageHeight*0.5; _timeGage2=new Sprite(); _timeGage2.graphics.beginFill(0xCC66FF,0.5); _timeGage2.graphics.drawCircle(0,0,1); _timeGage2.graphics.endFill(); _timeGage2.x=stage.stageWidth*0.5; _timeGage2.y=stage.stageHeight*0.5; addChild(_timeGage); addChild(_timeGage2); start(); } private function render(e:Event):void{ if(_frameCount >= _frameCountLimit){ _frameCount=0; } _timeGage.width=(_frameCount/_frameCountLimit)*stage.stageHeight; _timeGage.height=(_frameCount/_frameCountLimit)*stage.stageWidth; _timeGage2.width=(_frameCount/_frameCountLimit)*stage.stageWidth*0.5; _timeGage2.height=(_frameCount/_frameCountLimit)*stage.stageHeight*0.5; _frameCount++; } public function start():void{addEventListener(Event.ENTER_FRAME,render);}; } }
動くのだが、プロパティ(?)_timeGage.widthや_timeGage.heightで何が指定できるのかが、いまいち分かっていない。