One of the "problems" with Image is that it doesn't know how big it is until 
the image is loaded, which is after the VBox measures and sizes it.  It should 
cause another layout pass after the image loads, but sometimes various 
constraints and flags prevent that from happening.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Kearney Buskirk
Sent: Monday, December 22, 2008 2:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] how to manage display of 2 images inside a VBox?


On Dec 22, 2008, at 12:08 PM, Manish Jethani wrote:

> On Mon, Dec 22, 2008 at 10:14 PM, kearney_buskirk
> <kear...@lightthrumedia.com<mailto:kearney%40lightthrumedia.com>> wrote:
>
>> The situation: a large photo jpg and a small text png are
>> vertically constrained within a
>> VBox. The small text png is positioned below the photo in the layout.
>>
>> The problem is the small file loads first at the top of the VBox
>> and then is pushed down to
>> its place at the bottom once the larger photo loads.
>>
>> So how to program Flex to load the text file after the photo file?
>> Or second choice would be
>> for the text file to be constrained to load in its place.
>
> <VBox>
> <Image source="..." complete="smallImage.load()" />
> <Image source="..." autoLoad="false" />
> </VBox>
>
> On the complete event of the first one, you load the second.

These are images which get fed a different source in different states,
through a <mx:SetProperty/> (to make a slide show with captions). The
above code worked in the starting state (which is not the same as the
base state) but then didn't work in subsequent states. I don't
understand why that would be the case.

I suppose I could insert a <mx:SetProperty/> for the autoLoad and a
<mx:SetEventHandler/> for the complete event in each state but there
must be a more elegant solution.

Thank you very much for your response.

Kearney Buskirk
>
>
>> Putting this within the opening VBox tag didn't work:
>>
>> creationPolicy="queued"
>> creationIndex="0"
>
> creationPolicy is really for the container (VBox) itself, not for its
> children. That is to say, it does not affect the order in which the
> children are created. Moreover, here the issue is not that the second
> one is _created_ before the first, it is that the image inside the
> second one gets loaded before the first.
>
> --
> http://manishjethani.com/
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo
> ! Groups Links
>
>
>

Reply via email to