Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Collections



How do you create collections in a Class. I can create a class but what about storing the collections and accessing them for later use. e.g

some.prototype.AddItem(ID, STRING, WHATEVER) {

}

some.prototype.getItem(ID) {

}


myItem.AddItem(ID, STRING, WHATEVER);

some examples would much be appreciated. I'm sure others would like to know this technique.



Ultrashock Forums > Flash > ActionScript
Posted on: 2004-05-22


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

As3-collections
Pretty much just a collection of data structures. Right now there are implementations for stacks, queues, and trees. I am working on priority queues, graphs, some other trees, and still have other plans.

The idea has been simple. To define all of the collections, and how they relate. This comes in the form of the collection definitions: ICollection, IStack, IQueue, ITree... and others as they come.

I also have been working on implementations of these definitions. The two structures we deal with typically as actionscript developers are Arrays and DisplayObjectContainers, and so I decided to write wrappers for those structures.

You can check out the google project, I've been keeping it up to date. It's still early in development. If anyone is interested in working on a piece, feel free to checkout the source and add to it, then e-mail me whatever pieces you feel should be added.

The original posts are here: http://specialrelativity.org/blog/ca...3-collections/

Accessing Collections
I've created a subclass of the movieclip object and can create it dynamically based on a comma separated list.

I'm trying to write a function that will "find" all instances of this object and change thier properties.

Is there a way to scroll through the children of an object in FlashMx to get references to those children?

Flash Collections
Hi there what i owuld like to do is ceate flash collections

name:value
name2:vale2

similar to collection in cfml and hash tables in vb.net

is this possible or do i have to create multi dimensional arrays?

cheers

jamie

Typed Collections? (e.g. Dictionary<Foo, Bar>)
I'm looking for a solution that gives me collections (e.g. Dictionary and Array) with compile-time type safety without (much) performance loss. Is there a handy library I haven't stumbled across yet, or some elegant trick involving wrapping Dictionary in a class (i.e. foo[bar])?

It seems strange to me that AS3 would provide all this great compile-time type checking for individual variables -- but not collections.

If this is a dead horse, please throw me some search terms so I can find relevant threads.

Newbie: Collections In Actionscript 2
It seems there is only one kind of collection in activescript 2: array.
Also one can't make a typed array as in C++ or C#:


Code:
class Photo {
}

Photo[] Photos = new Photo[10]; // impossible with as2 isn't it?

One has to do:
var Photo1:Photo = new Photo("file1.jpg");
var Photo2:Photo = new Photo("file2.jpg");
var Photos:Array = Array( [ Photo1, Photo2 ])
As for me this is quite limiting, because one creates a class when one expect many instances of that class. It would be really great to have better collections such as typed arrays, hashtables and so forth. Or am I missing something?


Thanks

Newbie: Collections In Actionscript 2
It seems there is only one kind of collection in activescript 2: array.
Also one can't make a typed array as in C++ or C#:


Code:
class Photo {
}

Photo[] Photos = new Photo[10]; // impossible with as2 isn't it?

One has to do:
var Photo1:Photo = new Photo("file1.jpg");
var Photo2:Photo = new Photo("file2.jpg");
var Photos:Array = Array( [ Photo1, Photo2 ])
As for me this is quite limiting, because one creates a class when one expect many instances of that class. It would be really great to have better collections such as typed arrays, hashtables and so forth. Or am I missing something?


Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved