デバッグの為のダイアログ †mx.controls.Alert.show('デバッグ文', 'メッセージ'); DataGrid?の選択しているオブジェクトを取得する。 †別途hogeItem変数は定義しておきます。 <mx:DataGrid id="list" width="100%" height="100%" dataProvider="{dataObject}" change="hogeItem=event.target.selectedItem"> <mx:columns> <mx:Array> <mx:DataGridColumn headerText="Name" columnName="name" width="300"/> <mx:DataGridColumn headerText="Price" columnName="price" textAlign="right" marginRight="4"/> </mx:Array> </mx:columns> </mx:DataGrid> <mx:Label text="{hogeItem.name}" /> グリッド内で行を選択するとchangeイベントが発生するので、 event.target.selectedItem プロパティで選択しているオブジェクトを取得できます。 TileList?で選択しているオブジェクトを取得する。 †<mx:TileList id="myTile" dataProvider="{dataObject}" height="100%" width="100%" itemHeight="116" itemWidth="120" cellRenderer="ProductThumbnail" borderStyle="none" change="selectedItem=dataObject[myTile.selectedIndex];"> ↑選択している場所(selectedIndex)を使って配列からオブジェクトを取得する。 </mx:TileList> この記事は
現在のアクセス:9180 |