I said I'd give Flash a lash... again. I've used it quite a bit before, well the Flash part at least, I've never gone too deep into ActionScript. First thing to say about ActionScript 3.0 is: wow, they've made everything so much harder to implement! It's really begining to look like a proper programming language now. Event handling now looks a lot more like Java. With Actionscript 2.0 and below, adding an event handler to a button was as simple as selecting the button and adding:
on (release)
{
//do some stuff
}
You cant add actionscript to the object itself anymore, now you add it to a class. It needs its own event handler:
function eventResponse(event:MouseEvent):void
{
//do some stuff
}
myButton.addEventListener(MouseEvent.CLICK, eventResponse);
It certainly makes code recycling a lot easier, but I have to admit, I was a big fan of the simple event handling before.
Second thing I need to say is: What the hell is Flex and what has it done to Flash? Flex is for manley men, not those artsy fartsy n00bs who like drawing pictures in Flash. You want a circle in Flex, well then you just type the damn thing up, none of that drawing tool bollocks. But since I'm not a manly man, I'll stick to flash thanks :)
The initiallisation of variables is changed also. Now you need to give each variable a type e.g.
var someNumber:Number = 12.5;
var firstName:String = "George";
I have a bit of a dilemma on my hands. I want to learn the version 3.0, not to get left behind but I'm more interested in developing small flash applications for mobile devices, which at the moment can only handle ActionScript v 2.0. I think I'll stick with 3.0, since hacking some code together in 2.0 is easier if I ever needed to.
1 comment:
a couple of misconceptions here:
1) you don't have to declare datatypes for variable declarations. when you omit them the variable is considered untyped. you'll get a warning, but the code will run. if you want to disable the warning, uncheck File > Publish Settings > Flash > Settings > Strict Mode. That said, if you *do* provide type annotations, you'll get compiler errors, which will help you detect problems in your code before you even run it. Good stuff.
2) Flex Builder is intended for building applications. For longer programs (say 1000+ lines), Flex Builder's programming tools are indispensable. They keep the code maintainable, and speed up development and debugging immensely. If you are combining motion graphics with code, you should be fine with Flash (i.e., there's no need to worry about Flex Builder), but I still prefer to externalize all code, keep graphics in Flash, and program in Flex Builder.
colin
Post a Comment