How to fix these warnings?

Hi guys,

I am working on a cocos2d-x project now and I have these code

CCAnimation* anim = new CCAnimation;
anim~~>initWithSpriteFrames;
CCAction moveAction = CCAnimate::actionWithAnimation;
CCAction
moveForever = CCRepeatForever::actionWithActionmoveAction);
sprUgug~~>runAction(moveForever);//CCAnimate::create(anim));
sprUgug~~>setPosition);
this~~>addChild(sprUgug, 1);

It says actionWithAnimation and actionWithAction is deprecated. So what is the correct method to use to fix these 2 warnings?

try:
CCAnimation* anim = CCAnimation::createWithSpriteFrames(frames, 0.5);
CCAction moveAction = CCAction::create(anim);
sprUgug->runAction(CCRepeatForever::create(moveAction));

Thanks, I actually replaced it with create method and it works now