Groups | Blog | Home
all groups > flash actionscript > january 2005 >

flash actionscript : Setting MC Color Based on XML Data



David Stiller
1/20/2005 7:35:56 PM
[quoted text, click to view]

Bill,

What is the exact value your setColor value traces? Have you maybe
forgotten the 0x prefix?


David
stiller (at) quip (dot) net

BillG-Chicago
1/20/2005 10:55:34 PM
I'm having trouble setting a movie clip's color from the data as parsed from an
external XML file. This is my code inside the XML.onLoad function:

//retrieve the value from the XML file and assign it to setColor
setColor = this.firstChild.childNodes[1].childNodes[0]
//set the RGB for the movieclip
myColor_color = new Color(myClip_mc);
myColor_color.setRGB(setColor);

The XML file is being read in correctly and my variable setColor does trace
correctly, but the movie clip is shaded black when I test the movie. Any and
help help would be greatly appreciated.

Bill
Laiverd.COM
2/15/2005 9:19:16 AM
And don't forget: variables from xml tend to enter Flash as a string, while the value for a color should be a number; so you'd have
to do some conversion: color = Number(yourstring)

John

--
---------------------------------------------------------------------------------------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
---------------------------------------------------------------------------------------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
---------------------------------------------------------------------------------------

AddThis Social Bookmark Button