Re: Changing Images – what could be wrong in that LUA code

Home Forums General Programming Changing Images – what could be wrong in that LUA code Re: Changing Images – what could be wrong in that LUA code

#4460
atom
Keymaster
  • Topics: 159
  • Replies: 2945
  • Total: 3104
  • ★★★★★

I really can’t debug this cause only you know how you imagined this to work. I can tell you:
doing this is a bad idea
[code:2k5c4ia1]
comp = filter_slope_mod:getComponent()
comp:setPropertyString ("uiImageButtonResource" , FilterSlopeTypeOn)
[/code:2k5c4ia1]

always check if the object is valid, otherwise the method might be disabled on load
[code:2k5c4ia1]
comp = filter_slope_mod:getComponent()
if comp ~= nil then
comp:setPropertyString ("uiImageButtonResource" , FilterSlopeTypeOn)
end
[/code:2k5c4ia1]

Check your spelling of properties.

Ctrlr