It looks like you're new here. If you want to get involved, click one of these buttons!
result:getPlayerEntryAsync( function (self,result,entry) if entry then local c = 220 for key,val in pairs(entry.entry) do print(key,val) if key=="player" then for key2,val2 in pairs(val) do print(" ",key2,val2) end if val.photo then playerData.photo = val.photo local loader = UrlLoader.new('"'..val.photo..'"') local function onComplete(event) local out = io.open("|D|profile_pic.jpg", "wb") if out then out:write(event.data) out:close() local b = Bitmap.new(Texture.new("|D|profile_pic")) b:setAnchorPoint(0.5, 0.5) stage:addChild(b) b:setPosition(100,100) end end loader:addEventListener(Event.COMPLETE, onComplete) end end end end end) |
Comments
According to the reference on UrlLoader, the link is in quotes like this -
local loader = UrlLoader.new("http://example.com/image.png") . Hence my addition of the double quotes. Have I done that wrong?
As for the extension issue, I've tried all combos - with extensions and without. Nothing is working.
If you are gonna pass some string variable to a function you should directly pass it without putting into string (") quotes hence the parameter type is already string.
But if you have an integer value like a number and you want to use it and generate a string then you can use it like this:
So the end result will be this string:1some other string here
Anyway as a result your code must be corrected like below:(Only the double quote part, i didn't check the other parts)
Likes: sam_m
Likes: MoKaLux, sam_m
Likes: MoKaLux