It depends on how you are using it.

Object is NOT the same as untyped.

Try this code:

var a:Array = new Array();
a.push('blah');
var s:String = a.shift();

Output panel displays:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Type mismatch in 
assignment statement: found Object where String is required.
     var s:String = a.shift();

The Array.shift method returns type Object (according to the intrinsic 
definition), so you have to leave s untyped, make it type Object, or cast 
the value as String, otherwise you can't compile.

Array.shift should be untyped, imho.

In AS3 you actually have * to indicate that the parameter/return is 
untyped.


Derek Vadneau

----- Original Message ----- 
From: "Ian Thomas" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Thursday, June 15, 2006 1:49 PM
Subject: Re: [Flashcoders] Accepting 1 parameter with 2 possible types 
inamethod?


Yes - but - why bother omitting it?

It's only a few characters you're saving - the word :Object. If later
down the line you decide to change compilers and go with MTASC (or
perhaps port your code to AS3) you'll have to trawl back through all
the code putting those missing type definitions back in...

Ian


_______________________________________________
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