Hi All,
I was wondering what’s the difference between doing
public var arrayVar:ArrayCollection
type 1
arrayVar = new ArrayCollection(event.result as Array)
type 2
arrayVar = event.result as ArrayCollection
However type 2 seems to work, but more people seem to reference type 1
Thanks for any help
I code in VB, and i sorta understand c# for the most part, so take my post with a grain of salt =)
but it would appear as if “Type 1” is creating a new array and filling it with the data in theevent.results object and “Type 2” is casting the event.result object into the variable “arrayVar”
If I’m right, then in simple terms…
In “Type 1” you are creating a new ArrayCollection using an existing array object, which you plan on reading/writing to while preserving the original event.results object
Whereas, in “Type 2” you are casting event.results into variable “arrayVar” which if you modify, you’ll be modifying the original event.results object as well.
I could be wrong, but that’s my interpretation =)