I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?
original title: "actionscript 3 - Adobe Flex component events"
I wrote a component that displays a filename, a thumbnail and has a button to load/play the file. The component is databound to a repeater. How can I make it so that the button event fires to the main application and tells it which file to play?
ファイル名とサムネイルを表示し、ファイルをロード/再生するボタンがあるコンポーネントを作成しました。コンポーネントはリピーターにデータバインドされます。ボタンイベントが発生するようにするにはどうすればよいですか...
これは翻訳後の要約です。完全な翻訳を表示する必要がある場合は、「翻訳」アイコンをクリックしてください。
On your custom component you can listen to the button click event and then generate a custom event that holds information about the file you want to play. You can then set the bubbles property to true on the event and dispatch the custom event from your custom component. The bubbles property will make your event float up the display list and reach your main application. Now on your main application you can listen to that event and play the correct file. Hope this helps.
Figured it out (finally)
Custom Component
The Repeater
Handling function