dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Loading XML debug

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    17

    [F8] Loading XML debug

    Hi everyone,

    I'll include both the FLA and the XML files. I'm running into a problem where everything should run fine but the button I create on the fly is not filtering the <sub><item> portions of the XML.

    The kicker is that I have Dynamic Text Boxes displaying the variables fine.

    Here is a run through the code.

    //Loading the xml file

    menuXML = new XML ();
    menuXML.ignoreWhite = true;
    menuXML.load(_root.LoadSavedTemplateLST);


    menuXML.onLoad = function (success){

    if (success){
    numTPL = this.firstChild.childNodes.length; //XML Lenght
    for (i=0; i<numTPL+1; i++) {

    _root.TPLLIST["LoadingTPL"+i] = this.firstChild.childNodes[i];

    createEmptyMovieClip("thumbnail", i+2000);


    thumbnail.onRelease = function(){thumbnail.dynamic_txt.text = "Click, Click Click BOOOM";} // Creates the button.

    thumbnail.createTextField("dynamic_txt",1,10,-10,150,30);
    thumbnail.dynamic_txt.text = LoadingTPL1;
    //Populating Button Text.

    eric = "Yehaaaw!!!";


    }//for
    }
    }


    function showMovie(thisMovie){
    movieLoader.loadMovie(thisMovie);
    }
    Attached Files Attached Files

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    your file is in Flash 9 format

    it will help if you Save as .. Flash 8 - when posting as a [F8] question

  3. #3
    http://www.in3d.eu Kostas Zotos's Avatar
    Join Date
    Jul 2007
    Location
    Athens - Greece
    Posts
    408
    Hi,

    I agree with "a_modified_dog"..

    Anyway a slight modify AS code version is here:
    PHP Code:
    //Loading the xml file
    menuXML = new XML();
    menuXML.ignoreWhite true;

    _root.LoadSavedTemplateLST="list.xml"
    menuXML.load(_root.LoadSavedTemplateLST);

    var 
    TPLLIST = [];

    menuXML.onLoad = function(success) {
        if (
    success) {
            
    numTPL this.firstChild.childNodes.length//XML Lenght

            
    var TF=new TextFormat()
            
    TF.align="center"
            
            
    for (i=0i<numTPLi++) {
                
    _root.TPLLIST["LoadingTPL"+i] = this.firstChild.childNodes[i].firstChild.firstChild.nodeValue;
                
    eric "Yehaaaw!!!";

                var 
    Clip createEmptyMovieClip("thumbnail"+ii+2000); // Creates the button.
                
                
    Clip.createTextField("dynamic_txt"1101015030);
                
    with(Clip.dynamic_txt){
                     
    setNewTextFormat(TF
                     
    text TPLLIST["LoadingTPL"+i]; //Populating Button Text. 
                     
    border true;
                }              
                
                
    Clip._y i*(Clip.dynamic_txt._height+10);
                
                
    Clip.onRelease = function() {
                    
    this.dynamic_txt.text "Click, Click Click BOOOM";
                }
            } 
    // end of: for

        

    }


    function 
    showMovie(thisMovie){
        
    movieLoader.loadMovie(thisMovie);

    Creates (and layouts vertically) 3 different dynamically created "buttons" with the corresponding input XML text values as label..

    Kostas
    Last edited by Kostas Zotos; 05-16-2008 at 12:56 PM.
    K. Zotos online portfolio: http://www.in3d.eu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center