Answered
Flash 8 scope question
In the following class can someone tell me how I would call
the doSomething() function from within
myObject.onMouseDown=function()?
class Practice extends MovieClip {
var myObject:Object;
//
public function Practice() {
myObject = new Object();
myObject.onMouseDown = function() {
// call doSomething here
doSomething();
};
Mouse.addListener(myObject);
}
//
public function doSomething() {
trace("did something");
}
}
class Practice extends MovieClip {
var myObject:Object;
//
public function Practice() {
myObject = new Object();
myObject.onMouseDown = function() {
// call doSomething here
doSomething();
};
Mouse.addListener(myObject);
}
//
public function doSomething() {
trace("did something");
}
}