久しぶりにFlex!
久しぶりにFlexやってみました。
こんな感じ
http://moeten.info/flex/20090719_datagrid/bin-release/main.html
DataGridの中身が3Dな回転をします。
SDK4.0は別物なのでSDK3.4に切り替えて、さらにFlash10用に設定
追加コンパイラ引数に以下を追加
-target-player=10
これでFlash10用のクラスが使えたりします。簡単便利!
3Dな回転エフェクトは以下のコードでOK
<mx:AnimateProperty fromValue="90" toValue="0" property="rotationX" duration="1000" />
ソースはこちら
メイン
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" creationComplete="hts.send()" viewSourceURL="srcview/index.html"> <mx:HTTPService id="hts" url="http://moeten.info/maidcafe/?type=shop&tid=&cid=1&m=api" resultFormat="e4x"/> <mx:TileList dataProvider="{hts.lastResult.item}" itemRenderer="mycanvas" width="615" height="671" x="15" y="35" backgroundColor="0xffffff"/> </mx:Application>
アイテムレンダー用
<?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="572" height="130" cacheAsBitmap="false" showEffect="Fade" creationComplete="init()" themeColor="#A2007E" borderStyle="solid" borderThickness="1" borderColor="#FF1FFC" cornerRadius="7" alpha="1.0" backgroundColor="#EBF3FF" > <mx:Image x="9" y="10" width="99" height="109" source="{data.image.image1}"/> <mx:Label x="114" y="8" width="447" height="31" text="{data.shopname}" textAlign="left"/> <mx:TextArea x="115" y="46" width="449" height="74" text="{data.setumei}" editable="false" textAlign="left" borderStyle="none" alpha="1.0" backgroundAlpha="0.0" /> <mx:Parallel id="myEffect" target="{this}"> <mx:Fade alphaFrom="0" alphaTo="1" duration="1000"/> <mx:AnimateProperty fromValue="90" toValue="0" property="rotationX" duration="1000" /> </mx:Parallel> <mx:Script> <![CDATA[ private function init():void{ myEffect.play(); } ]]> </mx:Script> </mx:Canvas>