ちょびっとFlash10の機能を使ってみました。
ちょびっとFlash10の機能を使ってみました(^−^)
こんな感じ
http://moeten.info/flex/20081016_fp10Test/bin-release/main.html
RotationZが気持ちいね。
ソースはこちら
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" width="800" height="800" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import caurina.transitions.Tweener; private function init():void{ hts.send(); setText(); } private function setText():void{ for( var i:int = 0 ; i < myText.text.length ; i ++ ){ var text:Text = new Text(); text.setStyle("fontSize" , 30); text.text = myText.text.charAt(i); text.x = Math.random() * this.width; text.y = Math.random() * this.height; text.z = Math.random() * this.width; text.rotationX = Math.random() * 360; text.rotationY = Math.random() * 360; text.rotationZ = Math.random() * 360; myCanvas.addChild( text ); Tweener.addTween( text , { x:i*32, y:this.height/2, z:i*10, rotationX:0, rotationY:0, rotationZ:0, time:3, transition:"easeInOutCubic" }); } } private function onClick():void{ Tweener.addTween( myImage , { rotationX:0, rotationY:0, rotationZ:0, time:1, transition:"easeInOutCubic" }); } private function onResult():void{ onClick(); for( var i:int = 0; i < hts.lastResult.item.length() ; i ++ ){ var image:Image = new Image(); image.source = hts.lastResult.item[i].image_big.image1; image.width = 100; image.height = 100; image.x = this.width/2; image.y = this.height/2; image.rotationX = 0; image.rotationY = 0; image.rotationZ = 0; myCanvas.addChild( image ); Tweener.addTween( image , { x:Math.random() * this.width, y:Math.random() * this.width, z:Math.random() * this.width, rotationX:Math.random() * 360, rotationY:Math.random() * 360, rotationZ:Math.random() * 360, time:3, transition:"easeInOutCubic" }); image.addEventListener(MouseEvent.CLICK , onImageClick2 ); } } private function onItemClick():void{ bigImage.visible = true; Tweener.addTween( bigImage , { rotationX:0, rotationY:0, rotationZ:0, time:1, transition:"easeInOutCubic" }); } private function onImageClick():void{ bigImage.visible = false; Tweener.addTween( bigImage , { rotationX:-20, rotationY:-360, rotationZ:-20, time:1, transition:"easeInOutCubic" }); } private var oldIm:Image; private function onImageClick2(e:MouseEvent):void{ var im:Image = e.currentTarget as Image oldIm = im; myCanvas.setChildIndex( im , myCanvas.numChildren - 1 ); Tweener.addTween( im , { x:this.width /2, y:this.height/2, z:0, width:400, height:400, rotationX:360, rotationY:360, rotationZ:360, time:1, transition:"easeInOutCubic" }); } ]]> </mx:Script> <mx:HTTPService id="hts" url="http://moeten.info/maidcafe/?m=api&tid=13&type=shop" resultFormat="e4x" result="onResult()"/> <mx:Canvas id="myCanvas" width="100%" height="100%"> <mx:TileList id="myImage" x="42" y="47" dataProvider="{hts.lastResult.item}" width="363" height="359" itemClick="onItemClick()" rotationX="{Math.random()*360}" rotationY="{Math.random()*360}" rotationZ="{Math.random()*360}" > <mx:itemRenderer> <mx:Component> <mx:Image width="100" height="100" source="{data.image.image1}"/> </mx:Component> </mx:itemRenderer> </mx:TileList> <mx:Text id="myText" text="http://d.hatena.ne.jp/haru-komugi/" x="42" y="21"/> </mx:Canvas> <mx:Image id="bigImage" source="{myImage.selectedItem.image_big.image1}" rotationX="{Math.random()*360}" rotationY="{Math.random()*360}" rotationZ="{Math.random()*360}" width="500" height="500" x="162" y="51" visible="false" click="onImageClick()" showEffect="Fade" hideEffect="Fade"/> </mx:Application>