How to assign a custom class to multiple kinds of movieclips
So on my stage and library, I have a movieclip for each state...named as STATE_AK, STATE_IA, STATE_NY, and so forth, inside the library...the clips are then placed on the stage
I've created a class called State.as, and have linked each of the state movieclips to this class.
How should I write the State class definition? So far, what I have is:
Code:
package{
import flash.display.MovieClip;
public class State extends MovieClip{
...
public function State(){
...
}
public function grow(){
this.scaleX = this.scaleY = 2.0;
}
}
}
I'm not sure how to write the class so that it takes the existing movieclip as *the* movieclip, if that makes sense...so that the function "grow" doubles the size of the state.
I get an error like this:
Quote:
TypeError: Error #1010: A term is undefined and has no properties.
at State/size()
at State$iinit()
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
at US_BETA_fla::STATES_US_1$iinit()
at flash.display::Sprite/flash.display:Sprite::constructChildren()
at flash.display::Sprite$iinit()
at flash.display::MovieClip$iinit()
at US_BETA_fla::MainTimeline$iinit()