Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
jerodq #1
Changing XML displayed in a textfield
So my idea is to create a flash interactive that functions as vocabulary flash
cards for online language courses. I would create a flash shell to display the
vocab terms and definitions, which would be listed in an xml file. That way I
have my .swf shell that I can recycle for any course, and just plug in a new
xml file for a new class. I want it to have the foreign language term showing,
you hit a button and the English definition appears under it. Then you hit a
"next term" button and it loads the next term in the xml file.
I can get it to load and display the first term and definition, but I am
clueless about how to get it to progress to the next listed term using a
button. Here is my code and my cheesy xml:
Any help in figuring how to display the next term would be greatly appreciated.
//----section describing how to link to an external xml file----------
var testing_xml:XML;
var xmlReq:URLRequest = new URLRequest("testing.xml")
var xmlLoader:URLLoader = new URLLoader();
//--------end xml loading, plus the xmlLoaded function--------------------
var xml:XML;
var xmlList:XMLList;
function xmlLoaded(event:Event):void
{
testing_xml = new XML(xmlLoader.data);
lesson_txt.text = testing_xml.lesson1.@id;
term_txt.text = testing_xml.lesson1[0].term[0];
def_txt.text = testing_xml.lesson1[0].def[0];
/*xmlList = testing_xml.lesson1[0].children();
trace(xmlList);*/
}
xmlLoader.load(xmlReq);
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
now to the xml:
<?xml version="1.0" encoding="utf-8"?>
<vocab>
<lesson1 id="This is the vocab for lesson 1">
<term>word</term>
<def>my annoying agreement</def>
<term>your mom</term>
<def>my stupid response to stupidness</def>
<term>tiredness</term>
<def>my general state of existence</def>
<term>I speak German!</term>
<def>Güten Tag ßäboön fäce!</def>
</lesson1>
<lesson2 id="This is the vocab for lesson 2">
<term>craptastic</term>
<def>sarcastic utterance of aggravation</def>
<term>allergies</term>
<def>spring has sprung</def>
<term>video games</term>
<def>what keeps me from going postal</def>
</lesson2>
</vocab>
jerodq Guest
-
Changing text without changing frames.
I have a small flash movie that is basically a color chooser. Rather than changing the color of an item by putting the color in a frame I change... -
Textfield
hi friends i created one form in that i want when the form is loaded, cursor is stick in to the top position of the field. please help me. ... -
TextField.restrict
How to make the entry to accept only "+" sign. -
Textfield.html = true vs TextField.setTextFormat
H I need to use html textfield to control when the text must change the line (br tag). The problem is that I can't use setTextFormat if I use html... -
use a var as a textfield name
hi i have created a textfield called "text0". i would like to put text that is stored in a var into it: allText="bla bla";...



Reply With Quote

