Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to replace my nodes in my xml, from a inputTextField?
    primarykey
    data
    text
    <p>I have a inputTextField, and in my inputTextField in my GamePage class i want to be able to take the text that you should be able to write in the inputTextField, and replace the text from the inputTextField with my nodes in my xml-fil. In my Xml class above I want to have that code that converts the text from the inputTextField, ex. If i write "monkey" in my inputTextField, I want to replace {ANIMAL} node in my xml-fil with monkey.</p> <pre><code>package { import flash.display.MovieClip; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLLoader; import flash.net.URLRequest; import flash.text.TextField; import flash.text.TextFormat; import flash.xml.XMLDocument; import flash.xml.XMLNode; public class Xml extends Sprite { private var xmlText:TextField; private var xml:XML; private var textBox:TextField; public function Xml() { var xmlString:URLRequest = new URLRequest("tales.xml"); var xmlLoader:URLLoader = new URLLoader(xmlString); xmlLoader.addEventListener("complete", init); function init(event:Event):void { var xml:XML = XML(xmlLoader.data); var xmlText:TextField = new TextField(); addChild(xmlText); xmlText.width = 500; xmlText.height = 500; xmlText.x = 5; xmlText.y = 100; xmlText.text = xml.tale; XML.ignoreWhitespace = true; var format:TextFormat = new TextFormat(); format.color = 0x990000; format.size = 18; xmlText.setTextFormat(format); } } } } </code></pre> <p>This is my xml-fil (<a href="http://translate.google.com/#auto%7Cen%7CDet%20var%20en%20g%C3%A5ng%20en%20%7BDJUR%7D,%20som%20kom%20fr%C3%A5n%20%7BSTAD%7D.%20%7BDJUR%7D%20bodde%20i%20ett%20litet%20litet%20r%C3%B6tt%20julhus,%20precis%20som%20tomten%20g%C3%B6r.%20%7BSTAD%7D%20hade%20ocks%C3%A5%20sin%20jultomte,%20och%20han%20hette%20%7BNAMN%7D.%20%7BDJUR%7D%20och%20%7BNAMN%7D%20var%20n%C3%A4mligen%20b%C3%A4sta%20kompisar%20sen%20j%C3%A4ttel%C3%A4nge,%20och%20de%20bodde%20i%20samma%20lilla%20r%C3%B6da%20hus.%20" rel="nofollow">Google Translated from Swedish</a>):</p> <p>There was once a {ANIMAL} who came from {CITY}. {ANIMAL} lived in a small little red julhus, just like Santa does. {CITY} also had her Santa Claus, and his name {NAME}. {ANIMAL} and {NAME} was in fact best friends for ages ago, and they lived in the same little red house. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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