hi everyone. i’ve been reading the kirupa tuts for a while now, but recently just signed up for the forum as well.
well, i’m getting into flash classes, and i’m working on my first project using self written classes. but i got a question about variables.
i’ve got a MC rad_container with the class Rad linked to it. By using class instances i can now send the variable from the MC to the class, and get it returned.
but i want to use the same variable in another MC ball_container with it’s own class Ball.
how do i do that exactly ?
here’s my class Rad
class Rad extends MovieClip {
public var ballKleur:String;
public var radKleur:String;
// constructor
public function Rad(radKleur:String) {
ballKleur = radKleur;
//trace (ballKleur);
}
public function get dezeKleur():String {
return ballKleur;
}
public function set dezeKleur(radKleur:String):Void {
ballKleur = radKleur;
}
}
and here’s the code i’m using in my MC rad
var myRad:Rad = new Rad("groen");
thanx!