hi i’ve got this code:
_root.done = "a";
var myListener = new Object();
myListener.onKeyDown = function() {
switch (Key.getCode()) {
case Key.LEFT :
trace(_root.done);
if(_root.done == "a"){
_root.done == "z";
back();
}
break;
case Key.RIGHT :
trace(_root.done);
if(_root.done == "a"){
_root.done == "z";
further();
}
break;
}
};
Key.addListener(myListener);
function further() {
trace(_root.done);
if ((content._y-312)>(0-content._height)) {
trace((content._y-312.1)+" -- "+(0-content._height));
targety = content._y-312;
content.onEnterFrame = function() {
disty = (targety-this._y);
this._y += disty/3;
if (disty>-0.1) {
this._y = Math.floor(this._y);
_root.done == "a";
delete this.onEnterFrame;
}
};
}
}
function back() {
trace(_root.done);
if ((content._y+0.1)<0) {
trace((content._y+0.1)+" --- "+(0-content._height));
targety = content._y+312;
content.onEnterFrame = function() {
disty = (targety-this._y);
this._y += disty/3;
if (disty<0.1) {
this._y = Math.ceil(this._y);
_root.done == "a";
delete this.onEnterFrame;
}
};
}
}
what i want is that when you press the left or right key the back or further function is only processed when _root.done = “a” (or true something else)… but now it doesn’t work… _root.done is always “a”… who can help me out?
thanks