Hi Jeff,
Sure you can, anything is possible! Well almost...
We only have to include an additional condition.
Below you'll find the amended code.
dim matRed as xpMaterial
dim matBlue as xpMaterial
dim matWhite as xpMaterial
dim quadSeat as xpBaseObject
dim txtObj as xpTextObject
dim i as integer
dim amountDemocrats as integer
dim amountRepublicans as integer
' LINK THE MATERIALS TO THE OBJECTS
Engine.getMaterialByName("White", matWhite)
Engine.getMaterialByName("Blue", matBlue)
Engine.getMaterialByName("Red", matRed)
' EXTRACT THE AMOUNT OF DEMOCRATS FROM THE TEXTOBJECT
Self.getObjectByName("txtDemocrats", txtObj)
amountDemocrats = cInt(txtObj.Text)
' EXTRACT THE AMOUNT OF REPUBLICANS FROM THE TEXTOBJECT
Self.getObjectByName("txtRepublicans", txtObj)
amountRepublicans = cInt(txtObj.Text)
' LOOP THROUGH ALL OF THE DOTS AND ASSIGN THE COLOUR
for i=1 to 100
Self.getObjectByName("seat" & i, quadSeat)
if i [SMALLER THEN]= amountDemocrats then ' CODE NOT DISPLAYING PROPERLY
quadSeat.setMaterial(0,matBlue)
else if i [BIGGER THEN] amountDemocrats And i [BIGGER THEN] (100 - amountRepublicans) then ' CODE NOT DISPLAYING PROPERLY
quadSeat.setMaterial(0,matRed)
else
quadSeat.setMaterial(0,matWhite)
end if
next
[EDIT]
Some of the code is not displaying properly on this forum. So you'll see two lines in the code above which have [SMALLER THEN] or [BIGGER THEN] in it. Replace those with the symbol equal to the text.
#XPression