Hi,
I have CCAction *action1; in classA. I need to use that action in classB.
I need to run action1 along with other actions in classB. How can I do that ?
I did in the following way but not working.
warning: 'CCAction' may not respond to '+actionWithAction:'
Here are my classA and classB.
@interface classA : CCLayer {
CCAction *ActionScale;
}
@property (nonatomic, retain)CCAction *ActionScale;
@end
#import "classA.h"
@implementation classA
@synthesize ActionScale;
-(id)init
{
if( (self = [super init]) )
{
...
ActionScale = [CCScaleBy actionWithDuration:1.0f scale:2.0];
}
return self;
}
//classB
@class classA;
@interface classB : CCLayer {
CCSprite *sprite1;
classA *object1;
}
@property(nonatomic, retain)classA *object1;
@end
#import "classB.h"
#import "classA.h"
@implementation classB
@synthesize object1;
-(id)init
{
if( (self = [super init]) )
{
...
...
id eggAction3 = [CCAction actionWithAction:object1.ActionScale];
}return self;
}
What method should we use to call the CCAction of one class in to other class ?
Thank you.