Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You XML is set up just a tad wrong. In AS3 you need a root node. A root node is not accessible it's just kind of a wrapper. In your case Question is your root node which is not accessible, which will make those attributes not accessible also. So put a wrapper around your xml. I could be wrong about not being able to access the root node attributes however I am correct on your XML not being proper. And adding the wrapper just makes like easier.</p> <pre><code>&lt;questions&gt; &lt;question id='Q1' uId='99036' no_ans='2' txt='In a flat structure employees are not expected to provide their bosses with their opinions.' feedback='' type='MC' passingWeight='1' url='media/'&gt; &lt;answer id='Q1A1' uId='311288' txt='True' weight='0'/&gt; &lt;answer id='Q1A2' uId='311289' txt='False' weight='1'/&gt; &lt;/question&gt; &lt;question id='Q2' uId='99037' no_ans='2' txt='In a hierarchy, information typically flows downward.' feedback='' type='MC' passingWeight='1' url='media/'&gt; &lt;answer id='Q2A1' uId='311290' txt='True' weight='1'/&gt; &lt;answer id='Q2A2' uId='311291' txt='False' weight='0'/&gt; &lt;/question&gt; &lt;question id='Q3' uId='99038' no_ans='2' txt='Someone who keeps many projects going at one time is an example of someone who is flexible-time oriented.' feedback='' type='MC' passingWeight='1' url='media/'&gt; &lt;answer id='Q3A1' uId='311292' txt='True' weight='1'/&gt; &lt;answer id='Q3A2' uId='311293' txt='False' weight='0'/&gt; &lt;/question&gt; &lt;/questions&gt; </code></pre> <p>And then grab the attribute like so.</p> <pre><code>var questions:XMLList = new XMLList( e.target.data.question ) for each ( var question:XML in questions){ trace( question.@txt ) } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload