When you call Button::create, it's actually referencing the create method in CCMenuItemImage, so you're getting a CCMenuItemImage back (not a Button).
You'll need to make a static create method in your Button class. You can still reference the initializers in your superclass, so it should be fairly straightforward. So in your Button class create method, do something like:
Button* Button::create(const char* normalImg, const char* selectedImg) {
Button *button = new Button ();
if (button && button->CCMenuItemImage::initWithNormalImage(normalImg, selectedImg, NULL, NULL, NULL) {
button->autorelease ();
return button;
} else {
delete button;
button = NULL;
return NULL;
}
}
(Disclaimer: I didn't actually test this, just some quick code here.)
If you use this create method, it will return a Button object, which is exactly what you're looking for.
The initializer you're looking for is:
bool CCMenuItemImage::initWithNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler selector);
You may want to make your create constructor for your Button class accommodate more values of the CCMenuItemImage initializer. Up to you.
Trace through the CCMenuItem.cpp file; the CCMenuItemImage itself is a subclass of CCMenuItem, so that should give you a fairly strong reference point of how this should all be set up. (Both CCMenuItem and CCMenuItemImage are defined in the CCMenuItem.cpp/.h files.)
Hope this helps!!