Mike6679
Mike6679

Reputation: 6117

Flex resize image inside updateDisplayList

I have a custom component which is an HBox & I'm trying to resize a child which happens to be an image. This is image is inside a VBox which is also a child of the HBox. I have a number of these images so In UpdateDisplayList I call:

myimageArray[0-5].setActualSize(50,50);

but the image is never resized it just stays a large default size. The images source is a url path and I'm wondering if that is what is causing the problem?

Upvotes: 0

Views: 495

Answers (1)

Maxim Kachurovskiy
Maxim Kachurovskiy

Reputation: 3022

You should call setActualSize() for each array item manually:

for each (var uiComponent:UIComponent in myimageArray)
{
    uiComponent.setActualSize(50,50);
}

Or, if you need to resize only first 6 elements:

for (var i:int = 0; i < Math.min(6, myimageArray.length); i++)
{
    myimageArray[i].setActualSize(50,50);
}

Upvotes: 1

Related Questions