Hello Everyone,
I have been asked to make some changes to an old Flash project which was originally authored in CS2 or 3 I’m not sure but I’m pretty sure I programmed it in CS3.
As soon as I’ve opened the files again and test the movie all of my TextFields are empty. I can trace the XML content and I can trace all the TextField properties except for “text” or “htmlText”.
I am creating all of the TextFields via ActionScript and then sizing, centering an trying to set the text via an XML document. I can see everything except for the actual text. The layer these Textfield are on is masked but I’ve removed the mask and it still doesn’t work, also the original that does work is masked so I don’t believe the is the issue.
Here is my actionscript for the TextFields, TextFormats and so on:
var myCSS:TextField.StyleSheet = new TextField.StyleSheet();
myCSS.setStyle("a:link", {color:'#402e00',textDecoration:'none',fontSize:'14'});
myCSS.setStyle("a:hover", {color:'#402e00',textDecoration:'underline'});
myCSS.setStyle(".bigger", {fontSize:'18'});
myCSS.setStyle(".title", {color:'#402e00',fontSize:'25'});
var welcomeCopy:TextFormat = new TextFormat("Georgia", 13, 0xEDF1F5, false, true, false, null, null, "left", 12, 8, 0, 3);
var testimonialCopy:TextFormat = new TextFormat("Georgia", 10, 0xEDF1F5, false, true, false, null, null, "left", 12, 8, 0, 3);
var biggerCopy:TextFormat = new TextFormat("Georgia", 18, 0xEDF1F5, false, true, false, null, null, "left", 12, 8, 0, 3);
//SECTION TITLES
var sectionTitles:Array = new Array("empty", "home", "about","services", "photoGallery", "testimonials", "pressX", "contact");
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if (success){
trace("Success!");
var homeText:String = my_xml.firstChild.firstChild.firstChild.nodeValue;
var aboutText = my_xml.firstChild.childNodes[1].firstChild.nodeValue;
var servicesText = my_xml.firstChild.childNodes[2].firstChild.nodeValue;
var photoGalleryText = my_xml.firstChild.childNodes[3].firstChild.nodeValue;
var testimonialsText = my_xml.firstChild.childNodes[4].firstChild.nodeValue;
var testimonialsText1:String = my_xml.firstChild.childNodes[5].firstChild.nodeValue;
var testimonialsText2 = my_xml.firstChild.childNodes[6].firstChild.nodeValue;
var testimonialsText3 = my_xml.firstChild.childNodes[7].firstChild.nodeValue;
var testimonialsText4 = my_xml.firstChild.childNodes[8].firstChild.nodeValue;
var pressXText = my_xml.firstChild.childNodes[9].firstChild.nodeValue;
var contactText = my_xml.firstChild.childNodes[10].firstChild.nodeValue;
_root.createTextField("testBox", 60, 0, 4, 315, 50);
_root.testBox.html = true;
_root.textBox.htmlText = _root.servicesText;
_root.textBox.background = true;
_root.textBox.backgroundColor = 0xA1AB1D;
//SECTION IMAGES + TEXT
for(i=1; i<=7; i++){
var imageYpos:Number = (i*513)-513;
_root.imageBox.largeStrip.createEmptyMovieClip("image"+i, i);
loadMovie("backgroundImages/"+sectionTitles[i]+".jpg", _root.imageBox.largeStrip["image" + i]);
_root.imageBox.largeStrip["image" + i]._y = imageYpos;
_root.imageBox.textPanels.createEmptyMovieClip("text"+i, i);
_root.imageBox.textPanels["text" + i]._y = imageYpos;
_root.imageBox.textPanels["text" + i].createTextField("textareaX", i+1, 0, 4, 315, 50);
_root.imageBox.textPanels["text" + i].textareaX.type = "dynamic";
_root.imageBox.textPanels["text" + i].textareaX.multiline = true;
_root.imageBox.textPanels["text" + i].textareaX.wordWrap = true;
_root.imageBox.textPanels["text" + i].textareaX.embedFonts = true;
_root.imageBox.textPanels["text" + i].textareaX.html = true;
_root.imageBox.textPanels["text" + i].textareaX.htmlText = _root[sectionTitles[i] + "Text"];
_root.imageBox.textPanels["text" + i].textareaX.textColor = 0xFFFFFF;
_root.imageBox.textPanels["text" + i].textareaX.background = true;
_root.imageBox.textPanels["text" + i].textareaX.backgroundColor = 0xA1AB1D;
_root.imageBox.textPanels["text" + i].textareaX.selectable = true;
//ENLARGE FIRST LINE in HOME TEXT or DON'T
if(i != 1){
_root.imageBox.textPanels["text" + i].textareaX.setTextFormat(welcomeCopy);
} else if(i == 1){
_root.imageBox.textPanels["text" + i].textareaX.setTextFormat(welcomeCopy);
}
/* _root.imageBox.textPanels["text" + i].textareaX.styleSheet = myCSS;
*/
_root.imageBox.textPanels["text" + i].textareaX._height = _root.imageBox.textPanels["text" + i].textareaX.textHeight+20;
_root.imageBox.textPanels["text" + i].textareaX._y = 256 -(_root.imageBox.textPanels["text" + i].textareaX.textHeight / 2);
_root.imageBox.textPanels["text" + i].createEmptyMovieClip("box", i);
_root.imageBox.textPanels["text" + i].box.beginFill(0xA1AB1D, 100);
_root.imageBox.textPanels["text" + i].box.moveTo(0,0);
_root.imageBox.textPanels["text" + i].box.lineTo(315,0);
_root.imageBox.textPanels["text" + i].box.lineTo(315,_root.imageBox.textPanels["text" + i].textareaX.textHeight+30);
_root.imageBox.textPanels["text" + i].box.lineTo(0,_root.imageBox.textPanels["text" + i].textareaX.textHeight+30);
_root.imageBox.textPanels["text" + i].box.lineTo(0,0);
_root.imageBox.textPanels["text" + i].box.endFill();
_root.imageBox.textPanels["text" + i].box._y = 241 -(_root.imageBox.textPanels["text" + i].textareaX.textHeight / 2)
// SERVICES GREEN PANEL
_root.imageBox.textPanels.text3.box._y = 0;
_root.imageBox.textPanels.text3.box._height = 513;
//TESTIMONIALS FLOATING BOX
if (i == 5){
_root.imageBox.textPanels.text5.createEmptyMovieClip("floatingBox", 3);
_root.imageBox.textPanels.text5.floatingBox._y = 256 - (250 / 2);
_root.imageBox.textPanels.text5.floatingBox._x = 405;
_root.imageBox.textPanels.text5.floatingBox.createEmptyMovieClip("bgBox", 1);
_root.imageBox.textPanels.text5.floatingBox.bgBox.beginFill(0xA1AB1D, 92);
_root.imageBox.textPanels.text5.floatingBox.bgBox.moveTo(0,0);
_root.imageBox.textPanels.text5.floatingBox.bgBox.lineTo(315,0);
_root.imageBox.textPanels.text5.floatingBox.bgBox.lineTo(315,270);
_root.imageBox.textPanels.text5.floatingBox.bgBox.lineTo(0,270);
_root.imageBox.textPanels.text5.floatingBox.bgBox.lineTo(0,0);
_root.imageBox.textPanels.text5.floatingBox.bgBox.endFill();
_root.imageBox.textPanels.text5.floatingBox.createTextField("floatQuote", 2, 4, 0, 295, 295);
_root.imageBox.textPanels.text5.floatingBox.floatQuote.multiline = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.wordWrap = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.html = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.htmlText = testimonialsText1;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.textColor = 0xFFFFFF;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.background = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.backgroundColor = 0x000000;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.selectable = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.embedFonts = true;
_root.imageBox.textPanels.text5.floatingBox.floatQuote.setTextFormat(_root.welcomeCopy);
_root.imageBox.textPanels.text5.floatingBox.floatQuote._height = _root.imageBox.textPanels.text5.floatingBox.floatQuote.textHeight+40;
_root.imageBox.textPanels.text5.floatingBox.floatQuote._y = 132-((_root.imageBox.textPanels.text5.floatingBox.floatQuote.textHeight)/2);
trace(_root.imageBox.textPanels.text5.floatingBox.floatQuote._height + " is here?");
}
}
}} //END XML LOAD
my_xml.load("content.xml");
I would appreciate any tips or help this is really bothering me I don’t understand why a newer version of Flash should affect this. I am exporting/saving for AS2 Flash Player 8 just like the original.
Thanks in advance.
*ian