Good afternoon,
I'm working on a scene that allows users to select a county from a list then select a color from another list. My idea was to build an array for the counties then build a condition statement that matches the selected county and sets the color. It works when you set one county, but when you select another county it resets the first and colors the second. Therefore, counties will not hold the chosen color when selecting another county. Portion of the script I'm working on is below, and the scene is attached. Thank you for your help!
dim txtSelectCounty, txtCountyColor as xpTextObject
dim objCounty as xpQuadObject
dim arrCounty(4), arrColor(4) as string
dim x as integer
arrCounty(0) = "Appling"
arrCounty(1) = "Atkinson"
arrCounty(2) = "Bacon"
arrCounty(3) = "Baker"
x = 0
engine.DebugMessage("Selected County = " & txtSelectCounty.Text, 0)
'set counties
Do Until x > 3
engine.DebugMessage("County = " & arrCounty(x), 0)
arrColor(x) = "Gray"
If arrCounty(x) = txtSelectCounty.Text Then
arrColor(x) = txtCountyColor.Text
End If
engine.DebugMessage("County = " & arrCounty(x) & " Color = " & arrColor(x), 0)
Self.GetObjectByName(arrCounty(x), objCounty)
Self.Project.GetMaterialByName("GA_" & arrCounty(x) & "_" & arrColor(x) & "_Image", matCounty)
objCounty.SetMaterial(0, matCounty)
x = x + 1
Loop
------------------------------
John Robbins
Graham Media Group INC
------------------------------