WARNING: Attempt to set object.alpha to -0.001

i’m getting this warning ocasionally, not all the time…

WARNING: Attempt to set object.alpha to -0.001

here’s part of the code

[lua]local preparedItem

function prepareItem(event)

local xpos = 160
local ypos = 50

– addItem calls a class object
– which contains a .sprite reference
– to a sprite from a spritesheet

local obj = addItem(xpos,ypos)
local sp = obj.sprite
preparedItem = obj

sp.alpha=0

print("prepareItem obj.sprite alpha to 1 on "…tostring(sp))
transition.to(sp, {time=1000, alpha=1}) – WARNING OCCURS HERE
launchbox:insert(sp)

return true
end

local function onLauncherTouch(event)

local obj = event.target

if(preparedItem ~= nil) then

if(event.phase==“began”) then

elseif(event.phase==“moved”) then

preparedItem.sprite.x = event.x

elseif(event.phase==“ended”) then

dropItem(preparedItem)
preparedItem = nil
timer.performWithDelay(1000, prepareItem)

end
end

return true
end

launcher:addEventListener(“touch”, onLauncherTouch)[/lua] [import]uid: 6645 topic_id: 3836 reply_id: 303836[/import]

doesn’t seem to happen if i set sp.alpha=0.01 on line 16 [import]uid: 6645 topic_id: 3836 reply_id: 11655[/import]

this is an internal warning in output… once on the device, this specific warning goes away and it is clamped.

your alpha = 0.01 is valid.

c [import]uid: 24 topic_id: 3836 reply_id: 11668[/import]

There is a know issue of this warning occurring when changing the alpha value during a transition. It’s on our list of things to fix.

-Tom [import]uid: 7559 topic_id: 3836 reply_id: 11792[/import]

I have especially noticed this while using director class [import]uid: 19620 topic_id: 3836 reply_id: 27413[/import]