Re: [Flashcoders] Array Limit
you should consider to use a linked list -- Pedro Taranto On Thu, Aug 4, 2011 at 4:26 AM, Kerry Thompson wrote: > Deepak Sahu wrote: > > > consider a vector..its faster than array. > > It is. There are a couple of essential differences you should know of. > Primarily, all the elements of the vector need to be of the same type. > I think it will work with objects. > > The other difference is that you can't have empty elements in a > vector. This is perfectly legal for an array: > > arr[0] = 0; > arr[1] = 1; > arr[100] = 100; > > You have 99 empty elements in that array--that is, there is nothing in > arr[2]...arr[99]. > > You can't do that with a vector. I think the compiler will throw an > error. If not, you'll get an error at runtime. > > Cordially, > > Kerry Thompson > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Array Limit
Deepak Sahu wrote: > consider a vector..its faster than array. It is. There are a couple of essential differences you should know of. Primarily, all the elements of the vector need to be of the same type. I think it will work with objects. The other difference is that you can't have empty elements in a vector. This is perfectly legal for an array: arr[0] = 0; arr[1] = 1; arr[100] = 100; You have 99 empty elements in that array--that is, there is nothing in arr[2]...arr[99]. You can't do that with a vector. I think the compiler will throw an error. If not, you'll get an error at runtime. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Array Limit
Dave Watts wrote: > If you want to reuse it, just redeclare it. If you want it to be > garbage-collected (you don't want to reuse it), things become a bit > more complicated I think. There's not a way of forcing garbage collection that I know of. You can make an array eligible for garbage collection by removing all references to it (e.g., myArray = null should do it). There are two ways of re-declaring it so you can use it over. myArray = []; will do it, as Dave mentioned. myArray = new Array(); will also do it. I believe that frees up the space used by your array, and it can be garbage collected. The Flash VM has its own ideas about when garbage collection happens, though--you can make something available for garbage collection, but, as I said, you can't force it. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Array Limit
consider a vector..its faster than array. On Wed, Aug 3, 2011 at 11:37 PM, Dave Watts wrote: > > And to get the last point var point = myarray[myarray.length -1] > > OK, I misread the question and didn't subtract 1 as a result. D'oh! > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > http://training.figleaf.com/ > > Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on > GSA Schedule, and provides the highest caliber vendor-authorized > instruction at our training centers, online, or onsite. > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders