A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] MovieClip Embedded Dynamic Text XML Import

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    5

    resolved [RESOLVED] MovieClip Embedded Dynamic Text XML Import

    Hello. I am working with a University to provide daily gas prices in the student commons. I have an XML file from which the price, station name, and station address are imported. The import worked fine when the dynamic textfields were in the root directory. However, there is only space for information on 5 stations at a time, with a total of 10 stations that need information.

    I so far have embedded the station name and address fields in nested MovieClips with matching instance names (i.e., First.FirstTEXT, Second.SecondTEXT, etc.). While the XML file still imports correctly, and the entire font used is embedded, only the numbers display (no spaces or alpha characters) in the Movieclip embedded textfields.

    XML Code Snippet:
    Code:
    <GAS>
      <PRICE STATION="Big Easy Tire and Lube" DOLLARS="3" TENS="5" ONES="4" ADDRESS="5000 Old Gentilly Road, New Orleans, LA (504) 920-1000">3.54</PRICE>
    </GAS>
    Flash Code Snippet:
    Code:
    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest("gasPrices.xml"));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void {
    	myXML = new XML(e.target.data);
    	for (var i:int = 0; i<myXML.*.length(); i++){
    		if(i==0){
    			Dollars1.text = myXML.PRICE[i].@DOLLARS;
    			Tens1.text = myXML.PRICE[i].@TENS;
    			Ones1.text = myXML.PRICE[i].@ONES;
    			First.FirstTEXT.station1.text = myXML.PRICE[i].@STATION;
    			First.FirstTEXT.address1.text = myXML.PRICE[i].@ADDRESS;
    		} ... etc.
    So this snippet of imported XML reads the price per galon, but the station name is overwritten as blank, and the address only displays the numerals 50005049201000 (even though uppercase, lowercase, numerals, & punctuation are embedded in the movie).

    Any help/suggestions are greatly appreciated.

    -Cliff

  2. #2
    Junior Member
    Join Date
    Nov 2001
    Posts
    5
    I had the dynamic textfields as Bold Arial, but after import they displayed Regular Arial. I just needed to change the embedded fonts.

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