hi,
when i declare this object “background” with local the transition don’t work but without the local the function don’t work…Is it a way to have local with a function and that works?
Thanks.
local function drawBackground() local background= display.newImageRect(myGroupBackground, "backgroundnb.png",480,320) background.x=display.contentCenterX background.y=display.contentCenterY background.alpha=1 return background end drawBackground() transition.to(background,{time=1000,alpha=0}) --don't works local function drawBackground() background= display.newImageRect(myGroupBackground, "backgroundnb.png",480,320) background.x=display.contentCenterX background.y=display.contentCenterY background.alpha=1 return background end drawBackground() transition.to(background,{time=1000,alpha=0}) --works