A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [mx04] [f8]

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Planet Earth
    Posts
    298

    [mx04] [f8]

    This is just the beginning of my problem but...

    I have this xml
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <scenarios>
               <scenario name="Scenario1">
                          <!-- incorrect step has num value of 0, correct steps have num value = to their order -->
                         <step text="Remove the side cover." file="T_Rem_Cover.flv" num="1"/>
                         <step text=" Remove the Hard Disk Drive Mounting Bracket (with Hard Disk Drive intact)."  file="T_Rem_DriveCage.flv" num="2"/>
                         <step text="Disconnect all power supply cables from drives and system board." file="" num="3"/>
                         <step text="Remove the Power Switch." file="T_Rem_PowerSwitch.flv" num="0"/>
                         <step text="Remove the Power Supply." file="T_Rem_PowerSupply.flv" num="4"/>
                         <step text="Install a new Power Supply" file="T_Rep_03_PowerSupply.flv" num="5"/>
                         <step text="Replace the Power Switch." file="T_Rep_06_PowerSwitch.flv" num="0"/>
                         <step text="Reconnect all power supply cables." file="" num="6"/>
                         <step text="Replace the Hard Disk Drive mounting bracket." file="T_Rep_08_DriveCage.flv" num="7"/>
                         <step text="Replace the Side Cover." file="T_Rep_13_Cover.flv" num="8"/>
                         <step text="Reboot the system and verify the error has cleared." file="" num="9"/>
    
               </scenario>
               
               <scenario name="Scenario2">
                          <!-- incorrect step has num value of 0, correct steps have num value = to their order -->
                         <step text="Remove the side cover." file="T_Rem_Cover.flv" num="1"/>
                         <step text=" Remove the Hard Disk Drive Mounting Bracket (with Hard Disk Drive intact)."  file="T_Rem_DriveCage.flv" num="2"/>
                         <step text="Disconnect all power supply cables from drives and system board." file="" num="3"/>
                         <step text="Remove the Power Switch." file="T_Rem_PowerSwitch.flv" num="0"/>
                         <step text="Remove the Power Supply." file="T_Rem_PowerSupply.flv" num="4"/>
                         <step text="Install a new Power Supply" file="T_Rep_03_PowerSupply.flv" num="5"/>
                         <step text="Replace the Power Switch." file="T_Rep_06_PowerSwitch.flv" num="0"/>
                         <step text="Reconnect all power supply cables." file="" num="6"/>
                         <step text="Replace the Hard Disk Drive mounting bracket." file="T_Rep_08_DriveCage.flv" num="7"/>
                         <step text="Replace the Side Cover." file="T_Rep_13_Cover.flv" num="8"/>
                         <step text="Reboot the system and verify the error has cleared." file="" num="9"/>
    
               </scenario>
    
    
    
    
    
    </scenarios>
    It's valid but when i load it into my tree component, i get to folders (that should be labelled 'Scenario1' and 'Scenario2), but instead for it and all items i get

    [type function][type function]......

    Here's my load code
    Code:
    treeXML = new XML();
    treeXML.ignoreWhite = true;
    treeXML.onLoad = function(success){
    	trace("text loaded ok");
    	myTree.dataProvider = treeXML.firstChild;
    	
    }
    treeXML.load("scenarios.xml");
    Any ideas?
    ---
    Thinking outside of the box will get you fired if the "box" is strict budget.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    change your xml format, tree component expects - label
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <scenarios>
               <scenario label="Scenario1">
                          <!-- incorrect step has num value of 0, correct steps have num value = to their order -->
                         <step label="Remove the side cover." file="T_Rem_Cover.flv" num="1"/>
                         <step label=" Remove the Hard Disk Drive Mounting Bracket (with Hard Disk Drive intact)."  file="T_Rem_DriveCage.flv" num="2"/>
                         <step label="Disconnect all power supply cables from drives and system board." file="" num="3"/>
                         <step label="Remove the Power Switch." file="T_Rem_PowerSwitch.flv" num="0"/>
                         <step label="Remove the Power Supply." file="T_Rem_PowerSupply.flv" num="4"/>
                         <step label="Install a new Power Supply" file="T_Rep_03_PowerSupply.flv" num="5"/>
                         <step label="Replace the Power Switch." file="T_Rep_06_PowerSwitch.flv" num="0"/>
                         <step label="Reconnect all power supply cables." file="" num="6"/>
                         <step label="Replace the Hard Disk Drive mounting bracket." file="T_Rep_08_DriveCage.flv" num="7"/>
                         <step label="Replace the Side Cover." file="T_Rep_13_Cover.flv" num="8"/>
                         <step label="Reboot the system and verify the error has cleared." file="" num="9"/>
    
               </scenario>
               
               <scenario label="Scenario2">
                          <!-- incorrect step has num value of 0, correct steps have num value = to their order -->
                         <step label="Remove the side cover." file="T_Rem_Cover.flv" num="1"/>
                         <step label=" Remove the Hard Disk Drive Mounting Bracket (with Hard Disk Drive intact)."  file="T_Rem_DriveCage.flv" num="2"/>
                         <step label="Disconnect all power supply cables from drives and system board." file="" num="3"/>
                         <step label="Remove the Power Switch." file="T_Rem_PowerSwitch.flv" num="0"/>
                         <step label="Remove the Power Supply." file="T_Rem_PowerSupply.flv" num="4"/>
                         <step label="Install a new Power Supply" file="T_Rep_03_PowerSupply.flv" num="5"/>
                         <step label="Replace the Power Switch." file="T_Rep_06_PowerSwitch.flv" num="0"/>
                         <step label="Reconnect all power supply cables." file="" num="6"/>
                         <step label="Replace the Hard Disk Drive mounting bracket." file="T_Rep_08_DriveCage.flv" num="7"/>
                         <step label="Replace the Side Cover." file="T_Rep_13_Cover.flv" num="8"/>
                         <step label="Reboot the system and verify the error has cleared." file="" num="9"/>
    
               </scenario>
    
    </scenarios>
    Code:
    treeXML = new XML();
    treeXML.ignoreWhite = true;
    treeXML.onLoad = function(success){
    	trace("text loaded ok");
    	myTree.dataProvider = treeXML.firstChild;
    	
    }
    treeXML.load("scenarios.xml");
    
    var treeObj:Object = new Object();
    treeObj.change = function(){
    var itemSelected = myTree.selectedItem.attributes;
    trace("Item selected label: "+itemSelected.label);
    var Data = itemSelected.file; 
    trace("Item selected data: "+Data);
    var Num = itemSelected.num; 
    trace("Item selected num: "+Num);
    
    }
    myTree.addEventListener("change", treeObj);
    hth

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Location
    Planet Earth
    Posts
    298
    It's a miracle...the village idiot has been cured!!!!!

    (In Randy Jackson's voice): Thanks Dog!
    ---
    Thinking outside of the box will get you fired if the "box" is strict budget.

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