AddClip problem Unity 4

Hi,
I’m currently working with Unity 4.0.0f7 and i have a problem when I try to animate a character.

I have an animation Clip attached to the animation component that contains all my animation . This clip last almost 42 seconds.

I try to create a new animation clip on my script like this :

animation.AddClip(animation.clip, "testAnim", 0, 22);

Then I play this animation with

animation.CrossFade("testAnim");

or with :

animation.Play("testAnim");

I get the animation between the frame 0 and 22, but it’s followed by nothing during 40 seconds. I didn’t get this with the 3.5 version.
When I check the length of the clip, it is the same as the full clip (42 seconds).

Did someone get the same problem with Unity 4?

Thanks

oh ,i just solve this problem by recording the infomation of the clip to an object.
like this:

public string clipName;
	public float length;
	
	public void AddClip(ref Animation animation,AnimationClip clip,string name,int startFrame,int endFrame,WrapMode wrapMode){
		animation.AddClip(clip,name,startFrame,endFrame);
		animation[name].wrapMode = wrapMode;
		length = (endFrame-startFrame)/clip.frameRate;//*clip.length))*clip.length;
		clipName = name;
	}

and the next time you want to know the length you can just read the length from this object.