Les cuento el sgte codigo me muestra un Texto dinamico que es llamado desde este codigo:
Código:
El problema es el sgtefunction dateChange(component) { var _loc1 = _root; aboutWin_mc._visible = false; t_about_mc.gotoAndStop(1); gMonth = _loc1.comboBox1.getSelectedItem().data; gDay = _loc1.comboBox2.getValue(); gYear = _loc1.comboBox3.getValue(); mYear = gYear; if (gMonth == 2 && gDay == 29) { gDay = 28; } // end if if (gMonth <= 7) { if (gDay <= 25) { mYear = gYear - 1; } else if (gDay > 25 && gMonth <= 6) { mYear = gYear - 1; } // end if } // end else if match = searchArray(transYearArray, mYear); mYearTS = transYearArray[match + 1] + " " + transYearArray[match + 2]; if (gMonth == 1) { delta = gDay + 158; } else if (gMonth == 2) { delta = gDay + 189; } else if (gMonth == 3) { delta = gDay + 217; } else if (gMonth == 4) { if (gDay < 12) { delta = gDay + 248; } else { delta = gDay - 12; } // end else if } else if (gMonth == 5) { delta = gDay + 18; } else if (gMonth == 6) { delta = gDay + 49; } else if (gMonth == 7) { if (gDay < 26) { delta = gDay + 79; } else { delta = gDay - 26; } // end else if } else if (gMonth == 8) { delta = gDay + 5; } else if (gMonth == 9) { delta = gDay + 36; } else if (gMonth == 10) { delta = gDay + 66; } else if (gMonth == 11) { delta = gDay + 97; } else if (gMonth == 12) { delta = gDay + 127; } // end else if match = searchArray(tzolkinArray, mYearTS); kin = match + delta; if (kin > 260) { kin = kin - 260; } // end if finalTS = tzolkinArray[kin]; if (finalTS.indexOf(" ") == 2) { tone = finalTS.slice(0, 2); seal = finalTS.slice(3, finalTS.length); } else { tone = finalTS.slice(0, 1); seal = finalTS.slice(2, finalTS.length); } // end else if toneName = toneNameArray[tone]; if (seal == "Dragon" || seal == "Serpent" || seal == "Moon" || seal == "Skywalker" || seal == "Earth") { sealColor = "Rojo"; } else if (seal == "Wind" || seal == "Enlazador de Mundos" || seal == "Dog" || seal == "Wizard" || seal == "Mirror") { sealColor = "Blanco"; } else if (seal == "Noche" || seal == "Hand" || seal == "Monkey" || seal == "Eagle" || seal == "Storm") { sealColor = "Azul"; } else { sealColor = "Amarillo"; } // end else if glyph = sealColor + " " + toneName + " " + seal; glyph_mc.tone_mc.gotoAndStop(tone); sealNumber = match = searchArray(sealNameArray, seal); glyph_mc.seal_mc.gotoAndStop(sealNumber); } // End of the function function searchArray(array, item) { var _loc1 = item; thisArray = array; l = thisArray.length; for (match = 0; match < l; match++) { if (thisArray[match] == _loc1) { return (match); } // end if } // end of for } // End of the function currentDate = new Date(); currentDay = currentDate.getDate(); currentMonth = currentDate.getMonth(); currentYear = currentDate.getFullYear(); var tone; var glyph; var gYear; var mYear; var mYearTS; var kin; var delta; var maxYear = 2013; var minYear = 1850; var yearArray = new Array(); y = maxYear; j = 0; for (i = minYear; i <= maxYear; i++) { yearArray[j] = y; --y; ++j; } // end of for var toneArray = ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]; var toneNameArray = ["", "Magnetic", "Lunar", "Electric", "Self-Existing", "Overtone", "Rhythmic", "Resonant", "Galactic", "Solar", "Planetary", "Spectral", "Cristal", "Cosmic"]; var sealNameArray = ["", "Dragon", "Wind", "Night", "Seed", "Serpent", "Enlazador de Mundos", "Hand", "Star", "Moon", "Dog", "Monkey", "Human", "Skywalker", "Wizard", "Eagle", "Warrior", "Earth", "Mirror", "Storm", "Sun"]; var tzolkinArray = new Array(); tzolkinArray[0] = ""; t = 1; g = 1; trace ("/// 260 day - TZOLKIN ///"); for (k = 1; k <= 260; k++) { tzolkinArray[k] = toneArray[t] + " " + sealNameArray[g]; trace (tzolkinArray[k]); ++t; ++g; if (t > 13) { t = 1; } // end if if (g > 20) { g = 1; } // end if } // end of for var transYearArray = new Array(); t = 8; g = 4; y = maxYear; i = 0; while (y > 0) { transYearArray[i] = y; ++i; transYearArray[i] = toneArray[t]; ++i; transYearArray[i] = sealNameArray[g]; ++i; t = t - 1; g = g - 5; y = y - 1; if (t < 1) { t = 13; } // end if if (g < 4) { g = 19; } // end if } // end while globalStyleFormat.arrow = 16777215; globalStyleFormat.face = 39219; globalStyleFormat.scrollTrack = 26163; globalStyleFormat.background = 26112; globalStyleFormat.highlight = 52275; globalStyleFormat.highlight3D = 52224; globalStyleFormat.shadow = 13056; globalStyleFormat.textColor = 16777215; globalStyleFormat.textFont = "Arial"; button1.setSize(70); button1.setClickHandler("dateChange"); button1.setStyleProperty("textColor", 26112); globalStyleFormat.applyChanges(); _root.comboBox1.setSize(90); _root.comboBox1.setSelectedIndex(currentMonth); _root.comboBox2.setSize(40); _root.comboBox2.setSelectedIndex(currentDay - 1); _root.comboBox3.setSize(55); _root.comboBox3.setDataProvider(yearArray); _root.comboBox3.setSelectedIndex(currentYear - 2013 - (currentYear - 2013) * 2);
Por ejemplo por defecto viene el sgte resultado:
"Blanco Cristal Enlazador de Mundos", eso esta bien, pero mi problema es el orden, debido a que deberia decir "Enlazador de Mundos Cristal Blanco", como cambio el orden?
Para ver la aplicacion funcionando veanla desde aqui