-- Create a autorelease LuaProxy.
-- ԶͷŵLuaProxy
local proxy = LuaProxy:create()
-- Read a layer from ccbi file.
-- ccbiļжһ㡣
local n = proxy:readCCBFromFile"ALayer.ccbi"
-- Pick up a node named "Label", cast to label, set the string.
-- ȡΪLabelĽڵ㣬תΪCCLabelTTF趨ַݡ
tolua.cast(proxy:getNode"Label", "CCLabelTTF"):setString"This is a label."
-- Create a scene and run.
-- ʾ
local s = CCScene:create()
s:addChild(tolua.cast(n, "CCLayer"))
CCDirector:sharedDirector():runWithScene(s)

-- Play another timeline (sequence).
-- һʱ߶
-- "n" is returned from LuaProxy:readCCBFromFile()
-- "n" ǰļȡĽڵ㡣
local am = CCBAnimationManager:pickFromNode(n)
am:runAnimations"2nd Timeline"
-- Handle timeline complate event.
-- "proxy" must be retained.
-- ʱ¼"proxy" ִretain
-- Callback: CCBAnimationManager *am, string timelineName, LuaEventHandler *hnd
proxy:handleAnimationComplate(am, function(am, timelineName, hnd)
	-- do something after timeline complate
end)
