0

mxmlアプリケーションに2つのタイルリストがあります。アイテム(画像とラベル)は、アイテムレンダラーによってレンダリングされます。私が達成したい機能:タイルリスト#1から画像をドラッグし、タイルリスト#2にドロップします(その後、SQLクエリを使用したhttpserviceが起動します)。

この問題にどのように対処しますか?(高レベルの情報で十分です)。私が抱えている主な問題は、メインからアイテムレンダラーにメソッドを呼び出す方法がわからないことです。レンダラー内でd&d機能をコーディングしたいのですが、レンダラー内からウォッチリスト#2にアクセスする方法がわかりません。main.mxmlの関連コード:

<s:Panel id="panel"  width="100%" height="100%" title="Watchlist">
<s:layout>
<s:VerticalLayout paddingBottom="5" paddingLeft="20"
                          paddingRight="20" paddingTop="5"/>
    </s:layout>
    <s:Label width="20%" fontSize="17" fontWeight="bold" text="Your watched movies"/>
    <mx:TileList id="myWatchedList_tile" height="360" borderVisible="false" width="80%"
                 columnCount="5" columnWidth="200"
                 itemRenderer="components.TileListItemRenderer" rowCount="1" rowHeight="360"/>
    <s:Label width="20%" fontSize="17" fontWeight="bold" text="Your to watch movies"/>


    <mx:TileList id="myToWatchList_tile"  height="360" borderVisible="false" width="80%"
                 columnCount="5" columnWidth="200"
                 itemRenderer="components.TileListItemRenderer" rowCount="1" rowHeight="360" />

</s:Panel>

itemrenderer:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
     borderVisible="false" horizontalAlign="center" verticalAlign="middle"
     xmlns:components="components.*">



    <mx:Image source="{data.poster_url}" />
    <mx:Label text="{data.movie_title}" height="20" />
</mx:VBox>
4

2 に答える 2

0

オブジェクトを使用して、アイテムレンダラーの外部のメソッドにアクセスできouterDocumentます。それらが(スコープ)パブリックメソッドであることを確認してください。

http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.edu.html

于 2012-12-13T13:22:43.173 に答える
0

別の解決策として、代わりにスパーク リストを (TileLayout を使用して) 使用することもできます。その後、リスト間でドラッグ アンド ドロップを簡単に使用できます

..「ドロップ」イベントに応答してサービスを起動します (イベントはドロップされた画像への参照を持ちます)

于 2012-12-15T00:50:11.823 に答える