Blitz3000
03-14-2010, 04:16 AM
I know I'm a newb but here are the question:
1. Are custom base classes the way to go on movie clip symbols and is this standard practice when building Flash projects?
2. Can I still eventually make the base classes abstract enough to be reusable?
My questions above are regarding the difference between using a base class on a movie clip symbol or to add it via the document class and handling it elsewhere. The AS code and names i've used below are purely for the purpose of explaining the question. I've built a bunch of these simple menu/content presentations and am now wondering about the best practices of this task.
Previous to these questions I would normally make a movie clip and use the document class to add it, and then I'd manipulate it with another class. I would only ever use the Flash default MovieClip base class on the movie symbols in the library.
I recently built a simple AS3 Flash presentation with a menu and content like normal. After reading a forum thread I decided to build this one differently. I made two movie clips, 'menuMc' and 'contentMc' in the library as per usual, and linked a base class matching the names to each of them in linkage properties. I also added 'MainClass.as' as the document class in the fla properties. I then did something like this in the doc class:
import as.MenuMc;
import as.ContentMc;
private var _menuMc:MenuMc = new MenuMc();
private var _contentMc:ContentMc = new ContentMc();
addChild(_menuMc);
addChild(_contentMc);
This seemed to work a treat. In fact it was much easier to handle and I found I could even dispatch events from the movie clips timeline to it's base class.. very handy.. which left me with two questions. Are custom base classes the way to go on clips like these and is this standard practice when building Flash projects? and,can I still eventually make the base classes abstract enough to be reusable?
thank you if you read this far ;)
1. Are custom base classes the way to go on movie clip symbols and is this standard practice when building Flash projects?
2. Can I still eventually make the base classes abstract enough to be reusable?
My questions above are regarding the difference between using a base class on a movie clip symbol or to add it via the document class and handling it elsewhere. The AS code and names i've used below are purely for the purpose of explaining the question. I've built a bunch of these simple menu/content presentations and am now wondering about the best practices of this task.
Previous to these questions I would normally make a movie clip and use the document class to add it, and then I'd manipulate it with another class. I would only ever use the Flash default MovieClip base class on the movie symbols in the library.
I recently built a simple AS3 Flash presentation with a menu and content like normal. After reading a forum thread I decided to build this one differently. I made two movie clips, 'menuMc' and 'contentMc' in the library as per usual, and linked a base class matching the names to each of them in linkage properties. I also added 'MainClass.as' as the document class in the fla properties. I then did something like this in the doc class:
import as.MenuMc;
import as.ContentMc;
private var _menuMc:MenuMc = new MenuMc();
private var _contentMc:ContentMc = new ContentMc();
addChild(_menuMc);
addChild(_contentMc);
This seemed to work a treat. In fact it was much easier to handle and I found I could even dispatch events from the movie clips timeline to it's base class.. very handy.. which left me with two questions. Are custom base classes the way to go on clips like these and is this standard practice when building Flash projects? and,can I still eventually make the base classes abstract enough to be reusable?
thank you if you read this far ;)