Hello
I’m struggling with a project. I’ll try and describe it. 10 mc are loaded randomly with one of two ext.swf’s. Each time you click/drag on one, 1 of 6 questions are randomly loaded from an array into a text box on the main timeline. I need to count and add up how many of each of the 2 ext.swf’s have loaded and whether they have an x pos < or > 300. My first problem is: The question shows up in the text box when the mc is clicked/dragged but when I trace it, the question that shows in the output doesn’t match the one that’s loaded into the text box?
The second problem is a big one. I need to be steered in the right direction as to keep track of what is where on stage. I only have a vague sense of how to go about it, and combining all the bits is too much.
- I need to trace the question
- I need to say if the question is ‘blah’ do this
- The ‘do this’ is pretty complicated. I need to add up the #1 movies that have an x pos of <300 and the #1 movies that have an x pos of >300 and then do the same for the #0 movies. Then I need to compare a users input answer to the correct one!!!
The question AS is in the external swf. [AS]stop();
// Questions Array
question = new Array(); {
question[0] = “How many hedgehogs are in the bed?”;
question[1] = “How many hedgehogs have rolled out of the bed?”;
question[2] = “How many hedgehogs with curly hair are in the bed?”;
question[3] = “How many hedgehogs with straight hair are in the bed?”;
question[4] = “How many hedgehogs with straight hair have rolled out of the bed?”;
question[5] = “How many hedgehogs with curly hair have rolled out of the bed?”;
}
out_btn.onPress = function() {
_parent.startDrag();
r = 0
hog.eyeball_mc.gotoAndPlay(‘open’);
gotoAndPlay(‘rotateStart’);
}
out_btn.onRelease = out_btn.onReleaseOutside = function() {
_parent.stopDrag();
hog.farBottomLeg_mc.gotoAndPlay(‘wiggle’);
hog.farTopLeg_mc.gotoAndPlay(‘wiggle’);
hog.nearBottomLeg_mc.gotoAndPlay(‘wiggle’);
hog.nearTopLeg_mc.gotoAndPlay(‘wiggle’);
_global.whichQuestion = trace(question[Math.round(Math.random()*4)]);
}
[/AS]
I think it would be simpler if I removed the first two questions.
The movie clip trace AS is on the maintimeline. I know I should have made them load from an array or something more effiecient than this mass of code but I knew I could make it work doing it the long way.
[AS]stop();
//Create movie clip for 1 curly hh
//there always needs to be at least one of each
_root.createEmptyMovieClip(“hedgehog1_mc”,2);
loadMovie(“1.swf”, “hedgehog1_mc”);
movNum1 = trace(1);
hedgehog1_mc._x = 35 ;
hedgehog1_mc._y = 240 ;
//create movie clip for one straight hh
_root.createEmptyMovieClip(“hedgehog2_mc”,3);
movNum2 = trace(0);
loadMovie(“0.swf”, “hedgehog2_mc”);
hedgehog2_mc._x = 75 ;
hedgehog2_mc._y = 245 ;
//create movie clip for the random 3rd, position
//trace which mc loads and give it a name to keep track of it
_root.createEmptyMovieClip(“hedgehog3_mc”,4);
hh = Math.round(Math.random()*1);
movNum3 = trace(hh);
loadMovie(hh+".swf", “hedgehog3_mc”);
hedgehog3_mc._x = 115 ;
hedgehog3_mc._y = 240 ;
//create movie clip for the random 4th, position
_root.createEmptyMovieClip(“hedgehog4_mc”,5);
hh = Math.round(Math.random()*1);
movNum4 = trace(hh);
loadMovie(hh+".swf", “hedgehog4_mc”);
hedgehog4_mc._x = 155 ;
hedgehog4_mc._y = 245 ;
//create movie clip for the random 5th, position
_root.createEmptyMovieClip(“hedgehog5_mc”,6);
hh = Math.round(Math.random()*1);
movNum5 = trace(hh);
loadMovie(hh+".swf", “hedgehog5_mc”);
hedgehog5_mc._x = 195 ;
hedgehog5_mc._y = 240 ;
//create movie clip for the random 6th, position
_root.createEmptyMovieClip(“hedgehog6_mc”,7);
hh = Math.round(Math.random()*1);
movNum6 = trace(hh);
loadMovie(hh+".swf", “hedgehog6_mc”);
hedgehog6_mc._x = 55 ;
hedgehog6_mc._y = 265 ;
//create movie clip for the random 7th, position
_root.createEmptyMovieClip(“hedgehog7_mc”,8);
hh = Math.round(Math.random()*1);
movNum7 = trace(hh);
loadMovie(hh+".swf", “hedgehog7_mc”);
hedgehog7_mc._x = 95 ;
hedgehog7_mc._y = 255 ;
//create movie clip for the random 8th, position
_root.createEmptyMovieClip(“hedgehog8_mc”,9);
hh = Math.round(Math.random()*1);
movNum8 = trace(hh);
loadMovie(hh+".swf", “hedgehog8_mc”);
hedgehog8_mc._x = 135 ;
hedgehog8_mc._y = 265 ;
//create movie clip for the random 9th, position
_root.createEmptyMovieClip(“hedgehog9_mc”,10);
hh = Math.round(Math.random()*1);
movNum9 = trace(hh);
loadMovie(hh+".swf", “hedgehog9_mc”);
hedgehog9_mc._x = 175 ;
hedgehog9_mc._y = 255 ;
//create movie clip for the random 10th, position
_root.createEmptyMovieClip(“hedgehog10_mc”,11);
hh = Math.round(Math.random()*1);
movNum10 = trace(hh);
loadMovie(hh+".swf", “hedgehog10_mc”);
hedgehog10_mc._x = 215 ;
hedgehog10_mc._y = 260 ;
//bellpull button to check answers
_root.bellPull.checkAnswer_btn.onRollOver = function(){
_root.bellPull.gotoAndStop(‘over’);
}
_root.bellPull.checkAnswer_btn.onRollOut = function(){
_root.bellPull.gotoAndStop(‘still’);
}
_root.bellPull.checkAnswer_btn.onRelease = function(){
_root.bellPull.gotoAndPlay(‘dangle’);
}[/AS]
If someone could make some suggestions about where I should start it would be so incredible. This project is overwhelming me. I can post the FLA’s too.
Thank you to any one who can take the time.