GooMoo
01-26-2009, 11:45 PM
Forgive me I'm tired and embaressed that I can't figure this out...
So the first time this code is executed (ie the Next button is pressed), it works just fine. The second time this function is executed though, the question_mc does not get removed.
function nextQuestion(){
delete visQuestion;
_level0.question_mc.swapDepths(999);
_level0.question_mc.removeMovieClip();
if(_level0.question_mc){
trace('still here');
for(a in _level0.question_mc){
trace("question number:"+currentQuestion+" value:"+_level0.question_mc[a]+" type of:"+typeof _level0.question_mc[a]+" with name:"+_level0.question_mc[a]._name);
}
trace('end objects');
} else {
trace('removed');
}...
visQuestion is the object created by a class that creates the question_mc on the stage. So the first time around the trace is just "removed". The second time around the trace returns:
still here
question number:1 value:8429 type of:number with name:undefined
question number:1 value:_level0.question_mc.next_mc type of:movieclip with name:next_mc
question number:1 value:_level0.question_mc.option_mc0 type of:movieclip with name:option_mc0
question number:1 value:_level0.question_mc.option_mc1 type of:movieclip with name:option_mc1
question number:1 value:_level0.question_mc.option_mc2 type of:movieclip with name:option_mc2
question number:1 value:_level0.question_mc.option_mc3 type of:movieclip with name:option_mc3
end objects
The option_mc# clips are from the previous question_mc that should have been removed. The number returned, without a name, I have no idea where it's coming from. The question_mc is being created on the stage by a class, like this:
class QuestionLayout{
public function QuestionLayout(myQuestion,currentQuestion){
var question_mc:MovieClip = _level0.createEmptyMovieClip("question_mc", _level0.getNextHighestDepth());
I'm hoping maybe someone has an idea what might typically cause something like this to happen? I'd give you the whole code, but I wouldn't expect anyone to surf through 600 lines.
So the first time this code is executed (ie the Next button is pressed), it works just fine. The second time this function is executed though, the question_mc does not get removed.
function nextQuestion(){
delete visQuestion;
_level0.question_mc.swapDepths(999);
_level0.question_mc.removeMovieClip();
if(_level0.question_mc){
trace('still here');
for(a in _level0.question_mc){
trace("question number:"+currentQuestion+" value:"+_level0.question_mc[a]+" type of:"+typeof _level0.question_mc[a]+" with name:"+_level0.question_mc[a]._name);
}
trace('end objects');
} else {
trace('removed');
}...
visQuestion is the object created by a class that creates the question_mc on the stage. So the first time around the trace is just "removed". The second time around the trace returns:
still here
question number:1 value:8429 type of:number with name:undefined
question number:1 value:_level0.question_mc.next_mc type of:movieclip with name:next_mc
question number:1 value:_level0.question_mc.option_mc0 type of:movieclip with name:option_mc0
question number:1 value:_level0.question_mc.option_mc1 type of:movieclip with name:option_mc1
question number:1 value:_level0.question_mc.option_mc2 type of:movieclip with name:option_mc2
question number:1 value:_level0.question_mc.option_mc3 type of:movieclip with name:option_mc3
end objects
The option_mc# clips are from the previous question_mc that should have been removed. The number returned, without a name, I have no idea where it's coming from. The question_mc is being created on the stage by a class, like this:
class QuestionLayout{
public function QuestionLayout(myQuestion,currentQuestion){
var question_mc:MovieClip = _level0.createEmptyMovieClip("question_mc", _level0.getNextHighestDepth());
I'm hoping maybe someone has an idea what might typically cause something like this to happen? I'd give you the whole code, but I wouldn't expect anyone to surf through 600 lines.