/*================================================================================== scr 系统的基础功能:tooltips, drawRectangle, reSize, setMusic ===================================================================================*/ var sys = new Object(); sys.depthManager = {screen_mc:0, ctrl_mc:1, win_mc:2, toolTips_mc:3, load_mc:10}; sys.stageWidth=stageWidth||Stage.width sys.stageHeight=stageHeight||Stage.height //sys.innerQC = _url.indexOf("qingcai.net")!=-1 sys.init = function() { this.screenMc = createEmptyMovieClip("screen_mc", this.depthManager["screen_mc"]); this.ctrlMc = attachMovie("ctrl_mc", "ctrl_mc", this.depthManager["ctrl_mc"]); this.toolTipsMc = ToolTips.getInstance(this.ctrlMc._parent, this.depthManager["toolTips_mc"]); //b_1_btn.onRollOver = function() { sys.toolTipsMc.drag("跟随鼠标,需要设定消失") }; //b_1_btn.onRollOut = function() { sys.toolTipsMc.hide() }; sys.ctrlMc.make_btn.dx = 450 - sys.ctrlMc.make_btn._x sys.ctrlMc.rank_btn.dx = 450 - sys.ctrlMc.rank_btn._x sys.ctrlMc.menu_mc.dx = 450 - sys.ctrlMc.menu_mc._x if(mode=="make"){ sys.ctrlMc.make_btn._visible=false sys.ctrlMc.rank_btn._visible=false sys.ctrlMc.menu_mc._visible=false } }; //排行榜窗口 //sys.createWin("rank") //sys.removeWin("rank") //type: rank, copy sys.createWin=function(type){ if(!type) type=this.winMcType this.winMcType=type this.createLoad() this.ctrlMc.pause_btn.onRelease() this.winMc = attachMovie("win_mc","win_mc", this.depthManager.win_mc); this.winMc.bg_btn.useHandCursor=false var tmc=win_mc.pane_mc tmc.gotoAndStop(type); tmc.bg_mc._width=sys.stageWidth-40 tmc.bg_mc._height=sys.stageHeight-44-40 tmc.bg_mc._x=tmc.bg_mc._width tmc.bg_mc._y=tmc.bg_mc._height tmc.content_mc.width=tmc.bg_mc._width-20 tmc.content_mc.height=tmc.bg_mc._height-40 tmc.separator_mc._width=tmc.content_mc.width+7 tmc.close_btn._x= tmc.content_mc._x+tmc.content_mc.width-1 tmc.mask_mc._width=tmc.content_mc.width tmc.mask_mc._height=tmc.content_mc.height tmc.content_mc.setMask(tmc.mask_mc) //B 处理 content_mc 布局 if(type=="rank"){ tmc.content_mc.item_mc.bg_mc._width = tmc.content_mc.width tmc.content_mc.item_mc.t_txt._width = tmc.content_mc.width-14 //滚动条 tmc.track_mc._x=tmc.content_mc._x+tmc.content_mc.width+1 tmc.track_mc._height=tmc.content_mc.height tmc.track_mc._alpha=40 tmc.bar_mc._x=tmc.track_mc._x }else if(type=="copy"){ var bmc=tmc.content_mc.copy_btns_mc bmc._x=Math.floor((tmc.content_mc.width-bmc._width)/2) bmc._y=Math.floor((tmc.content_mc.height-bmc._height)/2-11) } //E tmc.close_btn.onRelease=function(){ sys.removeWin() sys.ctrlMc.play_btn.onRelease() sys.tipHide() } tmc.close_btn.onRollOver=function(){ sys.tipShow("关闭窗口",this) } tmc.close_btn.onRollOut=function(){ sys.tipHide() } this.winMc.bg_btn._width=sys.stageWidth this.winMc.bg_btn._height=sys.stageHeight this.winMc.pane_mc._x = Math.floor((sys.stageWidth-this.pane_mc._width)/2) this.winMc.pane_mc._y = Math.floor((sys.stageHeight-44-this.pane_mc._height)/2) //B 处理 content_mc 内容 if(type=="rank"){ this.winMc.createList=function(dat){ var cmc=this.pane_mc.content_mc var len=dat.length for(var item,i=0;i'; System.setClipboard(s); bmc.gotoAndStop("html"); bmc.copy_ok_btn.onRelease=tmc.close_btn.onRelease } sys.removeLoad() } //E } //象征参数 sys.removeWin=function(){ if(this.winMc){this.winMc.removeMovieClip();delete this.winMc;} } sys.createLoad=function(){ this.loadMc = attachMovie("load_mc","load_mc", this.depthManager.load_mc); this.loadMc._y = Math.floor(scr.height/2) this.loadMc._x = Math.floor(scr.width/2) } sys.removeLoad=function(){ if(this.loadMc){this.loadMc.removeMovieClip()} } sys.setMusic = function(sndPath,lrcPath){ wcon.data["lrc"] = lrcPath wcon.data["music"] = sndPath sys.ctrlMc.stop_btn.onRelease() delete sys.ctrlMc.seekBarLoaded_mc.onEnterFrame sys.ctrlMc.seekBarLoaded_mc._width=1; sys.ctrlMc.seekBarPlayed_mc._width=1; sys.createLoad() lrc.load(wcon.data["lrc"], function () { var p=wcon.data["music"] if(p.substr(-4,4).toLowerCase()=='.mp3'){ mp3.load(p, scr.soundMc); }else if(!isNaN(p)){ wsc.getMusicURLById(p,scr.soundMc) }else{ //参数错误处理 } }); } //450x382 sys.reSize = function(){ sys.stageWidth=stageWidth||Stage.width sys.stageHeight=stageHeight||Stage.height var newScrHeight = sys.stageHeight-44 var newScrWidth = newScrHeight/3*4 if(this.screenMc.con_mc){ var s = newScrHeight/scr.height*100 this.screenMc._xscale = s this.screenMc._yscale = s this.screenMc._x = (sys.stageWidth - newScrWidth)/2 } if(this.winMc){ this.removeWin() this.createWin(); } sys.ctrlMc._y = newScrHeight -1; sys.ctrlMc.ctrlBg_mc._width =sys.stageWidth; //sys.ctrlMc.seekBar_mc._width = Math.ceil((scr.width-2)*(sys.ctrlMc.seekBar_mc._xscale/100)); sys.ctrlMc.seekBar_mc._width = Math.ceil(sys.stageWidth-2); sys.ctrlMc.make_btn._x = sys.stageWidth - sys.ctrlMc.make_btn.dx sys.ctrlMc.rank_btn._x = sys.stageWidth - sys.ctrlMc.rank_btn.dx sys.ctrlMc.menu_mc._x = sys.stageWidth - sys.ctrlMc.menu_mc.dx sys.ctrlMc.reSize() } sys.tipShow = function(str,target){ var p = { x:target._x + Math.floor(target._width/2), y:target._y } target._parent.localToGlobal(p) sys.toolTipsMc.show(str,p.x,p.y) } sys.tipHide = function(){ sys.toolTipsMc.hide() } sys.drawRectangle = function(target_mc, boxWidth, boxHeight, fillColor, fillAlpha) { with (target_mc) { beginFill(fillColor, fillAlpha); moveTo(0, 0); lineTo(boxWidth, 0); lineTo(boxWidth, boxHeight); lineTo(0, boxHeight); lineTo(0, 0); endFill(); } }; sys.scroll=function(target){ var contentTop = target._parent.track_mc._height-target._parent.content_mc._height; if(contentTop>=0){ target._visible=false target._parent.track_mc._visible=false }else{ var contentBottom = target._parent.content_mc._y; var trackTop = target._parent.track_mc._y //+3; var trackBottom = target._parent.track_mc._y+target._parent.track_mc._height-target._height //-3; var FRICTION = 0.192000; var RATIO = 0.150000; var ySpeed,newypos,oldypos target.mov(false); //target.useHandCursor = false; target.onRollOver=function(){ this.nextFrame() } target.onRollOut=function(){ this.prevFrame() } target.onPress = function() { target.startDrag(false, target._x, trackTop, target._x, trackBottom); target.onMouseMove = function() { target.mov(true); updateAfterEvent(); }; }; target.onRelease = target.onReleaseOutside=function () { this.prevFrame() delete target.onMouseMove; target.stopDrag(); target.mov(false); ySpeed = (newypos-oldypos)*RATIO; }; target.mov=function (dragging) { if (!dragging) { oldypos = target._y; newypos = oldypos+ySpeed; ySpeed = ySpeed*FRICTION; if (newypos>trackBottom || newypos