1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
| var myXML:XML = new XML(); var x=10; m=0 ; b=15; l=0;s=20; z=15; l2=0;
myXML.ignoreWhite=true;
myXML.onLoad = function(sucess){
if (sucess) {test1._visible = false;
Create_Rect = function (nom, posx, posy, h, l, col) {
this.createEmptyMovieClip("new_rect", this.getNextHighestDepth());
new_rect.beginFill("0xEEEEEE"+col);
new_rect.moveTo(posx, posy);
new_rect.lineTo(posx+l, posy);
new_rect.lineTo(posx+l, posy+h);
new_rect.lineTo(posx, posy+h);
new_rect.lineTo(posx, posy);
new_rect.endFill();
new_rect._name = nom;
};
logo._visible =false;logo2._visible =false;jdid._visible =false;
/////////////////Numero table////////////
for (i=1; i<=161 ; i++){a1=this.firstChild.childNodes[i-1].childNodes[0].firstChild.nodeValue;
if(i<26){_root.createTextField("periode"+(i+1), i+200, x+8, b, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(i%5==0){b=b+40;x=10;}}
if(i==26){b=b+50;}
if((i>=26)&&(i<51)){_root.createTextField("periode"+(i+1), i+200, x+8, b, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(i%5==0){b=b+40;x=10;}}
if(i==51){x=240; b=10;}
if((i>=51)&&(i<81)){s=i-50; _root.createTextField("periode"+(i+1), i+200, x+8, b+5, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(s%6==0){b=b+40;x=240;}}
if(i==81){x=240; b=260;}
if((i>=81)&&(i<111)){s=i-50; _root.createTextField("periode"+(i+1), i+200, x+4, b+5, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(s%6==0){b=b+40;x=240;}}
if(i==111){x=510; b=10;}
if((i>=111)&&(i<136)){s=i-50; _root.createTextField("periode"+(i+1), i+200, x+4, b+5, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(s%5==0){b=b+40;x=510;}}
if(i==136){x=510; b=260;}
if((i>=136)&&(i<161)){s=i-50; _root.createTextField("periode"+(i+1), i+200, x+4, b+5, 30, 50); z=z+40; with (_root["periode"+(i+1)]) {text =a1 ;} x=x+40; if(s%5==0){b=b+40;x=510;}}
if (i%5==0) {z=z+60;} if (i%15==0) {s=s+40; l2=l2+1; if (i<99){z=20;}else{z=13;}} if (i%75==0) {s=s+60;} }
/////////////////Cadre////////////
x=10; u=40; b=10;
for (i=1; i<=161 ; i++){
etat1.text=etat= this.firstChild.childNodes[i-1].childNodes[1].firstChild.nodeValue;
if(i<26){ Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(i%5==0){b=b+40;x=10;}}
if(i==26){b=b+50;}
if((i>=26)&&(i<51)){ Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(i%5==0){b=b+40;x=10;}}
if(i==51){x=240; b=10;}
if((i>=51)&&(i<81)){s=i-50; Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(s%6==0){b=b+40;x=240;}}
if(i==81){x=240; b=260;}
if((i>=81)&&(i<111)){s=i-50; Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(s%6==0){b=b+40;x=240;}}
if(i==111){x=510; b=10;}
if((i>=111)&&(i<136)){s=i-50; Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(s%5==0){b=b+40;x=510;}}
if(i==136){x=510; b=260;}
if((i>=136)&&(i<161)){s=i-50; Create_Rect("monclip"+i, x, b, 30, 30, 000000); x=x+40; if(s%5==0){b=b+40;x=510;}}
if (etat=="0"){newcolor = new Color("monclip"+i);newcolor.setRGB(0x55be47);}else {newcolor = new Color("monclip"+i);newcolor.setRGB(0xff9081);}
_root["monclip"+i]._alpha=50;
this["monclip"+i].indice = i;
_root["monclip"+i].onPress = function () {trace(i)
}}
}}
myXML.load("sample.xml"); |
Partager