hi, this is my codes and I have two things to ask, hope someone can help me because I am a beginner to use actionscript and really need help.
1) I want to count the number of movieclips(in different class) added. That is, may be I have 10 clicks, how many bigfish and smallfish are created. What function is suitable to call for doing this.
2) I have a problem on the hittest, it comes out "no hit" only but I still can see the movieclips overlap. And if I want to modify that only check whether smallfish is overlap with bigfish, what should I do? Also, there are functions inside the movieclip itself to give motion.
var classNames:Array = ["bigfish", "smallfish"];
var ClassRef:Class = Class(getDefinitionByName(classNames[Math.floor(Math.random()*classNames.length)]));
var classInstance:* = new ClassRef();
For the first part, I would just create two arrays, one for big fish and one for small fish. As each fish gets added, I would store a reference to it in the appropriate array. You could use the class name as part of the array variable name to make storing easier.
With the first part done, then you only need to check against the appropriate array... if it's a small fish, you test for hits using only the bigfish array.
Someone else may have a different idea, so wait for others to offer some.