Danny,
 The shortest way I found of doing it is:

var b:Array={arr:a}.arr;

i.e. make it a property of an object, then unbox it again.

Silly, but works syntactically. I'd love to see a shorter way.

In AS3, Array(x) as an array creator still exists - you get around it
using the new 'as' operator:

var b:Array=a as Array;

Ian


On 7/20/07, Danny Kodicek <[EMAIL PROTECTED]> wrote:
I'm trying to do something like this:

if (a instanceof Array) {
doMyArrayFunction(a)
}

the doMyArrayFunction expects an Array object, so this throws an error. What
I would normally do in this case is cast the object to the class I'm
expecting, but unfortunately Array(a) doesn't leave a unchanged, as it would
with most classes, but returns [a] - the array gets nested.

Anyone have a suggestion as to how I can get around this? The only thing I
can think of is Array(a)[0], which seems a bit stupid.

(I'm in AS2)

Danny

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to