Hello!
I'm trying to create a page that changes the colour of two text fields based upon the information of one. I've tried two different ways of approaching this - change the material and change the font with a material on the font. Both ways will work locally but neither seem to update through an iNews MOS controller. It will update the information but not the colour. There are five sets of pairs on the page to do the same thing so it also loops. I have tried to do just one set to start but it makes all of the same results - works locally, doesn't work in iNews MOS.
When I bring it into the remote sequencer, it displays the same as iNews. I bring it locally and it works.
One more piece to the puzzle is the text that I would like to compare is a font I created with pictures so I need to copy the text to a hidden field to use as the comparison.
This script is on OnOnline and OnPreviewRender.
Does anyone have any suggestions? Thank you!!!
dim card(5) as xptextobject
dim num(5) as xptextobject
dim suit(5) as xptextobject
dim material(5) as xpMaterial
dim i as integer
for i = 1 to 5
self.getobjectbyname("Card" & i, card(i))
self.getobjectbyname("Number" & i, num(i))
self.getobjectbyname("Suit" & i, suit(i))
'dim suits as string = card(i).text
dim suits as string
suits = card(i).text
suit(i).text = suits
'copying the information of the custom font to a font object to see & compare the letter
dim TheSuit as string
TheSuit = suits
'copying the letter to compare
dim temp as string
'This is the placeholder to hold the information of the text field while the material is changed
Select Case TheSuit
'looking at the letter to determine what font to use - red or black
Case "h", "d", "H", "D"
'changing the material to PokerRed if the letter matches above
temp = num(i).text
'Get the current information of the number
Engine.GetMaterialByName("PokerRed", material(i))
'Get the red material
num(i).text = ""
'Remove the text
num(i).SetMaterial(0, material(i))
'Set the material
num(i).text = temp
'Putting the information back into the text field
Case "c", "s", "C", "S"
temp = num(i).text
'Get the current information of the number
'changing the material to PokerBlack if the letter matches above
Engine.GetMaterialByName("PokerBlack", material(i))
'Get the black material
num(i).text = ""
'Remove the text
num(i).SetMaterial(0, material(i))
'Set the material
num(i).text = temp
'Putting the information back into the text field
End Select
Select Case TheSuit
'looking at the letter to determine what font to use - red or black
Case "h", "d", "H", "D"
'changing the material to PokerRed if the letter matches above
temp = card(i).text
'Get the current information of the number
Engine.GetMaterialByName("PokerRed", material(i))
'Get the red material
card(i).text = ""
'Remove the text
card(i).SetMaterial(0, material(i))
'Set the material
card(i).text = temp
'Putting the information back into the text field
Case "c", "s", "C", "S"
temp = card(i).text
'Get the current information of the number
'changing the material to PokerBlack if the letter matches above
Engine.GetMaterialByName("PokerBlack", material(i))
'Get the black material
card(i).text = ""
'Remove the text
card(i).SetMaterial(0, material(i))
'Set the material
card(i).text = temp
'Putting the information back into the text field
End Select
Next i