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():* {
return "hi";
}
var b:String = a(); //this is legal


H

On Sat, Aug 9, 2008 at 6:12 PM, Claus Wahlers <[EMAIL PROTECTED]> wrote:

> 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 Bucket();
>> }
>>
>> public function getAnotherThing():Object
>> {
>>  return new Bucket();
>> }
>>
>> then this will compile:
>>
>> var someVar:Bucket=getThing();  // Ignores type checking
>>
>> And this won't:
>>
>> var someVar:Bucket=getAnotherThing();   // Tries to assign Object to
>> Bucket. Compile-time error.
>>
>> (while this will - with a cast:
>>
>> var someVar:Bucket=getAnotherThing() as Bucket;
>>
>> )
>>
>> HTH,
>>   Ian
>>
>> On Fri, Aug 8, 2008 at 11:07 PM, Dave Segal <[EMAIL PROTECTED]> wrote:
>>
>>> What is the difference between typing an instance as "*" and typing it as
>>> "Object"?
>>>
>>
>
> ___
> 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


[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 runs great, but on Mac, there's a nasty nasty chug. It seems to get
better if I compile it on a Mac. And gets far better if I compile to a Mac
self executable.

We're trying to find out what's causing it, and thinking it may be the
animated sprites, although all they're doing is reassigning bitmapData. All
processing sprite sheets is done at initial setup.

So, is there anything people know about or have experienced?

The WIP is here: http://raws.adc.rmit.edu.au/~s3155488/

Thanks for the help in advance...

-- 
The Random Lines
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 Bucket();
}

public function getAnotherThing():Object
{
  return new Bucket();
}

then this will compile:

var someVar:Bucket=getThing();  // Ignores type checking

And this won't:

var someVar:Bucket=getAnotherThing();   // Tries to assign Object to
Bucket. Compile-time error.

(while this will - with a cast:

var someVar:Bucket=getAnotherThing() as Bucket;

)

HTH,
   Ian

On Fri, Aug 8, 2008 at 11:07 PM, Dave Segal <[EMAIL PROTECTED]> wrote:

What is the difference between typing an instance as "*" and typing it as
"Object"?



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


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 checking

And this won't:

var someVar:Bucket=getAnotherThing();   // Tries to assign Object to
Bucket. Compile-time error.

(while this will - with a cast:

var someVar:Bucket=getAnotherThing() as Bucket;

)

HTH,
   Ian

On Fri, Aug 8, 2008 at 11:07 PM, Dave Segal <[EMAIL PROTECTED]> wrote:
> What is the difference between typing an instance as "*" and typing it as
> "Object"?
>
> ___
> 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