|
Here is a link to the source code and an example FLA for my "listbox
alternative" which I call a ScrollList... http://www.sleekdigital.com/downloads/scrolllistsource.zip Note that in the example fla, not all the items in the list have a caption under them. This is not a bug, just an example to show that the captions were made optional. It looks like a lot of code, but for general usage the only classes you need to pay much attention to are: ScrollList - the main class that you instantiate IListItem - the interface that you implement in order to create an item template. Other important classes... AssetListItem - is just a simple example implementation of IListItem so you can easily see how you might implement some of the methods. In fact you might use the exact implementation for many of the methods. The methods that will likely be specific to your implementation are: setData - here is where you process the xml node that is passed into the item and use it to configure the display of the item. ListBase - you might also look at this class since ScrollList inherits from it. There are a number of useful public methods in there. This version is more advanced than the one on layer51.com for the following reasons: -It allows any scroll pane implementation to be used. You just have to write a simple adapter class. The zip file includes an adapters for macromedia's scrollpane and MCOM's scroll pane. -The scroll wheel will work where supported. -Supports the ability to drag and drop items within the list to change the order. All you have to do is have your item implementation dispatch "itemDrag" and "itemDrop" events at the proper time, setting itself as the event target. The ListBase class takes care of the rest for you. -Supports adding and removing items on the fly. -Dispatches a few more events: itemSelected, itemAdded, layoutComplete. It would be easy to add other events if needed -If you want to have items that dynamically change size ( for example the user clicks to expand an item for more detail or something like that), this is supported. You simply make your item dispatch a "itemChangeSize" event at the appropriate time. I've even had items expand into a nested lists. The nested list was a non scrolling list built on the ListBase class. -Supports most methods you see in collection API's. I think that covers it. I'm sorry that I don't have better documentation for this, but this is not an official open source release, just me responding to requests to see the code. If there are any questions about how to use it or feedback on the code please let me know. Perhaps someday I can make an official release. If anyone uses this I would appreciate an email describing your project. Thanks, Steve Steve Krichten wrote: Ok, I will send a link to the list later today. |
_______________________________________________ osflash mailing list [email protected] http://osflash.org/mailman/listinfo/osflash_osflash.org
