I posted a few years ago in the Code exchange regarding the welcomed “slider component” (based on the Button component in ui.lua). I try without success to control with a slider the sound volume, but have difficulty with CoronaLuaSyntax.
In ObjectiveC, I write, for the method:
-(IBAction) updateVolume {
[mediaPlayer setVolume:slider.value]
}
What’s the equivalent in CoronaLua to catch the value of the slider in a function?
require “slider”
local eventHandler = function (event)
media.setSoundVolume() --??? doesn’t work
end
local mySlider = slider.newSlider(
{
track = “track.png”,
thumbDefault = “thumb.png”,
thumbOver = “thumbDrag.png”,
onEvent = eventHandler,
}
)
-------end-------------
Thanks in advance for your help.
[import]uid: 8970 topic_id: 2801 reply_id: 302801[/import]