Hello, I would like to stream a sound file (mp3), currenty I'm using:
--
local loader = UrlLoader.new("
http://www.oneworldpuebla.net/t.mp3")
local function onComplete(event)
print("hello, world")
local sound = Sound.new(loader)
sound:play()
end
loader:addEventListener(Event.COMPLETE, onComplete)
-- end
which of course gives me an error:
main.lua:7: bad argument #1 to 'new' (string expected, got table)
How can I get this done?
Regards.
Comments
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
How did you knew about .data?
I looked at the reference manual but didn't saw it.
Regards
http://www.giderosmobile.com/documentation/reference_manual.html#UrlLoader
UrlLoader...
Event.COMPLETE
This event is dispatched when loading is complete.
event.data: The downloaded data.
UrlLoader.new(url, method, headers, body)...
After loading is finished, loaded data is stored at event.data field of Event.COMPLETE event as string.
cheers
evs
Likes: franMX
Regards