;

PDA

Click to See Complete Forum and Search --> : Variable Types


jhilgert00
09-06-2006, 04:53 PM
I got the following quote from the adobe site somewhere while i was reading about AS3
To help ease the transition to ActionScript 3.0, I've compiled the following list of tips and common issues you might encounter during development.

Declare types for all variables, parameters, and return values. Declaring a type for all variables, parameters, and return values is not required, but it is considered best practice. It will help the compiler give you more helpful error messages. It also aids runtime performance because the virtual machine will know the types you're working with ahead of time. In fact, it's so important that we've made it a warning by default.

Does this mean when you set a variable, you need to tell AS3 if it's a Number, Array, etc? Like this?

var i:Number = 0;

jhilgert

flashpipe1
09-06-2006, 05:17 PM
Yes...strict data typing...good stuff!!

senocular
09-06-2006, 06:12 PM
need to? No (finish the sentence you highlighted). Like that? yes.