Hi
So I was just sitting and fooling a bit around in flash, when I decided to change the colour of an object through and XML document, that ofcause contained the colourcode. So I made a little, very basic, action script, but it doesn’t seem to work. When I open the page, the object turns black, so the setRGB works, but because it can’t find any of the xml, flash writes 000000, and therefore it turns black. Well, that’s what I’m guessing.
The point is, it isn’t working, and I really don’t know why.
My AS looks like this:
[AS]/////////////////////////////////
// colour XML
/////////////////////////////////
var colourXML = new XML();
colourXML.ignoreWhite = true;
colourXML.load(“colour.xml”);
colourXML.onLoad = function(success) {
if (success) {
var colourCode = this.firstChild.firstChild.nodeValue;
colouring = new Color(_root.square);
colouring.setRGB("#"+colourCode);
}
};[/AS]And my XML looks like this:
<coloring>
<color>4FE337</color>
</coloring>
Any help would be much appreciated, thanks