Actionscript 3 :: Implement An Object Pool For Flex Data/Item Renderers

Oct 6, 2010

You can hook into the creation of Flex 4 item renderers easily enough (through itemRenderer, or itemRendererFunction) allowing you to pull renderers from a custom object pool, but how would you put those renderers back into the pool?

I understand that layout virtualization does a form of object pooling, but I'd like a way to hook in to that. For example, when an itemRendererFunction has been assigned to a data group with a virtualized layout, item renderer construction is indeed deferred, but the instances are not re-used - I'd like to be able to intervene there, if possible.

But even in the case of normal virtualized renderers (where the instances are re-cycled) it would still be useful to be able to manage the pool manually. Pools could be shared between data groups, for example, to reduce the initial buffer required to populate each group.

Is there any way to know when Flex discards an item renderer instance? I have a sinking feeling that there is just no reliable way to tell - even though perhaps there should be.

View 2 Replies


Similar Posts:


Flex :: Use 2 Different Item Renderers In Mx:Tree?

Mar 20, 2010

How can I use multiple item renderers in mx:Tree depending on item's depth/level in tree?For example. For the first level items I want to use label with button and for second level items combobox

View 2 Replies

Flex :: Force All Item Renderers To CommitProperties?

Mar 5, 2010

I have an item renderer that checks an external source for display information. If that information changes, I want to force all item renderer instances to check it.

What's the best way for force all the item renderers in a list or grid to either commitProperties or execute some other method?

I've read that resetting the grid.itemRenderer property will make them all initialize. I've also received the suggestion to iterate recursively through all the grid's children and call invalidateProperties on all the UIComponents I find.

View 2 Replies

Flex :: Use Creation Complete In Item Renderers?

Nov 25, 2010

Can i use creation complete in item renderers, i have a data grid and i have kept every single cell as an item renderer. is it a good practice to use creation complete here. I fear events might fire up at wrong instances.

View 2 Replies

Flex :: Triggering Item Renderers On Hover With DataGrids

Sep 27, 2009

I've got a client who has a list of items on a Datagrid. When the row is clicked, it sends the user to another page with details of that item. The client wants the rows to act like HTML links, where the color is purple when the link has been previously visited and its normal color if the row hasn't been clicked in the past. I've accomplished this with item renderers and SharedObjects. The application loads the visited ids into an array on start and the item renderer colors the individual cells if that row had been visited.

The issue here is that the client also wants the text color in the rows to turn white when the user rolls over the row. Because the item renderer sets the color, it doesn't respond to the default stylesheet for the datagrid. I can make it turn white on rollover of an individual cell, but we need the whole row to do it. Is there a way to trigger a function in all the item renderers in the row, or is there a better way to accomplish this?

View 1 Replies

Flex :: Set Up Item Renderers To Have The Created Only If They Are Displayed On The Viewport?

Jan 24, 2011

I have data ItemRenderers with DataGroup, but I have many items, and it seems to me that DataGroup create all of them not only those few displayed on users screen, which takes time and resources.

View 1 Replies

Actionscript 3 :: Flex / Using Multiple Item Renderers In A List

Feb 23, 2011

I'm trying to have multiple item renderers in a list, as I have several different types of objects that I want to display. I tried creating a new class that extends ListBase, and adding override public function createItemRenderer with my code within this function. I then instantiate the new class and give it my array of data as its dataProvider, but createItemRenderer is never called within my new class,

View 2 Replies

Actionscript 3 :: Creating Custom Item Renderers In Flex?

Jun 14, 2011

while creating custom item renderers which interfaces we need to implement?

View 2 Replies

Flex :: Avoid Loads Of 'if Statements' In Item Renderers?

Aug 8, 2011

I have an item renderer for a list containing an image, label and a checkbox.These are visible depending on the dataProvider property of the list.E.g if an image is a premium image then display the premium label, if an image is a favourite then display a star etc.The problem is i have a massive if statement, and this doesn't seem good practice.

View 1 Replies

Flex - Spark List Reusing The Wrong Item Renderers?

Feb 9, 2010

I have a List component using multiple item renderers determined by the itemRendererFunction. When I set the data the first time, it works as expected. Then, when I set the data a second time with new data, it doesn't call the itemRendererFunction and tries to reuse the current renderers even though they don't match the data.Once I scroll, the function is called and the correct renderers are used. I tried calling invalidateDisplayList and such prior to setting the data, but that didn't fix the problem.

View 3 Replies

Flex :: Override The Column Item Renderers For The Datagrid Component Dynamically

Feb 24, 2011

I have a view component called viewBase where I defined a advanced datagrid with few item renderers for datagrid columns. Now I have a requirement where I need to use the same view viewBase component, but not required to use any item renderers.

how to override the itemrenderers which are declared in a view component?

View 1 Replies

ActionScript 3.0 :: Letting Each User Select Only 1 Item From A Pool?

Dec 4, 2011

I'm working on an 8-user app that runs over a wi-fi network using an XML socket. All of the hardware is located inside a medium sized room in a school building.At the start of the app, each user can select 1 role from a pool of 8. However, the socket connection runs at less than realtime, probably because of latency from the wi-fi, so it's possible for two users to make the same selection at the same time. How would I prevent this?

View 1 Replies

Action Script 3 :: Custom Image Item Renderers?

Jun 25, 2009

I have a custom item renderer which displays a different gif in the row depending on data value from the data object. When i set the image source url using the absolute path and not embedding it works fine however when i embed the images i find that when i scroll up and down the grid the images get messed up and sometimes sit on top of each other. why embedding images in my hbox item renderer is causing so hassle;

code
public var equipment:Image;
public var compr_icons:Bitmap = new AssetManager.COMPUTER_ICON;

.. do some logic
equipment.addChild(compr_icons);

View 1 Replies

Actionscript 3 :: Refresh Item Renderers And Change Their State?

Feb 2, 2012

I have a list with time related data. the item renderers display this time. I would like to make the item renderers refresh their state/labels upon the tick of a timer.

to which event should I add a listener within the renderer, and how do I trigger such event from the list?

View 3 Replies

Flash - Enable Tab Key Navigation On A Datagrid Where The Cells Are Custom Item Renderers?

May 26, 2011

This is a snippet of code in our custom item renderer which is in actionscript:

textCustomItemRendererTempForTab.tabEnabled=true;
textCustomItemRendererTempForTab.focusEnabled=true;
textCustomItemRendererTempForTab.setFocus();
Alert.show( "Without this alert focus goes to next grid " );
keyboardEvent.preventDefault();
keyboardEvent.stopImmediatePropagation();
keyboardEvent.stopPropagation();

Right now tab navigation works (on tab, focus goes to next editable cell) with the alert inserted in the code but I'm not sure why because I believe the alert in the code breaks the flow of event bubbling. However without the alert (which is what we are going for) the focus goes to the next grid in our UI.

You can see the attempts of trying to stop the event from going to other components. I have also tried to call preventDefault() and stopPropagation() on the datagrid when it receives a tab key event.

how to allow proper tab key navigation without an alert?

View 1 Replies

ActionScript 3.0 :: Getting Objects From An Object Pool

Jul 31, 2011

I'm learning to use Object-pooling. I'm trying to see how to get objects from the start of the pool and shift all the objects at position i to i-1. I've had a look at Adobe's help file on the subject [URL] but there I'm confused.

[Code]...

View 2 Replies

ActionScript 3 :: Using Object Pool And Flash?

Jan 25, 2011

When is it a good idea to use an object pool in Flash? For example, is it a good/bad idea with bitmaps, MovieClips (with timeline animations inside of them), video, fonts?

View 1 Replies

Flash :: Object Pool Not Working?

Dec 28, 2011

I'm having trouble setting up my object pool. I created a "BallPoll" custom class to handle the pooling logic. I first call fillPool() to add 20 Ball objects into my array. Then in my document class when I want to create a Ball, I check the pool array. It isn't working and I'm not sure why.

[Code]...

View 1 Replies

Actionscript :: Object Pool Design Pattern?

Nov 22, 2010

Can anyone show an example of the object pool design pattern, as written with Actionscript 3.0?

View 1 Replies

ActionScript 3.0 :: Memory Management With An Object Pool

Sep 8, 2009

I've been trying to figure out how Flash does its memory management regarding object declarations but haven't found anything that describes declarations themselves. [code]Basically I want a pool of declared variables that get instantiated only when a certain type is set. I'd have logic in other functions that figures out what the type is and then does certain things to it, but for now I just wanted to know what kind of memory management Flash does with something like this. Does it do nothing until I actually instantiate it (= new Object()) or will space be set aside once I simply declare it (someObj:Object)?

View 2 Replies

Actionscript 3 :: Implement A Data-structure In Flex That Just Like LinkedHashSet In Java?

Aug 17, 2010

As ArrayCollection in Flex is limited, I'm looking for a data-structure that something like LinkedHashSet in Java, LinkedHashSet maintains a doubly-linked list running through all of its entries,it defines the iteration ordering, which is the order in which elements were inserted into the set (insertion-order).But there is little information about Flex data-structure

View 2 Replies

Actionscript 3 :: Flex - Implement Sortable List Of Object?

Jul 25, 2010

I have list of object that I want each item to be rendered with some renderer that include a delete and edit buttons with some text. What is the best way to make the list of object re-order-able in drag/drop fashion so the user can drag on item on top of another to change the order of the list.

View 1 Replies

Flex :: Removing Flex DisplayObjects From View AND Memory Pool

Feb 15, 2011

There is a Flex app with 7 main views. And there is a memory issue when navigating between views.All these views were in a ViewStack, but due to some involving 3D objects I assumed it was too much to have it all in the display list. I'm now clearing all children from the stack and adding/removing them when needed. This gave a small performance increase, but still becomes unresponsive with use. The strange thing is, with this and the original method, the CPU climbs with use but eventually levels out somewhere. Now I'm creating new instances of each screen when they are navigated to and setting the previous variable to null. Now it looks like CPU is spiking when the view is created, but leveling out to something much much lower than it was. This felt like progress, but now the available memory keeps climbing where it wasn't before....

My understanding was calling remove child or remove all children would mark the object for deletion when the garbage collector next ran. I can't see any other references to the instance. My code is along the lines of [code]I have a function for each button to add a new instance like the above.The only thing I can see and feel silly asking but need confirmation, is each view extends a class called "Screen", this class contains a singleton reference to some core components.[code]Would this trick the garbage collector into thinking it was still needed? General advice on clearing Objects from the memory pool would awesome!!! I've never needed to analyze the Flash Player in such depth.I think it's an error with sound drivers, removing all sound and shes purring like a kitten. Works on my machine fine with windows XP, but not on the touch pad the application is crashing on with windows 7 (unsure of the drivers looking into them now) Now I'm thinking its not the drivers, tried 3 different versions, all with no improvement. I did discover the sound was fading in and out with the TweenLite lib. Doesn't look like there are any memory leaks in TweenLite as it works fine on other machines. Just the use of volumeEasingFunction seems to consume increasing amounts of CPU until it freaks out. It is crappy hardware running windows 7, which doesn't help.

View 1 Replies

Flex :: Selecting One Particular Data Item?

Jul 9, 2010

I've created an Flex app. It currently has an drop down menu. With the option to select a Channel. Once the channel is selected the data pulls through. But, what I want to do is just pull through one channel of data as opposed to multiple items of data. How can I achieve this?

My code is quite simple at the moment and looks like this :

<mx:FormItem label="Select your Channel : " x="296" y="0">
<s:DropDownList id="channelSelection"
dataProvider="{channelList.lastResult.channels.channel}"

[Code].....

View 1 Replies

Flex :: Selecting One Particular Data Item From XML

Jul 12, 2010

I've followed the Flex in a week example, with the drop down menu that pairs the XML data to the XML node set.For the project I am creating, I am just pulling through ONE XML file containing just one node into my application.I am using HTTPService and pulling the data through, but at present the only way for this to work is by using the <s:DropDownList>[code]

View 1 Replies

Flex :: Using An Image Item Render In A Data Grid

Jul 7, 2010

I'm attempting to add an image to a datagrid item render dynamically in flex. Here is my DataGrid code The value of "str" in the getImagePath function is correct.

[Code]....

View 1 Replies

Flex :: Inline Item Editor Wiping Out Data?

Jan 16, 2011

In this app that has an inline item editor, if you click on a location cell then press tab, the value in the location cell is wiped out.

focusOut doesn't work, nor could I get this to work in DataGrid itemEditEnding etc.

See this Flex forums post, because posting code here rots:[URL]

View 1 Replies

Flex :: Get An Access To A Flash Player`s Events Pool?

Sep 22, 2009

I want trace every event on every object, there is way to do it?

View 2 Replies

Flex :: Cant Edit Item In Datagrid With Override Set Data Method?

Mar 12, 2010

I've a custom itemRenderer for my datagrid. To set the actual data I use the following method:

override public function set data(side:Object):void{
...
}

As soon as I use this function the cell doesn't show up any item Editor anymore. Why is that? When I remove this function the itemEditor is working but with the wrong initialization data.

View 3 Replies

Flex :: Datagrid, Select An Item Given My Data Attribute Values?

May 6, 2010

I'm using a custom component CheckBoxList DataGrid (http://blogs.adobe.com/aharui/2008/02/checkbox_selection_in_datagrid.html) and as dataProvider I have an ArrayCollection with items such this one:

name="item name" selected="true"

I would like the CheckBox list updated when the selected attribute is set to false or true in the data model.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved