Simplify the test case further. Just press a button and change the image source. Then set a breakpoint in Image.as or SWFLoader.as and see what it is doing.
On 4/21/10 12:20 PM, "Peter Davis" <[email protected]> wrote: I'm trying to fix a *very* simply app. that just displays some images, and is supposed to refresh the images when their URL parameters change. In particular, these are supposed to be images of data tables, and the query string specifies a table style, a text color and a border color. The tables display correctly when loaded, but they don't respond when I change the source URLs. I've verified that the sourceChange event is triggered. I even put the new URL into a TextInput control, and verified that this URL works (display the correct table) in another browser tab. But the images in the Flex app don't ever change. Thanks for any suggestions. Here's the whole thing: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark <http://ns.adobe.com/flex/spark> " xmlns:mx="library://ns.adobe.com/flex/mx <http://ns.adobe.com/flex/mx> " minWidth="800" minHeight="600"> <fx:Script> <![CDATA[ import mx.events.ColorPickerEvent; import mx.controls.Alert; private function imgInit(s:int):void { switch (s) { case 1: table1.addEventListener(" sourceChanged", image_sourceChanged); break; case 3: table3.addEventListener("sourceChanged", image_sourceChanged); break; case 5: table5.addEventListener("sourceChanged", image_sourceChanged); break; default: } } private function image_sourceChanged(evt:Event):void { Alert.show(evt.toString() + "\nSrc: " + Image(evt.target).source, evt.type); } public var colorArr:Array =["0x231F20", "0x9E280E", "0x8A713C", "0x007236", "0x007D97", "2E3092", "0x5D1E79", "0x4C4C4E", "0x88191C", "0xF5821F", "0x727C28", "0x1E9860", "00837D", "0x0071BC", "0x7C51A1", "0x939598", "0xED1C24", "0xFCAF17", "0xA5A85A", "57BD7C", "0x57C5C7", "0x00AEEF", "0xAA4A9C", "0xA7A9AC", "0xEC008C", "0xFFCE71", "FFF200", "0xBED630", "0x95D5D1", "0x42C7F4", "0xBC7BB5", "0xDCDDDE", "0xF49AC1", "FEDCC6", "0xFFF78F", "0xE5F0CB", "0xE2F3F4", "0x9FC9EB", "0xC7B2D6", "0xFFFFFF"]; var urlBase:String = "http://localhost.us/viewtable.aspx"; var textColorIndex:uint = 0; var textColor:String = "000000"; var borderColorIndex:uint = 0; var borderColor = "000000"; protected function updateTables():void { //url1.text = urlBase + "?styleIndex=1&textColor=%23" + textColor + "&borderColor=%23" + borderColor; table1.source = urlBase + "?styleIndex=1&textColor=%23" + textColor + "&borderColor=%23" + borderColor; url1.text = String(table1.source); table1.load(String(table1.source)); table3.source = urlBase + "?styleIndex=3&textColor=%23" + textColor + "&borderColor=%23" + borderColor; table3.load(String(table3.source)); table5.source = urlBase + "?styleIndex=5&textColor=%23" + textColor + "&borderColor=%23" + borderColor; table5.load(String(table5.source)); } protected function textColor_changeHandler(event:ColorPickerEvent):void { textColorIndex = ColorPicker(event.target).selectedIndex; var fullName:String = colorArr[textColorIndex]; textColor = fullName.substr(2); updateTables() } protected function borderColor_changeHandler(event:ColorPickerEvent):void { borderColorIndex = ColorPicker(event.target).selectedIndex; var fullName:String = colorArr[borderColorIndex]; borderColor = fullName.substr(2); updateTables(); } ]]> </fx:Script> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:Label x="25" y="30" text="Table Test" fontSize="24" fontWeight="bold"/> <s:Label x="42" y="73" text="Text color:
"/> <mx:ColorPicker x="109" y="63" dataProvider="{colorArr}" change="textColor_changeHandler(event)"/> <s:Label x="25" y="113" text="Border color:
"/> <mx:ColorPicker x="109" y="103" dataProvider="{colorArr}" change="borderColor_changeHandler(event)"/> <s:TextInput id="url1" x="25" y="145" width="600" text=""/> <mx:Image id="table1" x="25" y="185" initialize="imgInit(1);" source="http://localhost.us/viewtable.aspx?styleIndex=1"/> <!-- <mx:Image id="table1" x="25" y="185" source="http://localhost.us/viewtable.aspx?styleIndex=1"/> --> <mx:Image id="table3" x="25" y="335" source="http://localhost.us/viewtable.aspx?styleIndex=3"/> <mx:Image id="table5" x="25" y="485" source="http://localhost.us/viewtable.aspx?styleIndex=5"/> </s:Application> -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui

