Progression4 Amateur checkmate forked:9favorite:1lines:124license : MIT License modified : 2009-10-06 23:09:53 Embed Tweet package { import flash.display.*; import flash.events.*; import jp.progression.casts.*; import jp.progression.commands.*; import jp.progression.commands.lists.*; import jp.progression.commands.net.*; import jp.progression.config.*; import jp.progression.data.*; import jp.progression.events.*; import jp.progression.scenes.*; import jp.progression.*; [SWF( width=465, height=465, backgroundColor=0xFFFFFF, frameRate=30 )] public class Amateur extends Sprite { public var manager:Progression, self:Amateur; // Graphics public var face:MovieClip; public var hair:MovieClip; public var eyeBrowLeft:MovieClip, eyeBrowRight:MovieClip; public var eyeLeft:MovieClip, eyeRight:MovieClip; public var nose:MovieClip; public var mouth:MovieClip; private var _status:Array; // Do Something public function atReady():void { addChild( face ); addChild( mouth ); addChild( nose ); addChild( eyeLeft ); addChild( eyeRight ); addChild( eyeBrowLeft ); addChild( eyeBrowRight ); addChild( hair ); _status = []; for ( var i:int = 0, l:int = numChildren; i < l; i++ ) { var child:DisplayObject = getChildAt( i ); _status.push( { x:child.x, y:child.y, scaleX:child.scaleX, scaleY:child.scaleY, rotation:child.rotation } ); } stage.addEventListener( MouseEvent.CLICK, _click ); } private function _click( e:MouseEvent ):void { for ( var i:int = 0, l:int = numChildren; i < l; i++ ) { var child:DisplayObject = getChildAt( i ); var status:Object = _status[i]; child.x = status.x + ( Math.random() - 0.5 ) * 10; child.y = status.y + ( Math.random() - 0.5 ) * 10; child.scaleX = status.scaleX + ( Math.random() - 0.5 ) / 2; child.scaleY = status.scaleY + ( Math.random() - 0.5 ) / 2; child.rotation = status.rotation + ( Math.random() - 0.5 ) * 10; } } public function Amateur() { CheckmateBuilder.initialize( this ); } } } import flash.display.*; import flash.events.*; import flash.net.URLRequest; import flash.system.ApplicationDomain; import jp.progression.casts.*; import jp.progression.commands.*; import jp.progression.commands.lists.*; import jp.progression.commands.net.*; import jp.progression.config.*; import jp.progression.data.*; import jp.progression.events.*; import jp.progression.scenes.*; import jp.progression.*; class CheckmateBuilder extends EventDispatcher { public static var GRAPHICS_URL:String = "http://swf.wonderfl.net/static/assets/checkmate04/AmateurAssets.swf"; private static var _target:Amateur; private static var _manager:Progression; public static function initialize( target:Amateur ):void { if ( _target ) { return; } _target = target; _target.self = target; Progression.initialize( new BasicAppConfig() ); _manager = new Progression( "index", _target.stage ); _manager.root.addEventListener( SceneEvent.SCENE_LOAD, _sceneLoad ); _manager.root.addEventListener( SceneEvent.SCENE_INIT_COMPLETE, _sceneInitComplete ); _manager.goto( _manager.root.sceneId ); } private static function _sceneLoad( e:SceneEvent ):void { _manager.root.addCommand( new LoadSWF( new URLRequest( GRAPHICS_URL ) ), function():void { var loader:Loader = Loader( this.latestData ); var domain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain; _target.face = new ( domain.getDefinition( "Face" ) as Class ); _target.face.x = 234; _target.face.y = 242; _target.hair = new ( domain.getDefinition( "Hair" ) as Class ); _target.hair.x = 233; _target.hair.y = 194; _target.eyeBrowRight = new ( domain.getDefinition( "EyeBrowRight" ) as Class ); _target.eyeBrowRight.x = 190; _target.eyeBrowRight.y = 218; _target.eyeBrowLeft = new ( domain.getDefinition( "EyeBrowLeft" ) as Class ); _target.eyeBrowLeft.x = 270; _target.eyeBrowLeft.y = 218; _target.eyeRight = new ( domain.getDefinition( "EyeRight" ) as Class ); _target.eyeRight.x = 190; _target.eyeRight.y = 248; _target.eyeLeft = new ( domain.getDefinition( "EyeLeft" ) as Class ); _target.eyeLeft.x = 272; _target.eyeLeft.y = 243; _target.nose = new ( domain.getDefinition( "Nose" ) as Class ); _target.nose.x = 236; _target.nose.y = 275; _target.mouth = new ( domain.getDefinition( "Mouth" ) as Class ); _target.mouth.x = 242; _target.mouth.y = 322; } ); } private static function _sceneInitComplete( e:SceneEvent ):void { _target.atReady(); } } Code Fullscreen Preview Fullscreen Nyarineko MovieClip getChildAt numChildren addChild rotation child SceneEvent status Progression EventDispatcher scaleY scaleX MouseEvent.CLICK addEventListener Object MouseEvent push Math.random String Array sort new page view favorite forked pv256 forked from: Progression4 Amat.. hacker_f14s966o forked:0 favorite:0lines:120 (diff:5) pv1735 Digi:Nium Generator k3lab forked:0 favorite:22lines:208 (diff:176) tag: digital pv280 forked from: Progression4 Amat.. h1ro forked:1 favorite:0lines:124 (diff:1) pv2861 Super nium theacher!!!! yd_niku forked:0 favorite:20lines:210 (diff:133) tag: DisplacementMapFilter Progression4, animation effect クリックでスーパーサイヤじんに! チンカス pv1211 nium先生を作ろう!β版 forked from: Pro.. OKASUKE forked:1 favorite:1lines:833 (diff:954) tag: game pv484 forked from: Progression4 Amat.. sakusan393 forked:0 favorite:0lines:136 (diff:25) pv1021 niumClock buccchi forked:1 favorite:6lines:349 (diff:316) pv323 とりあえず、forkしとく。forked from: Pro.. mtok forked:0 favorite:0lines:154 (diff:46) 1 2NEXT