 
 
Moving From Flash AS2 To Flash AS3: Static vs. Const
Constants come in very handy, mostly for code maintenance. A very simple example would be constant used in game for friction. Let's say that all on-screen objects will degrade their speed .02 pixels per frame because of friction on the ground. Since there may be be dozens of places that you might apply this value for friction, you would have to hard-code .02 . This is great, unless you want to change the value and have it apply globally in your class. In that case, it is easier to create a const and use it in your code. The problem with AS2 was that there was no support for constants. They are available in AS3 though, and we will explore their use in this tutorial.
Views: 764 |  |  by Isac
  |  by Isac 
 
View this tutorial

Most popular (last 7 days)
 Ciara forum signature
Ciara forum signature Water in Cinema 4D
Water in Cinema 4D Hologram
Hologram Create a computer case model
Create a computer case model Star Wars Hailfire Droid
Star Wars Hailfire Droid
Highest rated (last 7 days)
 Glassy Orbs
Glassy Orbs Shocking Text
Shocking Text Flash MX. Part II. Making Nice Glowing Effect and learning basic Flash techniques and ActionScript.
Flash MX. Part II. Making Nice Glowing Effect and learning basic Flash techniques and ActionScript. PoseMixer Basic Use Tutorial
PoseMixer Basic Use Tutorial Muscle deformations and Facial Expressions
Muscle deformations and Facial Expressions
