I would like to star using sliders…
I copy this code from Corona
-- Slider listener local function sliderListener( event ) print( "Slider at " .. event.value .. "%" ) end -- Create the widget local slider = widget.newSlider { top = 200, left = 50, width = 400, value = 10, -- Start slider at 10% (optional) listener = sliderListener }
I see a grey bar with the Blue line for the slider…
When I move the circle I see in the “terminal”
2014-07-03 12:51:40.235 Corona Simulator[96836:507] Slider at 56%
So far so good…
Now How Do I make an image move, or play a sound or do something with the slider?
something like this…
-- Slider listener local function sliderListener( event ) print( "Slider at " .. event.value .. "%" ) if slider is at 56% then audio.play(soundBig) elseif slider is at 80% then audio.play(soundSmall) end end
I know is not the right code but I guess I have to do something like that
I just want to find out what?
or if event.value is from 34% to 44% then
I think you have the idea…
Thanks for your help