0
votes

I am trying to place the text content on an image loaded from assets:

<s:Image  id="mainB" depth="1" height="100%" width="100%" source="assets/img/board.png"/>


simageid.width
simageid.height

When I try to get the width and height on mobile devices, it returns the image's rendered height on screen. On tablets, it doesn't return the rendered height. When placing the element dynamically based on height and width, it gets misplaced on tablets.

How can I consistently get the rendered height for the image across all mobile platforms?

I'm using Flex 4.6.0.

1
Could you add more context to your code? When are you getting simageid.width?CyanAngel
tablets and mobile devices are the same thing so correct your text so it makes some sense.BotMaster
like as soon as the activity renders view, it initializes variables with the board.png s:Image height and width and place objects on images dynamically, basically the board.png is a sort of 2d array boxAbdullah
What is simageid? It doesn't make any sense compared to the rest of your question.Brian

1 Answers

0
votes

Try listening for the updateComplete event before you grab the height or width of an Image in flex because it has to asynchronously load it first.