In a recent project that came across my path, I found myself needing to write a custom data structure. When I began constructing the structure in my head, I thought back to my C++ days and templated classes. Templating the functionality of a class allows you to use the class in many situations without extending the class to deal specifically with the data type you are working with (Numbers, Strings, MovieClips, etc). In AS3, there isn’t exactly a construct built in to specifically declare a class as a template. However, the perfect container is available to us to simulate this functionality; the Array.
By creating a class that acts upon objects in an Array, the data type of the objects contained in the array is irrelevant. Note that if you are planning to modify specific properties of the data type contained in the array, you will have to extend the class. This is where the templating in AS3 begins to break down, but that’s ok, there is still a lot we can do.
With the RangeList, I have created a data type similar to a circular list, however it defines a range of items that allows you to traverse a subset of the entire array and also allows you to independently modify the subset that you are currently working with. This set of functionality is great if you want to create any sort of dynamically sized menu.
And here is the source and the fla
-Andrew
Tags: actionscript 3, carousel, extended functionality, flash, flash menu, ranged list, templated data structures
Buy:Prozac.Cozaar.Buspar.Lipitor.Wellbutrin SR.Lasix.Zocor.Female Cialis.Ventolin.Lipothin.Acomplia.Amoxicillin.Benicar.Advair.Zetia.Seroquel.SleepWell.Nymphomax.Aricept.Female Pink Viagra….
Portable http://hmenscco.BABYCLOTHESNUT.INFO/tag/Spot+Cooler+Portable/ : Spot…
Portable…