如何在cocostudio里面使用CCControlButton

如何在cocostudio里面使用CCControlButton,代码创建后用不了,有什么解决办法没?

–创建一个按钮
function createButton(textureFileN, _textureFileH, _textureFileD,scale)
local sprite1=CCScale9Sprite:create(textureFileN)
if scale then sprite1:setScale(scale) end
sprite2=CCScale9Sprite:create(textureFileN)
if scale then sprite2:setScale(scale) end
sprite3=CCScale9Sprite:create(textureFileN)
if scale then sprite3:setScale(scale) end
local button = CCControlButton:create()
button:setBackgroundSpriteForState(sprite1, CCControlStateNormal)
button:setBackgroundSpriteForState(sprite2, CCControlStateHighlighted)
button:setBackgroundSpriteForState(sprite3, CCControlStateDisabled)
button:setPreferredSize(button:getBackgroundSpriteForState(CCControlStateNormal):getPreferredSize())
print(tolua.type(button))
return button
end

用代码创建CCControlButton在cocostudio的UI场景中如何调用?

问题已经解决了