can someone explain this error to me?
“5006: An ActionScript file can not have more than one externally visible definition: exam.questions, exam.i”
here is the code
package exam {
import flash.display.*;
import flash.events.*;
import flash.text.*;
var questions:Array = new Array();
var i:uint = 0;
var loopCount:uint = 45;
for (i=0;i<loopCount;i++) { //just to populate array. If it's already populated, this is unnecessary.
questions.push(i);
}
function randomizeMe():Array
{
var output:Array = new Array();
var randomizer:Array = questions; //I do this, only because we're going to cut the questions array to ribbons otherwise...
//and no sense using the original, in case you have to run this again.
var internalLoopCount = questions.length;
for (i=0;i< internalLoopCount;i++) {
var RandomQNum:uint = Math.floor(Math.random()*randomizer.length);
var questionIndexNumber:uint = randomizer[RandomQNum];
output.push(questionIndexNumber);
randomizer.splice(RandomQNum,1); //most important step. This removes the "selected" element from the array,
//so that over the next iteration, there is no possibility of getting the same number.
}
//output should be set up, so we just need to return it.
return output;
}
trace(randomizeMe());
}