I need some advice on controlling Flash components through Lingo. I have both DirectorMX and FlashMX open at the same time, so I can look back and forth at Flash's Actionscript and then convert it to Lingo.
I working with the BarChart component trying to figure out the changing
of background and bar colors. I spent several hours learning how to pass
data to the BarChart (see code below). It took me quite a while to understand
how the setDataProvider concept worked and now I'm struggling to understand
how to set and change colors inside of movieClips. There is NO straight forward
Actionscript function associated with the FBarChart component that allows me to
change the colors.
I assume I need to create a new color object, but I can't figure out the syntax
to send a message to the correct movieClips inside the FBarChart component. If you
haven't guessed by now, I'm new to Flash and don't know my way around the
Flash metaphor.
The "Actions" and "Reference" panels, in FlashMX, for the FBarChart component
give me no clues or useful information.
Any Help/Code/Concepts would be appreciated.
Jerry
========= code I have working so far ================== on getURL me, stringFromFlash vLabelNames = ["AAA", "BBB", "CCC", "DDD"] vDataValues = [33, 99, 55, 66] tName = "electrical items"
case (stringFromFlash) of
"volts": tName2 = "Volts"
"amps": tName2 = "Amps"
"watts": tName2 = "Watts"
end case -- store a reference to the named bar chart component
chart = sprite(1).getvariable("gBarChart", false)
chart.setXAxisTitle(tName)
chart.setYAxisTitle(tName2)
chart.setChartTitle("Energy Efficency")-- create a Flash array and store data objects into the array
vArray = sprite(1).newObject("Array")
repeat with x = 1 to vLabelNames.count
vTempObject = 0
vTempObject = sprite(1).newObject("Object")
vTempObject.label = vLabelNames[x]
vTempObject.value = vDataValues[x]
vArray[x - 1] = vTempObject -- use "x - 1" cause Flash arrays start at 0
end repeat
-- apply the array data using the function setDataProvider() chart.setDataProvider(vArray) end
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
