*Originally posted by zerium *
**problem with some of their tuts is that they really aren’t using the Actionscript 2.0 model. Most of them don’t use strong datatyping…
ie to create a string variable would be:
var mystr:String = new String(); // empty string
they simply do this:
var mystr;
just something I noticed while I was doing some tuts on their site and reading others on the dev center at macromedia.com **
Yeah, but that’s one of the reasons why MX 2004 is good - you can use strictly typed variables when you want. It doesn’t require you to use them ( if you’re working in a large project, you probably should, but otherwise… )
actually its one of the reasons why it is bad (it lets you do it)… say you created a function and you are using AS 2.0 and there is a portion of that function that relies on a number and you pass it a string? If you are using the old model the string will get added to the number…
ie:
// this script executes and does not throw an error
var x = 5;
var y;
y = x+“this”;
trace(y);
// this script throws you an error saying that the types are incompatible
var a:Number = 5;
var b:Number;
b = a+“this”;
trace(b);