looking at MotionStreakTest.cpp

void MotionStreakTest1::onEnter()

CCActionInterval colorAction = CCRepeatForever::createCCSequence::create(
Why not make CCSequence::create return a CCActionInterval
instead of CCFiniteTimeAction* if you are going to do that?
You are casting in the wrong direction. It may work but it sure violate the inheritance tree.

The two fields
protected:
float m_elapsed;
bool m_bFirstTick;
in CCActionInterval do not exist in CCFiniteTimeAction.
This is asking for trouble.
Andre

Is there a reason why you could not implement a CCActionInterval:create(CCArray arrayOfActions) instead which returns a CCActionInterval.
I am just looking around so I do not understand the flow yet but this look very suspicious.

Andre

You can refer to the implementation of CCSequence, it will return a pointer type of the parameter.
And the pointer type of parameter is CCFiniteTimeAction*.

Yes it returns CCFiniteTimeAction* which is casted to CCActionInterval *

this casting is WRONG

Look at CCActionInterval documentation

CCCopying … CCOBJect … CCAction …CCFiniteTimeAction … CCActionInterval

you should not cast from CCFiniteTimeAction to CCActionInterval.

References to field like m_bFirstTick and m_elapsed using this pointer are illegal and could damage memory.
They cannot be detected by the compiler because of the arbitrary cast.

Andre

To be noted as I mentioned in the toLua thread:

CCAction.pkg

has
class CCActionInterval : public CCAction
class CCFiniteTimeAction : public CCActionInterval

instead of
class CCActionInterval : public CCFiniteTimeAction
class CCFiniteTimeAction : public CCAction

so maybe this was a last minute change and someone added the casting to force it to work.

Andre