este codigo deberia de sustiruir al del segundo frame
Código :
_lockroot = true;
nanio=0;
dia_array = ["Lu", "Ma", "Mi", "Ju", "Vi", "Sa","Do"];
mes_array = ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"];
mesII_array = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"];
function init(pos_x, pos_y) {
f_date = new Date();
anioReal = anioActual=f_date.getYear();
nanio = anio = (f_date.getYear()+1900);
mesReal = mesActual=mes=f_date.getMonth();
mes_txt.text = mesII_array[mes]+" "+Number(anioActual+1900);
cuco_date = new Date();
diaReality = cuco_date.getDate();
//trace(diaReality);
dia = f_date.getDate();
diaName = f_date.getDay();
verMes((mesActual), anioActual);
}
function verMes(mesV, nanion) {
trace(mesV);
nanio = nanion;
for(nodani=250;nodani<300;nodani++) { _root["tempo"+nodani].removeMovieClip();};
big = makeSquare(this, 154, 119, 151, "0xFFF0B6", "");
big._y = pos_x;
big._x = pos_y;
for (var a in dia_array) {
clip = makeSquare(big, 22, 17, a, "0xF18501", dia_array[a]);
clip._x = a*22;
}
//trace(mes+" "+nanio );
f_date = new Date();
if (mesV == mesReal) {
dia = f_date.getDate();
diaName = f_date.getDay();
} else {
dia = null;
diaName = null;
};
f_date.setYear(nanio);
nanio = (f_date.getYear()+1900);
f_date.setMonth(mesV);
mes = f_date.getMonth();
//trace(mes);
mes_txt.text = mesII_array[mesV]+" "+Number(nanio+1900);
//trace(mes_txt.text);
mes_temp = (Number(mes)<10) ? "0"+(Number(mes+1)) : Number(mes+1);
creaDias();
}
function makeSquare(tmp_mc, ancho, largo, p, col, label) {
var tm_mc = tmp_mc.createEmptyMovieClip("tempo"+p, p);
tm_mc.beginFill(col);
tm_mc.lineStyle(1, 0xFFF0B6);
tm_mc.lineTo(0, 0);
tm_mc.lineTo(0+ancho, 0);
tm_mc.lineTo(0+ancho, 0+largo);
tm_mc.lineTo(0, 0+largo);
tm_mc.lineTo(0, 0);
format = new TextFormat();
format.font = "Verdana";
format.size = 10;
format.bold = true;
format.color = 0xFFFFFF;
tm_mc.createTextField("label_txt", p+100, 2, 0, 0, 0);
tm_mc.label_txt.selectable = false;
tm_mc.label_txt.html = true;
tm_mc.label_txt.text = label;
tm_mc.label_txt.autoSize = true;
tm_mc.label_txt.setTextFormat(format);
return tm_mc;
}
function creaDias() {
var d = 0;
var b = -1;
var c = 1;
var t_date = new Date();
var ya = false;
var prof = 250;
nanio += 1900;
for (var a = 1; a<=31; a++) {
//trace(nanio);
t_date = new Date(nanio,mes,a);
//trace(t_date.getYear()+" _ "+t_date.getMonth()+" _ "+dia_array[t_date.getDay()]+" _ "+a);
if (t_date.getMonth() == mes) {
if (!ya) {
t_dateb = new Date();
t_dateb.setYear(nanio, mes, 1);
ini = t_dateb.getDay();
c = (ini == 0) ? 0 : c;
b = ini-1;
ya = true;
}
d++;
hecho = 0;
prof++;// = _root.getNextHighestDepth();
for(kil=0;kil<dias_activos.length;kil++) {
//prof++;
//trace(prof);
amparo = new Array();
amparo[0] = dias_activos[kil].substring(6,8);
amparo[1] = dias_activos[kil].substring(4,6);
amparo[2] = dias_activos[kil].substring(0,4);
if(amparo[1]== (mes+1) && amparo[2]==(anioActual+1900)) {
dia = amparo[0];
} else {
dia=400};
if(t_date.getDate() == dia) {
dia_mc = makeBoton(prof, d,acciones[kil],dias_activos[kil]); hecho =1;
};
};
if(hecho==0){
if(diaReality==d && mesReal==t_date.getMonth() && anioReal==t_date.getYear()) {
dia_mc = makeSquare(big, 22, 17, prof, "0xFFBC66", d); } else {
dia_mc = makeSquare(big, 22, 17, prof, "0xFFDC50", d); };
};
t_dateb = new Date();
t_dateb.setYear(nanio, mes, a);
ini = t_dateb.getDay();
b = (ini == 0) ? 6 : --ini;
trace(ini+"_INI-A_"+a+"__"+(ini==0))
if(b==0) {
trace("HECHo"+(ini==0));
c++;
};
if(c==0) {c++;};
trace(b+"_BC_"+c)
dia_mc._x = b*22;
dia_mc._y = c*17;
}
}
}
ant_mc.onRelease = function() {
if (mesActual>0) {
verMes(--mesActual, anioActual);
} else {
mesActual = 11;
verMes(mesActual, --anioActual);
}
};
sig_mc.onRelease = function() {
if (mesActual<11) {
verMes(++mesActual, anioActual);
} else {
mesActual = 0;
verMes(mesActual, ++anioActual);
}
};
function makeBoton(p, label, accion,idb) {
var tm_mc = activo.duplicateMovieClip("tempo"+p,p);
format = new TextFormat();
format.font = "Verdana";
format.size = 10;
format.bold = true;
format.color = 0xBA8201;
tm_mc.createTextField("label_txt", p+100, 2, 0, 0, 0);
tm_mc.label_txt.selectable = false;
tm_mc.label_txt.html = true;
tm_mc.label_txt.text = label;
tm_mc.label_txt.autoSize = true;
tm_mc.label_txt.setTextFormat(format);
tm_mc.accion = accion;
tm_mc.bt.onRelease = function() { this.busca_lycos(idb);
};
return tm_mc;
}
init(0, 0);
stop();