Guest User

Untitled

a guest
Apr 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. xml:
  2.  
  3. <bundle bundle_id="1">
  4. <question_type>0</question_type>
  5. <question id="1">Is Fred...?</question>
  6. <option id="1">Good</option>
  7. <option id="2">Bad</option>
  8. <option id="3">Ugly</option>
  9. </bundle>
  10.  
  11.  
  12.  
  13.  
  14.  
  15. private function rebuildQuestion(e:ResultEvent):void{
  16. DynamicTest.debug(e.result.toString());
  17.  
  18. // start rebuilding question
  19. var question_text:String = e.result.question
  20. var question_id:int = e.result.question.attribute('id');
  21.  
  22. trace("question_text: " + question_text);
  23. trace("question_id: " + question_id);
  24.  
  25. //and now answer options
  26.  
  27. for each (var element:XML in e.result){
  28. DynamicTest.debug("element: " + element);
  29.  
  30. if (element.child("option")){
  31. trace("option_text: " + element.child("option").text());
  32.  
  33. trace("option_id: " + element.child("option").attribute('id'));
  34. }
  35. }
  36.  
  37.  
  38. WHY is that giving me this in my console?
  39.  
  40. option_text: GoodBadUgly
  41. option_id: 123
Add Comment
Please, Sign In to add comment