Thanks Alex, I will take a look through those as a starting point.


----- Original Message ----
From: Alex Harui <[EMAIL PROTECTED]>
To: "[email protected]" <[email protected]>
Sent: Thursday, 18 September, 2008 19:18:47
Subject: RE: [flexcoders] Trying to refine inline itemrenderer prompt to state 
based image loading


Read the itemrenderer posts on my blog
(blogs.adobe. com/aharui) .  Renderers get recycled and only enough renderers to
display the visible items are created, so using creationCOmplete is rarely
useful.
 
From:[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf 
Of pedrocpedroc
Sent: Thursday, September 18, 2008 10:24 AM
To: [EMAIL PROTECTED] ups.com
Subject: [flexcoders] Trying to refine inline itemrenderer prompt to
state based image loading
 
Hi,

Here is the component with the inline item renderer:

<local:Component >

<local:itemRenderer>
<mx:Component> <local:imageRend
creationComplete="outerDocument. loadFirstEleven( event.currentTar get);"
click="outerDocument. inView(event. currentTarget) ;"/>
</mx:Component>
</local:itemRenderer>

</local:Component>

Here is the creationComplete triggered function:

var count55:int= 0

public function loadFirstEleven( targetObj: Object):void{

var target:imageRend = (targetObj as imageRend);

if( count55 < Math.min(12, model.subscriptions .length ) ){

target.currentState = "loading_thumbnail";
count55++;
}
}

Which, as expected, changes the state in the first lot of target objects.

(Changing the state prompts imageRend to start retrieving related
images, and 'loaded' swaps out a placer image with the required one.)

So far so good, but what I really want to do is load up the first few
images, and then react to user clicks (hence the 'inView' reference)
to load up further images i.e. 13 onwards.

I have tried traversing, using the objects parent property, and then
getChildAt/getChild Index combinations, as a basis for finding the
current position + 12, but I am just guessing and its getting me nowhere.

Thanks for any help in advance.     


      

Reply via email to