Monthly Archives: April 2006

Declaring variable type

During FITC this past weekend, I saw a presenter showing code such as:

var x, y:Number;

This innocent looking line may seem like declaring two variables x & y as the Number data type. However, what it actually does is declaring variable x with an undefined data type, and y as a Number.

To test, try this:

x = "";

Test movie, all is fine. No error message.

Now add this line:

y = "";

Test movie, and you’ll see the error message:

‘Type mismatch in assignment statement: found String where Number is required. y = “”;’

So remember to declare variables as intended, such as:

var x:Number;
var y:Number;

Flash in the Can & visiting Toronto

Can’t believe it’s already the 5th year. I still remember speaking at the first festival when there was a snow storm outside.

As a public service (but mostly for Guy “Watson’s Water“): It’s not cold anymore! The weather is great (warm & sunny today), but it’s always wise to check the latest Toronto weather before departing.

I’ll be at the festival, and as one of the panelists at the Flash Lite mobile panel on Saturday at 4:00pm.

Here are some links for visitors to Toronto:

Or if you like nature and the great outdoors, check out the Muskoka lakes district, 2-3 hours drive north of the city.

And now, for something totally different: Uptown Chinese malls and restaurants for those who want to check out the latest imports and great food:

There are also lots of Chinese, Japanese and Asian restaurants and shops in Markham (north of the city) along Highway 7, from Bayview to Leslie, Woodbine, and Kennedy.

Looking forward to seeing many old friends and those whom I’ve only corresponded through email!