Usually i am pretty good at working my way round as3 but this one is really giving me a headache
I have this code below and everything works fine i can trace the output but still the text is not showing up on stage any clues??
import flash.display.Sprite;
import flash.text.TextField;
import flash.display.MovieClip;
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
var total:XMLList;
var totalPram:XMLList;
var totalImgs:XMLList;
var totalX:XMLList;
var totalY:XMLList;
var totalInfo:XMLList;
var pram:XML;
var img:XML;
var playHead:Number=0;
var spacer:Number=20;
var xpos:Number=300;
var ypos:Number=100;
/////////////////////////////// formating ///////////////////////////////////
var newFormat:TextFormat = new TextFormat();// Text formating
newFormat.size=30;
newFormat.bold;
newFormat.font="Arial";
newFormat.color="0xCBFF00";
//newFormat.leading=-7;
////////////////////////////////////////////////////////////////////////////
xmlLoader.load(new URLRequest("info_1.xml"));
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
//var tagHolder:MovieClip = new MovieClip();
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
xmlData.ignoreWhite=true;
Parseinfo(xmlData);
}
function Parseinfo(Details:XML):void {
total=Details.blink;
totalPram=Details.blink.tag;
totalInfo=Details.blink.more;
totalImgs=Details.blink.img;
totalY=Details.totalY.ypos;
totalX=Details.totalX.xpos;
for (var i=0; i<=1; i++) {
//addChild(tagHolder);
pram=totalPram[i];
var labels:TextField=new TextField ;// txtfield for questions to be displayed
labels.setTextFormat(newFormat);
//mytxt2.autoSize=TextFieldAutoSize.LEFT;
labels.embedFonts=true;
labels.text=pram;
labels.x=xpos+spacer;
labels.y=ypos;
trace(labels.text);
addChild(labels);
}
}