Question
Reaching an MC from a class
Driving me crazy...
I wanna reach a Mc ALREADY MANUALLY ON STAGE (not addes with addChild) from a class. I can't.
the instance of the Mc on stage is 'McTestA'.
So, on my animation, I got :
var objet:ClasseTest;
objet = new ClasseTest(stage, McTestA);
as you see, I pass the 'stage' and the 'mc' as references to my class.
Here is the class :
package {
import flash.display.MovieClip;
import flash.display.Stage;
public class ClasseTest extends MovieClip {
public var refStage:Stage;
public var mc:MovieClip;
function ClasseTest(pRefStage:Stage, pMc:MovieClip) {
refStage=pRefStage;
mc=pMc;
refStage.mc.x=200;
}
}
}
AS error is : 'poperty undefined'.
CRAAAAZYYYYY !!!!!!
2 files here : http://tapiocadesign.com/AS3_question1.zip
I wanna reach a Mc ALREADY MANUALLY ON STAGE (not addes with addChild) from a class. I can't.
the instance of the Mc on stage is 'McTestA'.
So, on my animation, I got :
var objet:ClasseTest;
objet = new ClasseTest(stage, McTestA);
as you see, I pass the 'stage' and the 'mc' as references to my class.
Here is the class :
package {
import flash.display.MovieClip;
import flash.display.Stage;
public class ClasseTest extends MovieClip {
public var refStage:Stage;
public var mc:MovieClip;
function ClasseTest(pRefStage:Stage, pMc:MovieClip) {
refStage=pRefStage;
mc=pMc;
refStage.mc.x=200;
}
}
}
AS error is : 'poperty undefined'.
CRAAAAZYYYYY !!!!!!
2 files here : http://tapiocadesign.com/AS3_question1.zip