Nobody seems to be in the UI section of the forums, so after waiting a few days, I think it’s appropriate to post here.
[code]
local brick_function = function (brick)
brick.isVisible = false
end
local brick_1 = ui.newButton{
default = “assets/level1_clickable_brick.png”,
over = “assets/level1_clickable_brick.png”,
onEvent = brick_function(brick_1),
id = “brick_1”
}[/code]
As you can see in my code, I have set the function for onEvent as brick_function, which carries a parameter. The function works when placed elsewhere, but when I put it in onEvent, it gives me a Runtime Error. Can you not pass parameters through onEvent? [import]uid: 7116 topic_id: 27352 reply_id: 327352[/import]