Converting onClipEvent (enterFrame) to AS3 timeline code?
Hi, the following code was attached to a "control" movieclip in a nightmarishly old fla...I'm unsure of how to convert "onClipEvent" into AS3. The code is intended to listen for the space bar either being pressed down or released...I think I can get it going if I would understand how to replicate this "listening" behavior over the span of the half a dozen frames which the control movie clip spanned.
How can this onClipEvent code be changed to code on a timeline? Thanks...very, very appreciated.
// 32 is the space bar key code
onClipEvent (enterFrame) {
if (Key.isDown(32)) {
with (root.hot_mc) {
stopDrag();
}
global.mode = "hide_hotbox";
} else if (global.mode == "show_hotbox") {
root.hot_mc._x = 479;
root.hot_mc._y = 225;
play();
} else if (global.mode == "hide_hotbox") {
with (root.hot_mc) {
gotoAndStop("starthotbox");
}
} else {
with (root.hot_mc) {
gotoAndStop("starthotbox");
}
}
}