Re: [Flashcoders] Object vs *

2008-08-09 Thread H
String, Boolean, Number, int, uint are all Objects... var a:String = ""; trace(a is Object); //true var b:uint; trace(b is Object); //true I find * useful when I don't want to explicitly type cast: function a():Object { return "hi"; } var b:String = a(); //compile time error function a():*

[Flashcoders] Flash - cross-platform? really?

2008-08-09 Thread Ashim D'Silva
We've been developing a flash game over the last few weeks, and we're finding more and more that the flash player on PC and Mac run terrifyingly differently. In my previous experience, website I've built have run far better on my Mac than on other PCs, but this time its the opposite. The PC version

Re: [Flashcoders] Object vs *

2008-08-09 Thread Claus Wahlers
Also, mind this: var a:*; trace(a); // undefined var b:Object; trace(b); // null An Object can't be undefined. Cheers, Claus. Ian Thomas wrote: '*' means "discard type checking" 'Object' means 'treat it as type Object' If you have functions: public function getThing():* { return new Buc

Re: [Flashcoders] Object vs *

2008-08-09 Thread Ian Thomas
'*' means "discard type checking" 'Object' means 'treat it as type Object' If you have functions: public function getThing():* { return new Bucket(); } public function getAnotherThing():Object { return new Bucket(); } then this will compile: var someVar:Bucket=getThing(); // Ignores type