Hi
So the code works in 840… But when I click the rectangle it works but terminal gives this error, the code behaves and works like nothing is wrong… Very strange… Something I need to worry about??
error: …Desktop/untitled folder/test/test 2/main.lua:13: attempt to index upvalue ‘bv’ (a nil value)
thanks
Jeremy
Code:
local bv = display.newImage( “BirdVect1S.png”)
bv.x = 300
bv.y = 400
local myRectangle = display.newRect(0, 0, 150, 50)
myRectangle.strokeWidth = 3
myRectangle:setFillColor(140, 140, 140)
myRectangle:setStrokeColor(180, 180, 180)
myRectangle.x = 200
myRectangle.y = 200
local function showB2 (event)
bv:removeSelf( )
bv = nil
local bvg = display.newImage( “BirdGr1S.png”)
bvg.x = 300
bvg.y = 400
end
myRectangle:addEventListener (“touch”, showB2)
[import]uid: 127028 topic_id: 27885 reply_id: 327885[/import]