So here we go. Iām kind of a stuck on creating AS2 component. Its my first one and I think thats probaply the reason im stuck in this stubid situation.
So lets move to the point. I have created Mouse listener which is working fine, only thing I just cant understand is how can I target to something inside of the listener when event is launched from it.
Heres a small example:
Class ..... extends MovieClip {
var changeMe:Number;
var theListener:Object = new Object();
function constructor(){
createMouseEvents();
}
function createMouseEvents() {
Mouse.addListener(theListener);
theListener.onRelease = function(){
// Here comes the problem
// For example im trying to give "changeMe" variable a new value
// but i cant target it.
changeMe = 10; // no luck
this._parent.changeMe = 10; // no luck
trace(this); // Equals to: [object Object] thats correct
trace(_parent); // Equals to: undefined
trace(this._parent) // Equals to: undefined
}
}
} // class ends
I hope I just havent missed anything cause im getting tired with this. I dont know are there other threads about this cause I cant get in my mind any search words for this.
Thanks in advance. Ill hope heres some AS hero (I know heres many). :pope:
And btw. love your tutorials. User them alot when I started with Flash and AS. :thumb2: