# Editing font properties with XML

**URL:** <https://forum.kirupa.com/t/editing-font-properties-with-xml/276628>\
**Category:** flash\
**Created:** [December 1, 2008, 9:16pm UTC](https://forum.kirupa.com/t/editing-font-properties-with-xml/276628 "2008-12-01T21:16:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pixelpixie](https://avatars.discourse-cdn.com/v4/letter/p/cdc98d/32.png) [@Pixelpixie](https://forum.kirupa.com/u/Pixelpixie)\
**Post date:** [December 1, 2008, 9:16pm UTC](https://forum.kirupa.com/t/editing-font-properties-with-xml/276628/1 "2008-12-01T21:16:24Z")

</div>

Hello all!

I’m having a major issue with a script I’m not familiar with (I came into a job, having to edit another designer’s code, so I have no clue what he did or hot to edit it)

So the thing i can’t figure out is how to edit the font attribures of this flash movie, I tried goihng in and editing the xml but that didn’t do anything. I’ll post the xml and actionscript. Please help! ☹ (note i’m not sure how to make a window thing for code so I’ll just copy paste it if that’s ok.

* * *

Actionscript

// Create a TextFormat object.

var item\_spacing = 16;  
var item\_count = 0;  
var plan1\_space = 0;  
var plan2\_space = 0;  
var speed:Number = 3;

function addDates(xml\_example) {

```
var plan = xml_example.firstChild.firstChild.childNodes;
var plan2 = xml_example.firstChild.lastChild.childNodes;
for (var i = 0; i&lt;plan.length; i++) {

    var date_mc = _root.attachMovie("date_item", "date"+item_count, item_count);

    date_mc._y = 70+(plan1_space*item_spacing);
    date_mc._x = -40;
    date_mc.onEnterFrame = function() {
        xtarget = 100;
        xdistance = xtarget-this._x;
        this._x+=xdistance/speed;
    };
    item_count++;
    plan1_space++;
    date_mc.date_txt.text = plan*.childNodes;

}
for (var i = 0; i&lt;plan2.length; i++) {

    var date_mc = _root.attachMovie("date_item", "date"+item_count, item_count);

    date_mc._y = 70+(plan2_space*item_spacing);
    date_mc._x = 564;
    date_mc.onEnterFrame = function() {
        xtarget = 270;
        xdistance = this._x-xtarget;
        this._x-=xdistance/speed;
    };
    item_count++;
    plan2_space++;
    date_mc.date_txt.text = plan2*.childNodes;

}

```

}

// manage XML  
// create new XML object instance, remembering to ignore white space  
var xml\_example = new XML();  
xml\_example.ignoreWhite = true;  
// define an onLoad to create our location menu when the XML has successfully loaded.  
xml\_example.onLoad = function(success) {  
if (success) {  
addDates(this);  
} else {  
trace(“Error loading XML file”);  
}// no success? trace error (wont be seen on web)  
};  
// load the xml file!  
xml\_example.load("xml\_example.xml

XML

\<?xml version=“1.0” encoding=“utf-8”?\>

\<!-- NO MORE THAN 6 DATES for either category. Any more, and there will have to be spacing changes in the FLA file–\>

\<!-- ALSO, you must modify the psd file (infobox\_template.psd) and its jpegs that appear if no flash is present.–\>  
\<schedule\>  
\<plan type=“Double”\>  
\<day\>February 5-6th\</day\>  
\<day\>April 16-17th\</day\>  
\<day\> June 25-26th\</day\>  
\<day\>August 21-22nd\</day\>  
\<day\>October 15-16th\</day\>  
\<day\>December 2-3rd\</day\>  
\</plan\>  
\<plan type=“Single”\>  
\<day\>February 27th\</day\>  
\<day\>\*March 27th\</day\>  
\<day\>\*May 8th\</day\>  
\<day\>July 10th\</day\>  
\<day\>November 6th\</day\>

```
&lt;/plan&gt;

```

\</schedul
