PDA

View Full Version : background image problem


mfsiddiq
01-09-2009, 02:42 PM
I have a component which has 6 canvas (button mode) with background images(same for all canvas) .On click of a particular canvas it has to be highlighted with a different background image and the previous clicked has to be reverted back to the default background image.
On click event i am running a for loop to check for the clicked canvas there by setting a new background Image and setting the rest to the default background image. But sometimes the default background image is not unloaded (struck) and as a result the highlighted background image appears behind the default image.Even though i am using invalidateDisplayList() on the component after the end onClickMethod()

Thanks in advance
Sidd

MattJohnson
01-09-2009, 10:32 PM
If you are using a different STATE for each button, remove the background for that state
<mx:RemoveChild target="YourBackground"/>

otherwise you can make a seperate function for that particular button that sets that particular background visible=false.
<mx:SetProperty target="YourBackground" name="visible" value="false" />
There is probably a way to MoveToFront or something but I am not sure how to do that.

Hope this helps