I have a very simple problem that I am not understanding. In this mini game I just want to be able to touch touch 8 bees and they all play the same animations. The problem I am having is that bee is local and it needs to be global or needs to be crossed called… I viewed the scopes for functions tutorial but I am not sure if I am going about it right… Can someone point me in the right direction?
Here is my code 
[lua]display.setStatusBar( display.HiddenStatusBar ) – HIDE STATUS BAR
local i = 1
local loqsprite = require(‘loq_sprite’)
local screenW = display.contentWidth
local screenH = display.contentHeight
local BG = display.newImageRect(“background.png”, 1024, 768)
BG.x = screenW/2; BG.y = screenH/2
local bee = nil
local t1 = {
{x=180,y=300},
{x=280,y=300},
{x=380,y=300},
{x=480,y=300},
{x=580,y=300},
{x=680,y=300},
{x=780,y=300},
{x=880,y=300}
}
local function spawnBees ()
for i = 1,8 do
local bfactory = loqsprite.newFactory(“bee”)
bee = bfactory:newSpriteGroup()
bee.x = t1[i].x; bee.y = t1[i].y
bee:prepare(“aniBee Bee”)
end
end
listener = function( event )
local phase = event.phase
if ( phase == “ended” ) then
bee:play(“aniBee Bee”)
end
end
bee:addEventListener( “touch”, listener ) [/lua]
Thanks for any help! [import]uid: 51459 topic_id: 16350 reply_id: 316350[/import]
