The following example shows how you can detect when the source property has changed on a Flex Image control using the sourceChanged event.It shows a alertbox when the source is changed.
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml“
layout=”vertical”
verticalAlign=”middle”
backgroundColor=”white”>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function init():void {
img.addEventListener("sourceChanged", image_sourceChanged);
}
private function image_sourceChanged(evt:Event):void {
Alert.show(evt.toString(), evt.type);
}
[...]
Archive for June, 2008
Detect when the image source is changed.
Posted in Flex on June 30, 2008 | Leave a Comment »
Build your own chat application
Posted in Flex on June 11, 2008 | 6 Comments »
Flex supports publish and subscribe messaging through the open source BlazeDS Message Service. The Message Service manages a set of destinations that Flex clients can publish and subscribe to. Flex provides two components, Producer and Consumer, that you use to publish and subscribe to a destination. To subscribe to a destination, you use the subscribe() [...]