Clickin issue in Flash and XML

Posted by ortho on Stack Overflow See other posts from Stack Overflow or by ortho
Published on 2010-04-17T11:30:12Z Indexed on 2010/04/17 11:33 UTC
Read the original article Hit count: 336

Filed under:
|
|
|

Hi, I have the php backend that displays an xml page with data for flash consuming. Flash takes it and creates a textfields dynamicaly based on this information. I have a few items in menu on top and when I click one of them, data is taken from php and everything is displayed in scroll in flash. The problem is that if I click too fast between menu items, then I get buggy layout. The text (only the text) is becoming part of the layout and is displayed no metter what item in menu I am currently in and only refreshing the page helps.

var myXML:XML = new XML();

myXML.ignoreWhite=true;

myXML.load("/getBud1.php");

myXML.onLoad = function(success){

if (success){

var myNode = this.firstChild.childNodes;

var myTxt:Array = Array(0);

  for (var i:Number = 0; i<myNode.length; i++) {

      myTxt[i] = "text"+i+"content";

createTextField(myTxt[i],i+1,65,3.5,150, 20);

var pole = eval(myTxt[i]);

      pole.embedFonts = true;

      var styl:TextFormat = new TextFormat();

      styl.font = "ArialFont";

      pole.setNewTextFormat(styl);

      pole.text = String(myNode[i].childNodes[1].firstChild.nodeValue);

      pole.wordWrap = true;

        pole.autoSize = "left";

        if(i > 0) {

        var a:Number = eval(myTxt[i-1])._height + eval(myTxt[i-1])._y + 3;

        pole._y = a;
        } 
        attachMovie("kropka2", "test"+i+"th", i+1000);

        eval("test"+i+"th")._y = pole._y + 5;

        eval("test"+i+"th")._x = 52;

  } 

} }

I tried to load the info and ceate text fields from top frame and then refer to correct place by instance names string e.g. budData.dataHolder.holder.createTextField , but then when I change between items in menu the text dissapears completely untill I refresh the page.

Please help

© Stack Overflow or respective owner

Related posts about as2

Related posts about Xml