Skip to main content
Participant
January 14, 2008
Question

Respond To Mouse Clicks In ActionScript

  • January 14, 2008
  • 1 reply
  • 137 views
Hi,

Can anyone help me with this actionscript coding I want to perform both operations, any ideas:

-------------------------------------------------------
Patient1.buttonMode = true;
Patient1.addEventListener(MouseEvent.CLICK,onClick);

function onClick(event:MouseEvent):void {
var Patient_correct:Patient_correct = new Patient_correct();
Patient_correct1.x = 560.8;
Patient_correct.y = 287.9;
addChild(Patient_correct);

---**I need to add a variable or code here for the both parts to work**-------


button1.buttonMode = true;
button1.addEventListener(MouseEvent.CLICK, onClick);

function onClick(event:MouseEvent):void {
var circle1:Circle = new Circle();
circle1.x = 617.5;
circle1.y = 224.9;
addChild(circle1);
}



Please help, thanks
This topic has been closed for replies.

1 reply

clbeech
Inspiring
January 14, 2008
if both of these codes (which are AS3 btw and should be posted in that forum) are within the same document, you should 'name' the two functions differently, they're both named 'onClick'. (don't forget to change this in the addEventListener as well.