var sc_play:Boolean = false; var stage_c:MovieClip = _root.stage; var sc_ch:MovieClip = this.createEmptyMovieClip("sc_ch",0); var total:Number; var barwid:Number = bar._width; var total_time:Number; var st_tmin:String; var st_tsec:String; var st_min:String; var st_sec:String; sc.onPress = function(){ if(!_root.jindo_bool) return; stopAllSounds(); sc_play = true; this.startDrag(false,0,0,barwid-0.1,0); control.gotoAndStop(2); } sc.onRelease = sc.onReleaseOutside = function(){ if(!_root.jindo_bool) return; sc_play = false; this.stopDrag(); stage_c.play(); control.gotoAndStop(1); } sc_ch.onEnterFrame = function(){ var cur:Number = stage_c._currentframe; bar_ing._width = (cur/total)*barwid; if(!sc_play){ sc._x = (cur*barwid)/total; }else{ var go_curr:Number = Math.floor((sc._x*total)/barwid); stage_c.gotoAndStop(go_curr); control.gotoAndStop(2); } } reload.onRelease = function(){ stage_c.gotoAndPlay(1); } function re_total_time(){ total = stage_c._totalframes; total_time = Math.floor(total/30); var tmin:Number = Math.floor(total_time/60); var tsec:Number = Math.floor(total_time%60); (tmin<10)?st_tmin = "0"+String(tmin):st_tmin = String(tmin); (tsec<10)?st_tsec = "0"+String(tsec):st_tsec = String(tsec); } this.onEnterFrame = function(){ tmin_mc.viewnum_fn(st_tmin);//시간을문자로 tsec_mc.viewnum_fn(st_tsec);//시간을문자로 sec_mc.viewnum_fn(st_sec); min_mc.viewnum_fn(st_min); if(_root.stage_c_load){ re_total_time(); _root.stage_c_load = false; } if(total>0 && _root.pageNum>0){//인트로가 아니고 페이지가 불러졌을때 % 계산 var pcntNum=(stage_c._currentframe/total)*100; if(!_root.jindo_bool && pcntNum>_root.pLimitNum){//진도 체크 퍼센트 이상 나갔을때 처리 _root.jindo_fn();//진도 나간 것 처리함수 } } var curtime:Number = Math.floor(stage_c._currentframe/30); var sec:Number = curtime; st_min = "00"; (sec < 10)?st_sec = "0" + String(sec):st_sec = String(sec); if(curtime >= 60){ var min:Number = int(curtime/60); sec = curtime%60; (min < 10)?st_min = "0"+String(min):st_min = String(min); (sec < 10)?st_sec = "0"+String(sec):st_sec = String(sec); } } function goPlay(mc:MovieClip,ch:String){ mc.onRelease = function(){ control.gotoAndPlay(2); (ch != "play")?_root.stage.play():_root.stage.stop(); } } sound_btn.onRelease = function() { // 클릭 var sndObj:Sound = new Sound(); sndObj.setVolume(curVolume); this._parent.vol._visible = !this._parent.vol._visible; curVolume = curVolume*0.50; curVolume = 13 + (50-curVolume); vol.vol_btn._y = curVolume; } vol.vol_btn.onPress = function() { this.startDrag(false, 14.6, 13.0, 14.6, 63.0); } vol.vol_btn.onRelease = vol.vol_btn.onReleaseOutside = function() { var sndObj:Sound = new Sound(); this.stopDrag(); this._parent._visible = 0; curVolume = vol.vol_btn._y; curVolume -= 13; curVolume = Math.abs(curVolume - 50)/50*100; sndObj.setVolume(curVolume); trace(curVolume); }