(Putting aside whether or not this is best practice design, as I'm just trying to get my head around this.)

I've put three buttons in _root.questionInterface called button_1, button_2, etc. Elsewhere I have defined a class Question. When an instance of Question is displayed, it needs to modify the onRelease of the three buttons so that the Question gets notified when each button gets released.

Within the "Display" method of the Question, I want to do something like

for (var aNum=1; aNum<=5; aNum++) {

   var answerButton = _root.questionInterface["button_"+aNum];
   // pseudo code:
make the onRelease of answerButton make a call to the function AnswerSelected(aNum) inside of this
   //

   // I have tried the following, but it's not right
   answerButton.onRelease = function() { this.GiveAnswer(aNum);};

}


Any help greatly appreciated.  Thanks!


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to