Classes in AS 2
- Started
- Last post
- 3 Responses
- ctrlRmB
I'm trying to learn how to use classes... and it's starting to make sense to me. The place where i get stuck is when i want to have a class that results in an nstance of a movieclip on the stage. How do i associate the graphics with the class? Can someone point me in the right direction... hopefully an online tutorial. Please don't suggest a book. I can't afford another flash book.
- instantok0
some things in here:
- caseyc0
You can make pretty much anything available to an AS2 class you just need to reference it first so it will play nicely with the compiler (since that is the only place where AS2 applies). So if you have an mc with a class attached to it and you want to use an mc inside of it you just need to declare it in the class file like
class MyClass extends MovieClip
{
var some_mc:MovieClip;
function MyClass()
{
some_mc._alpha = 50;
}
}
- unfittoprint0
http://www.amazon.com/exec/obido…
Moock's AS2 has a very good chapter on the 'exceptional' Movieclip class.Creating components may be a a bitch for newcomers, especially because Macromedia and Moock leave out important details that are essential for correctly compiling your class. Fortunately there's 'teh internets'.
http://www.person13.com/articles…Start playing with Event Listeners. Precious tool that will be essential for deploying more complex code in your Flash applications.
http://www.macromedia.com/devnet…