Hello !
I have a document with main class.
I also have some movieclips which have their own class and functions.
I am trying to pass a variable from my main class to one of these MovieClips.
I tried some stuff, nothing worked.
Who can help ?
I wasn't being very clear.
My problem exactly is that, I want to run a function of my MovieClip from my MainClass.
myMovieClip.DoYourFunction(withMyClassVariable)
and in the MovieClip's class :
public function DoYourFunction(WhatVariable:String) {
}
Again sorry for not being clear.
How can I do this scenario?
It gives me :
Property Match_Easy not found on ControlUnit and there is no default value.
ControlUnit is my main Class.
Match Easy is the movieClip which is on frame 4 of my timeline and it has it's AS Linkage as Match_Easy.
If I put an instane name for it I get this error:
Type was not found or was not a compile-time constant: Match_Easy.
What can I do. I'm frustrated.
Alright ...everything seems fine to me.
Here's the code in my Main Class :
public function BonusClicked(e:MouseEvent) {
trace(currentFrame);
MovieClip(root).Match_Easy.Hint(myBonus);
}
And the code in Match_Easy :
public function Hint(WhatKind:String) {
if (WhatKind == 'Time') {//Bonus ne kohe ...Hiqen disa sekonda.
gameTime += TimeBonus;
} else if (WhatKind == 'Score') {//Bonus ne pike ...Shtohen disa pike.
gameScore += pointsForMatch;
} else {//Bonus qe shfaq te gjithe letrat dhe me pas i kthen sic ishin.
HintTimer = new Timer(250,2);
HintTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hideCards);//Hiqe kete me nje lloj menyre !?
for (var i:uint = 0; i < BunchOfCards.length; i++) {
BunchOfCards[i].startFlip(BunchOfCards[i].cardface + 2);
}
function hideCards(e:MouseEvent):void {
for (var i:uint = 0; i < BunchOfCards.length; i++) {
BunchOfCards[i].startFlip(1);
}
}
HintTimer.start();
}
}
Methods are public, frame is 4 so movieclip exists.
North America
Europe, Middle East and Africa
Asia Pacific