|
서브메뉴에 들어갈 액션 num = 4; var i = 1; while (i<=num) { this["sub"+i].onRollOver = function() { _root.over = Number(this._parent._parent._name.charAt(4)); }; this["sub"+i].onRollOut = function() { _root.over = 0; }; i++; } ------------------------------------------------------------ 메인화면에 들어갈 액션 over = 0; location = [[115, 180, 245, 310, 360, 285], [105, 245, 295, 345, 360, 365], [105, 155, 295 ,345, 380, 355], [105, 155, 205, 345, 310, 355], [105, 155, 205, 255, 310, 355], [50, 95, 140, 185, 230, 355]]; num = 5; var i = 1; while (i<=num) { this["menu"+i]._x = 277; this["menu"+i].hit.useHandCursor = true; this["menu"+i].hit.onRollOver = function() { over = Number(this._parent._name.charAt(4)); }; this["menu"+i].hit.onRollOut = function() { over = 0; }; this["menu"+i].hit.onDragOut = function() { over = 0; }; this["menu"+i].onEnterFrame = function() { this._y = this._y+(location[over][this._name.charAt(4)-1]-this._y)/5; if (this._name.charAt(4) == over) { this.nextFrame(); } else { this.prevFrame(); } // end if }; i++ }