>>>You can't change the type of a variable during an assignment

Yes you can.

var my_win:MovieClip;

my_win = MyCustomForm(PopUpManager.createPopUp(this, MyCustomForm, false));

----- Original Message ----- 
From: "Ian Thomas" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Monday, October 31, 2005 4:28 AM
Subject: Re: [Flashcoders] Strict Datatyping Question


Jester, that's not a bug. The two statements ' var <something>' and
'<something>=' are totally different things.

'var <whatever>' is a declaration. Which you can tack a handy assignment on
to the end of ( = something), because it's always good to initialise your
variables when you declare them. But the main purpose of the statement is to
declare the variable.

'myVar = <whatever>' is different - it's an assignment of a new value to a
variable which has already been declared. You can't change the type of a
variable during an assignment, so putting ':<something>' after the variable
name is meaningless.

HTH,
Ian

On 10/31/05, JesterXL <[EMAIL PROTECTED]> wrote:
>
> Finally, there is a bug in Flash MX 2004 & 8; you can't datatype like
> this:
>
> myVar:Number = 42;
>
> but you can do this:
>
> var myVar:Number = 42;
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to