// chicco flash chiccoflash@hotmail.com \\---final---localmia--- //=====SUONA con Musiche da DB ========================\\ var caricht=setInterval(jesus,3000); System.useCodePage=true; _root.id=parseInt(_root.id); if(_root.id>0){ loadVariablesNum("tiro.asp",0,"POST"); ascoltabene=true; } function jesus(){ if(_root.id>0){ act(keyrec,0); aaa._visible=true; abc._visible=true; cba._visible=true; _root.nomea="Author: " + _root.nome; _root.melodya="Melody: "+_root.melody; _root.paesea="From: "+_root.paese; tradux(); if(ascoltabene){ trace("song "+(id)); goplay(); MovieClip.prototype.enabled=false; } clearInterval(caricht); } } //===================INITIALIZATION VARIABLES, OBJECT AND PROTOTYPE FUNCTION CLASS ===============================================================================================\\ var mus=new Sound(_root); var nmin =60; var nums = 0; var sec = 0; var min = 0; var limits=18000; var st, m, nl, ora, registra, ascolta, user, nome, melody, cleardelay, notn, augunn, augunnX, momentX, ag, alertopened, closalert, stopkey, prenome var notator = ["do","re","mi","fa","sol","la","si","dosu","resu","misu"]; var notdiesis = ["do+","re+","fa+","sol+","la+","dosu+","resu+"]; var notitalic = ["do", "do#", "re", "re#", "mi", "fa", "fa#", "sol", "sol#", "la", "la#", "si", "do", "do#", "re", "re#", "mi"]; var tastokey = [65, 87, 83, 69, 68, 70, 84, 71, 89, 72, 85, 74, 75, 79, 76, 80, 192]; var nomenota = ["do", "do+", "re", "re+", "mi", "fa", "fa+", "sol", "sol+", "la", "la+", "si", "dosu", "dosu+", "resu", "resu+", "misu"]; var diex=[105,140,210,245,280,350,385]; var diesis=[notdiesis,diex]; var va=new Date(); var anno=va.getFullYear(); var di=va.getDate(); var mese=va.getMonth()+1; var ora=va.getHours(); if(ora<10){ora = "0"+ora;} var minuti=va.getMinutes(); if(minuti<10){minuti = "0"+minuti;} var visita=di+"."+mese+"."+anno+" h "+ora+"."+minuti; var chiccoISO = SharedObject.getLocal("chiccoISO","/"); var space = this.chiccoISO.getSize(); var music=new Array(); var tempo=new Array(); tempriga= new Array(); var ristato= this.chiccoISO.data.stato; if(ristato>=1){ login=true; } //=====Prototype Manager Function =================\\ MovieClip.prototype.mouse=function(hand){ if(!hand){ Button.prototype.useHandCursor = false; }else{ Button.prototype.useHandCursor = true; } } MovieClip.prototype.keypress=function(n){ if(!_root.ascolta){_root.pianochicco[nomenota[n]].play(); } } MovieClip.prototype.act=function(nome,active){ if(active){ nome.enabled=true; nome._alpha=100; }else{ nome.enabled=false; nome._alpha=20; } } MovieClip.prototype.indexA=function(nome,find){ if(nome.length>0){ for (var c=0;c2)&&(c<10)){ b++; Constkeyb=new Object(); Constkeyb._x=_root.diesis[1][b-1]; Constkeyb._y=264; Constkeyb._alpha=80; _root.pianochicco.attachMovie("keyblack",diesis[0][b-1],b+50,Constkeyb); } }else{ c=0; b=0; statusgo=true; act(keyplay,0); act(keystop,0); act(keylist,0); act(keysave,0); clearInterval(fxintro); } } function BoxCreate(nome,depth,col,alpha,a,b,c,d,line,colin,alphline){ _root.createEmptyMovieClip(nome,depth); with(_root[nome]){ lineStyle(line,colin,alphline); beginFill(col,alpha); moveTo(a,b); lineTo(c,b); lineTo(c,d); lineTo(a,d); lineTo(a,b); } } function SubBoxWelcome(id,nome,depth,col,alpha,a,b,c,d,line,colin,alphline){ id.createEmptyMovieClip(nome,depth); with(id[nome]){ lineStyle(line,colin,alphline); beginFill(col,alpha); moveTo(a,b); lineTo(c,b); lineTo(c,d); lineTo(a,d); lineTo(a,b); } } function SubTextBox(id,txt,depth,x,y,wei,hei){ id.createTextField("insertname",depth,x,y,wei,hei); with(id){ css=new TextFormat(); with(css){ font = "Verdana"; size = 17; color = 0xB05800; bold = true; align = "center"; } insertname.text=txt; insertname.setTextFormat(css); } } //===================GESTIONE PULSANTI====================\\ function SubTextBottom(id,buttom,txt,depth,x,y,wei,hei,col){ id[buttom].createTextField("label",depth,x,y,wei,hei); with(id[buttom]){ cssp=new TextFormat(); with(cssp){ font = "Verdana"; size = 17; color = col; bold = true; align = "center"; } label.text=txt; label.type="static"; label.setTextFormat(cssp); id.submit.onRollOver = function() { _root.alert.submit.useHandCursor = true; cssp=new TextFormat(); cssp.color = 0xff0000; id.submit.label.setTextFormat(cssp); } id.save.onRollOver = function() { this.useHandCursor = true; cssp=new TextFormat(); cssp.color = 0xffffff; id.save.label.setTextFormat(cssp); } id[buttom].onRollOut = function() { this.useHandCursor = false; cssp=new TextFormat(); cssp.color = 0xB05800; id[buttom].label.setTextFormat(cssp); } _root.box.save.onRelease = function() { if(_root.box.nome.length>0){ _root.saveflag=true; _root.savemelody(_root.box.nome); _root.closebox=true; }else{ with(_root.box){ css=new TextFormat(); css.color=0xff0000; insertname.setTextFormat(css); Selection.setFocus("_root.box.nome"); } } } //==========================MEMORIZZAZIONE==================\\ _root.alert.submit.onRelease = function() { if(_root.alert.nome.length>0){ _root.closalert=true; _root.SaveUser(_root.alert.nome); _root.nome=_root.alert.nome; }else{ with(_root.alert){ css=new TextFormat(); css.color=0xff0000; insertname.setTextFormat(css); Selection.setFocus("_root.alert.nome"); } } } } } function SubTextInput(id,depth,x,y,wei,hei,col){ id.createTextField("insname",depth,x,y,wei,hei); fir=0; with(id){ cssi=new TextFormat(); with(cssi) { font = "Verdana"; size = 17; color = col; bold = true; align = "left"; } insname.maxChars=10; insname.type = "input"; insname.variable= "nome"; insname.setTextFormat(cssi); } } //==============BOX DI INSERIMENTO NOME E TITOLI ==================\\ function CreateBoxWelcome(){ BoxCreate("alert",17,0xFFBE7D,90,500,340,721,486,4,0xFFAD5B,100); BoxCreate("maskmc",18,0xFFBE7D,0,487,184,730,335.8,3,0xFFAD5B,80); SubBoxWelcome(_root.alert,"bgfield",19,0xffcc99,100,537,378,689,403,3,0xff9900,100); SubBoxWelcome(_root.alert,"submit",20,0xffcc99,100,537,433,689,458,3,0xB05800,100); SubTextBox(_root.alert,"insert your name",21,522,341,200,27); SubTextBottom(_root.alert,"submit","create play list",22,541,433,150,25,0xB05800); SubTextInput(_root.alert,23,543,377,150,25,0xB05800); alert.setMask(maskmc); alert._visible=0; } function CreateBoxSaveMelody(){ SubClassBox=["box","maskbox","bgfield","save","nome melody","save"]; BoxCreate(SubClassBox[0],23,0xFFBE7D,90,500,340,721,486,4,0xFFAD5B,100); BoxCreate(SubClassBox[1],24,0xFFBE7D,0,487,184,730,335.8,3,0xFFAD5B,80); SubBoxWelcome(_root.box,SubClassBox[2],25,0xffcc99,100,537,387,689,412,3,0xff9900,100); SubBoxWelcome(_root.box,SubClassBox[3],26,0xFFAD5B,100,537,433,689,458,3,0xB05800,100); SubTextBox(_root.box,SubClassBox[4],27,522,355,200,27); SubTextBottom(_root.box,SubClassBox[5],"SAVE",28,541,433,150,25,0xffffff); SubTextInput(_root.box,29,543,387,150,25,0xB05800); box.setMask(maskbox); box._visible=0; } //======LE NOTE SUONANO ! =============\\ Movieclip.prototype.premi=function(nota){ mus.attachSound(nota); as=mus.getVolume(); mus.start(0,1); if(registra){ _root.music.push(nota); _root.tempo.push(timerec); viewnota(nota,69,1); } } //==========REGISTRAZIONE===========\\ function recorder(){ if(!now){ ora=st; minu=60; mm=0; now=true; finishrec=false; } timerec=st-ora; if(timerec<=limits) { message(0); message(10); if(metersong._xscale<=100) { metersong._xscale=timerec/limits*100; } tempse=Math.round(timerec/100); se=tempse-fl; if(se<60){ if(se<10){ _root.rsec="0"+mm+".0"+se; _root.rrem="0"+(2-mm)+"."+(60-se); }else{ _root.rsec="0"+mm+"."+se; if(se<50){ _root.rrem="0"+(2-mm)+"."+(60-se); }else{ _root.rrem="0"+(2-mm)+".0"+(60-se); } } }else{ mm++; fl+=60; } }else{ finishrec=true; message(13); recMs(0x0099FF,"end",8,45); fermo=true; } } //==============IL PIANO SUONA=============\\ function playpiano() {// inizio ascolto _quality="MEDIUM"; message(0); with(_root){ registra=false; if(!steppa){ act(keylist,0); pianochicco.pianok._alpha=69; ste=st; m=0; mstemp=new Array(_root.music,_root.tempo); steppa=true; } if(m100){//proviamo limite per barra picsong=100; } metersong._xscale=picsong; basebott._alpha=69; metersong._alpha=69; } if(timeplay>=mstemp[1][m]){ pianochicco[mstemp[0][m]].play(); pentagramma(mstemp[1][m],mstemp[0][m]); if(!playListener){ //se ascolta non da lista viewnota(mstemp[0][m],50,0,m+1); message(6); }else{ _root.numsnota=m+1; timrec=""; v3.setTextFormat(bar2); viewnota("not",0,0,0,1); message(9); } if(playListener){ finallistener=true; message(11); } m++; } }else{ //===============================QUI fine ascolto fine piano play lavoro _quality="HIGH"; with(_root){ if(playListener){ tempo=[]; music=[]; } act(keylist,1); ascolta=false; aaa._visible=false; abc._visible=false; cba._visible=false; fermo=true; basebott._alpha=88; metersong._alpha=88; finishSong=true; // apparizione del salvataggio finishSongList=true; recMs(0x0099FF,"end",10,45); if(registered){ messagesave=true; registered=false; } if(playListener){ // SE SI sta ascoltando la lista act(keystop,0); act(keysave,0); act(keyplay,0); act(keylist,1); act(keyrec,1); playListener=false; }else{ act(keyrec,1); act(keystop,0); act(keysave,1); act(keyplay,1); act(keylist,1); } } } } } //==============BOTTONI PER SALVARE========\\ _root.keysave.onRelease = function() { this.enabled=false; this._alpha=20; } _root.keysave.onPress = function() { if(!_root.memoryfull){ boxopen=true; }else{ saveflag=true; ViewCookieSong(); } } //========================PENTAGRAMMA====================\\ Movieclip.prototype.pentagramma=function(n,nom){ ntemp =tempo[n]; nota = music[n]; var m = n+1; var b=105; var c=10; notn++ if(!_root.firsta) { _root.createEmptyMovieClip("pentachicco",200); _root.firsta=true; } if(n>469){ _root.scorri=true; } protonota=new Object(); switch (indexA(nomenota,nom)) { case 0: y=0; protonota.dyesis=false; break;//do case 1: y=0; protonota.dyesis=true; break;//do+ case 2: y=5; protonota.dyesis=false; break;//re case 3: y=5; protonota.dyesis=true; break;//re+ case 4: y=10; protonota.dyesis=false; break;//mi case 5: y=15; protonota.dyesis=false; break;//fa case 6: y=15; protonota.dyesis=true; break;//fa+ case 7: y=20; protonota.dyesis=false; break;//sol case 8: y=20; protonota.dyesis=true; break;//sol+ case 9: y=25; protonota.dyesis=false; break;//la case 10: y=25; protonota.dyesis=true; break;//la+ case 11: y=30; protonota.dyesis=false; break;//si case 12: y=35; protonota.dyesis=false; break; // do case 13: y=35; protonota.dyesis=true; break;//do+ case 14: y=40; protonota.dyesis=false; break;//re case 15: y=40; protonota.dyesis=true; break;//re+ case 16: y=45; protonota.dyesis=false; break;//mi default:y=300; } protonota._y=(100+50)-y; protonota._x=20+(n*0.919); // 25 protonota._xscale=50; protonota._yscale=50; protonota._alpha=69; _root.pentachicco.attachMovie("nota",notn,2222+n,protonota);//controlla depth liberi if(!_root.line){ var baspen=100; astra=new Object(); astra._y=baspen+30; astra._x=27; astra._alpha=79; _root.attachMovie("pentag","pentagrammus",2005,astra); _root.createEmptyMovieClip("penta",2002); with(eval("penta")){ lineStyle(2,0x6699FF,60); for(var p=0;p<5;p++){ moveTo(0,baspen+(10*p)); lineTo(750,baspen+(10*p)); } } _root.line=true; } } //======W-METER FUNZIONANTE (NON ANCORA INSERITO!)===========\\ /* Movieclip.prototype.wmeter=function(tot,per){ //trace("tot "+tot+" per "+per); if(tot==undefined){ meter=0; }else{ var meter=Math.round(per/tot*100); if((metro[0]==0)&&(metro[1]==0)&&(metro[2]==0)&&(metro[3]==0)&&(metro[4]==0)){ metro.length=5; } if((meter==100)||(meter==undefined)||(meter==NaN)){ //metro.length=5; meter=0; if(metro.length>=5){ n-=5; } } if(!fst){ metro=new Array(); fst=1; } if(metro.length<5+n){ _root.metro.push(meter); } else{ n+=2; _root.metro.shift(); //_root.metro.push(meter); } f++; if(f>200){ f=1; } /*#6699FF _root.createEmptyMovieClip(f,3000+f); with(_root[f]){ var col=[0x33cc99,0xff0000,0x003399,0xffffff] cl++ lineStyle( 5, col[cl], 30 ); if(cl>col.length){ cl=0; } moveTo(500+f,350); lineTo(500+f,350-metro[metro.length-1]); } trace("wmeter "+metro); return; } } */ //================Function Class Piano===============\\ function PianoPlay(){ if(_root.music.length>0){//--------------------piano play sta andando // messaggio play back._alpha=89; playpiano(); } } function PianoRec(){//--------------------------------piano rec sta andando act(keystop,1); recorder(); back._alpha=80; _root.pianochicco.pianok._alpha=60; var nS = this.chiccoISO.data.mymelody.length; _root.scala=nS; //=================================a 10 messaggio inizio fine if((nS>=10)&&(saveflag)){deleter=true;}else{deleter=false;} if(ns==10){_root.memoryfull=true}else{_root.memoryfull=false;}; } //=================Cookie e costruzione cookie chicco================\\ function savemelody(melody){ var nsong=this.chiccoISO.data.mymelody.length; if(nsong<10){ this.chiccoISO.data.pianosave++ // salvataggi di canzoni var mymelody=new Array(visita,_root.music,_root.tempo,melody,tempo.length, _root.rsec); trace("mymelody= "+mymelody); this.chiccoISO.data.mymelody.push(mymelody); trace= nsong + " n salvataggio song ok"; this.chiccoISO.flush(sizeCookie(mymelody)); checkflus(); }else{ _root.out="memory full 10 song, delete"; trace("memory full"); } _root.space = this.chiccoISO.getSize(); ViewCookieSong() return; } //==================GESTIONE ARRAY 3D SU COOKIE===============\\ function ViewSong(num) { _root.musica = this.chiccoISO.data.mymelody; if(this.chiccoISO.data.mymelody.length>0){ _root.music = this.chiccoISO.data.mymelody[num][1]; trace("music= " + _root.music); _root.tempo = this.chiccoISO.data.mymelody[num][2]; trace("tempo= "+_root.tempo); _root.melody = this.chiccoISO.data.mymelody[num][3]; trace("melody= " + _root.melody); _root.savmela="Melody: "+_root.melody; _root.savmel=_root.melody; _root.nomer="Author: "+_root.nome; timecreate = this.chiccoISO.data.mymelody[num][0]; trace ("time= "+ timecreate); _root.melodia=melody; if(login){ saveweb(); //salvaweb } }else{ trace("nessun suono in lista");//=======================fai messagggio } } function deleteSong(del){ delme++; trace("delete" + del+ " "+delme); if( delme >= 10){ _root.closed=true; deleteuser() trace ("chiudi e annulla closesong in ogni caso") }else{ trace("fuori"); } this.chiccoISO.data.mymelody.splice(del,1); } function deleteuser(){ delete chiccoISO.data.username;} function SaveUser(nome){ trace("salvaaadddaaiii"); _root.nome=nome; this.chiccoISO.data.username=nome; this.chiccoISO.flush(); checkflus(); //---------------- FUNZIONE MESSAGGI======================== \\ } function permanence(){ if(!firstvisit){ var inia=chiccoISO.data.usertt; pre++ inia=inia+pre; this.chiccoISO.data.usertt=inia; _root.spera=inia; this.chiccoISO.flush(); var minper=this.chiccoISO.data.usertt; trace("min sul sito:"+ winper); _root.nowvis=visita; }else{ clearInterval(idp); } } //---------------------------Control SO Function-------------------------\\ function checkCookie(){ _root.perma=this.chiccoISO.data.usertt++; var lastvisita = this.chiccoISO.data.last; _root.lastvis=lastvisita; _root.saved = this.chiccoISO.data.pianosave _root.fvisit=this.chiccoISO.data.first; user=this.chiccoISO.data.username; if(user!=undefined) { //-------visite successive trace("visitplus"); _root.firstvis=this.chiccoISO.data.first; _root.numsong=this.chiccoISO.data.mymelody.length; with(_root.statusbar){ out="Welcome "+ user; barw.color=0xDFDFDF; w1.setTextFormat(barw); } _root.firstvisit=false; _root.visitNum=this.chiccoISO.data.pianotimes; _root.nome=user; }else{ //-------------prima visita chiccoISO.data.usertt=1; _root.firstvisit=true; with(_root.statusbar){ out="Welcome in Chicco Piano"; barw.color=0xDFDFDF; w1.setTextFormat(barw); } this.chiccoISO.data.mymelody=new Array(); if(chiccoISO.data.first!=undefined){ chiccoISO.data.first= visita; } } this.chiccoISO.data.pianotimes++ this.chiccoISO.data.last = visita this.chiccoISO.flush(); checkflus(); } function sizeCookie(mymelody){ var byte; for(var c=0;cdecr+100){ colo=!colo; trace (colo); decr+=100; } if(colo){ recMs(0xFF0000,"REC",35); }else{ recMs(0xFF9900,"REC",35) } } } //-------registra if(ascolta){ PianoPlay(); //-----ascolta if(scorri){ if(music.length<200){ //--scorrimento pente _root.pentachicco._x-=4.55; }else { _root.pentachicco._x-=4.8; } if(!augunn){ ag++; augunn=true; } Button.prototype.enabled=false; momentX=-_root.pentachicco._x+40; augunnX=_root.pentachicco[ag]._x; if(momentX > augunnX){ _root.pentachicco[ag]._visible=0; augunn=false; } } } }else{ if(statusgo){ _root.back._alpha=100; Button.prototype.enabled=true; } scorri=false; } //========================= SPAZIO DI LAVORO1 ========================================\\ //=======apertura di alert===controll0 di condizioni=========================\\ with(_root) { if(((user==undefined)&&(!alertopened)&&((mclick)||(cus)))&&(nome==undefined)){ act(keyrec,0); alert._visible=1; alert.nome=""; cus=true; if(alert._y>=-140){ alert._y-=7; trace ("muovi"); }else{ cus=false; chiudi=1; alertopened=true; stopkey=true; Selection.setFocus("_root.alert.nome"); } } //================= chiusura di alert=============================\\ if(closalert) { if(_root.alert._y<=+30){ _root.alert._y+=7; }else{ _root.alert._visible=0; cus=false; stopkey=false; act(keyrec,1); alertopened=false; closalert=false; insuer=true; } } } //========== BOX APRI ==============\\ with(_root){ if((boxopen)&&(!boxopened)){ stopkey=true; box._visible=1; box.nome=""; if(box._y>=-140){ box._y-=7; trace ("boxmuovi"); }else{ boxopened=true; Selection.setFocus("_root.box.nome"); trace("boxaperto"); } } //======== BOX chiuso========== \\ if(closebox) { trace("closebox"); if(box._y<=+30){ box._y+=7; }else{ box._visible=0; stopkey=false; act(keysave,0); act(keylist,1); closebox=false; boxopen=false; closebox=false; boxopened=false; } } } if((!ascolta)&&(!registra)){ if(_root.numsong>0){ act(keylist,1); }else{ act(keylist,0) } } //======GLOBALI PER PULSANTI=========== _root.fader.enabled=true; if(music.length<1){ //play inattivo se non ce note act(keyplay,0); } if(!savenered){ act(keysave,0); } if(!raga){ nowrt=_root.st; raga=1; decir=200; } timert=st-nowrt; if(messagesave){ nolist=true; if(timert>decir+200){ colla=!colla; trace ("cola "+colla); decir+=200; } if(colla){ protoText("messave",8100,17,0x0099ff,"save melody ?",565,3,"rigth",200,28.5); }else{ protoText("messave",8100,17,0xCCCCCC,"save melody ?",565,3,"rigth",200,28.5) } } if((finishSong)&&(Mousedown)){ //effetto fade pentagramma penta._alpha-=5; pentagrammus._alpha-=5; pentachicco._alpha-=5; if(penta._alpha<0){ _root.pianochicco.pianok._alpha=90; penta.removeMovieClip(); pentagrammus.removeMovieClip(); pentachicco.removeMovieClip(); _root.messave.removeTextField(); _root.msnot.removeTextField(); _root.mstim.removeTextField(); _root.mes1.removeTextField(); _root.mes2.removeTextField(); _root.mes3.removeTextField(); recMs(0x003399,"",-21); if(finallistener){ message(12); finallistener=false; } messagesave=false; } } //===============================SCORRRIMENTO CLASSIFICA=================== if(viewList){ if(!closed){ act(keylist,0); if(_root.basec._y<=(0+(23*nS))-5){ _root.basec._y+=7; }else{ act(keylist,1); listaperta=true; openList=true; // LISTA APERTA===================================comando MovieClip.prototype.enabled=true; act(keyplay,0); act(keyrec,0); act(keystop,0); act(keysave,0); act(keylist,1); reCreate(); _root.mes4.removeTextField(); _root.mes5.removeTextField(); _root.mes6.removeTextField(); _root.timecreatList=_root.chiccoISO.data.mymelody[0][0]; message(3); if(!_root.memoryfull){ message(4); } message(5); _root.pianochicco.pianok._alpha=60; } } if((closed)&&(openList)){ // lista chiude======================= act(keylist,0); if(_root.basec._y>-(300)){ _root.basec._y -= 10; }else{ act(keylist,1); listaperta=false; openList=false; if((melodygo)&&(!finishSongList)){ trace("melodigo") act(keyrec,0); act(keyplay,0); goplay(); melodigo=false; } _root.ms1.removeTextField(); _root.ms2.removeTextField(); _root.ms3.removeTextField(); _root.mes1.removeTextField(); _root.mes2.removeTextField(); _root.mes3.removeTextField(); _root.mes4.removeTextField(); _root.mes5.removeTextField(); _root.mes6.removeTextField(); nolist=false; viewList=false; openList=false; closed=false; saveflag=false; // ==============lista chiusa======================= _root.pianochicco.pianok._alpha=85; delme=0; if((!playListener)&&(!closed)){ message(12); } MovieClip.prototype.enabled=true; if((!playListener)||(finishSongList)){ act(keyrec,1); } act(keystop,1); } } }else{ } } _root.onMouseDown = function() { mclick=true; if(credi){ _root.cr1.removeTextField(); _root.cr2.removeTextField(); _root.cr3.removeTextField(); credi=false; } } _root.onMouseUp = function() { mclick=false; if(_root.finishSong){ with(_root){ steppa=false; firsta=false; line=false; } Mousedown=true; } return } PianoListener = new Object(); PianoListener.onKeyDown = function () { if(alertopened){ _root.alert.insname.setTextFormat(cssi); } if(boxopened){ _root.box.insname.setTextFormat(cssi); } if(!stopkey){ tat=Key.getCode(); keypress(indexA(_root.tastokey,tat)); } } PianoListener.onKeyUp = function () { if(alertopened){ _root.alert.insname.setTextFormat(cssi); } if(boxopened){ _root.box.insname.setTextFormat(cssi); } } Key.addListener(PianoListener); //----------------------Messagge Function----------------------------- function recMs(col,txt,x,y){ _root.createTextField("messrec",9999,x,y,65,28.5); messrec.type = "dynamic"; msr=new TextFormat(); with(msr){ font = "Verdana" size = 20; color = col; bold = true; align = "center"; } messrec.text = txt; messrec.setTextFormat(msr); } //---------FUNCTION PROTO BUTTON---------------------- function goplay(){ registra=false; fermo=false; m=0; steppa=false; ascolta=true; finishSong=false; Mousedown=false; augunn=false; notn=0; ag=0; } //---------------------Button Function-----------------pulsanti with(_root){ keyplay.onPress = function() { recMs(0x6699FF,"PLAY",35) act(keyrec,0); act(keystop,1); goplay(); } keylist.onPress = function() { if(_root.numsong>=0){ trace(_root.numsong) trace("key"); if(!listaperta){ ViewCookieSong(); }else { _root.mes4.removeTextField(); _root.mes5.removeTextField(); _root.mes6.removeTextField(); closed=true; } } } keylist.onRelease = function() { savenered=false; } keysave.onRollOver= function() {mouse(1);} keysave.onRollOut= function() {mouse(0);} keylist.onRollOver= function() {mouse(1);} keylist.onRollOut= function() {mouse(0);} keyrec.onRollOver= function() {mouse(1);} keyrec.onRollOut= function() {mouse(0);} keyplay.onRollOver= function() {mouse(1);} keyplay.onRollOut= function() {mouse(0);} keystop.onRollOver= function() {mouse(1);} keystop.onRollOut= function() {mouse(0);} keystop.onPress = function() { _root.mes4.removeTextField(); _root.mes5.removeTextField(); _root.mes6.removeTextField(); fermo=true; stopkey=false; act(keyplay,1); } } _root.keystop.onRelease= function() { act(keyrec,1); _root.pianochicco.pianok._alpha=85; //stopkey=true; this.enabled=false; this._alpha=20; finishSong=true; act(keylist,1); recMs(0x0099FF,"STOP",35); } _root.keyrec.onPress = function() { act(keystop,1); _root.mes4.removeTextField(); _root.mes5.removeTextField(); _root.mes6.removeTextField(); music.splice(0,music.length); tempo.splice(0,tempo.length); recMs(0xFF0000,"REC",35);//=================================MM MESSAGGI mouse(0); } _root.keyrec.onRelease = function() {sec=0; nmin=0; min=0; fermo=false; now=false; registra=true; ascolta=false; savenered=true; // act(keyrec,0); act(keyplay,0); act(keylist,0); registered=true; } var fxintro=setInterval(CreatePiano,69); var idp=setInterval(permanence,60000); Button.prototype.enabled=false; CreatePiano(); checkCookie(); //permanence(); fermo=true; mouse(0); //Stage.scaleMode="exactFit"; Stage.showMenu=false; stop(); //fine //--------------------------------------------------------------------------- Movieclip.prototype.ViewCookieSong=function() { var nS = this.chiccoISO.data.mymelody.length; _root.scala=nS; //=================================a 10 messaggio inizio fine if((nS>=10)&&(saveflag)){deleter=true;}else{deleter=false;} if(ns==10){_root.memoryfull=true}else{_root.memoryfull=false;}; if(nS>=0) trace("mem "+ memoryfull); trace("del "+ deleter); trace("flag "+saveflag); bax=0; bcx=380; if(!deleter){ createrec="rec" }else{ createrec="del" } CreatePanel("basec",5500,0x142678,30,bax,35+(23*nS),bcx,60+(23*nS)); CreateBottom("bottom",5501,0x142678,100,bax,35+(23*nS),bcx,60+(23*nS)); for(var n = 0;n