AS3简单网格布局
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3简单网格布局相关的知识,希望对你有一定的参考价值。
Simple grid layout technique in actionscript 3. Check out the demo and more details at http://adamcoulombe.info/lab/as3/gridlayout.html
// Demo for this example at http://adamcoulombe.info/lab/as3/gridlayout.html //Download these classes at http://www.greensock.com/tweenlite/ import com.greensock.TweenLite; import com.greensock.easing.*; var gridItems = new Array(); var grid = new Sprite(); grid.x = 65; grid.y = 50; addChild(grid); for (var i:int = 0; i < 20; i++) { gridItems[i] = new MyBox(); gridItems[i].x = (i % 5) * (gridItems[i].width ); gridItems[i].y = int(i / 5) * (gridItems[i].height); gridItems[i].addEventListener(MouseEvent.MOUSE_OVER,gridItemOver); gridItems[i].addEventListener(MouseEvent.MOUSE_OUT,gridItemOut); grid.addChild(gridItems[i]); } function gridItemOver(e){ grid.addChild(e.currentTarget); TweenLite.to(e.currentTarget,0.5,{scaleX:1.2, scaleY:1.2,ease:Elastic.easeOut}); } function gridItemOut(e){ TweenLite.to(e.currentTarget,0.5,{scaleX:1, scaleY:1,ease:Elastic.easeOut}); }
以上是关于AS3简单网格布局的主要内容,如果未能解决你的问题,请参考以下文章