s

edit: I’m reaaaaally sorry about the title, I was going to write it later and then I forgot. Stupid me.

Ok, I’ve got a weird, weird, problem.
Ok, basically, I have a webpage which is a big square made of 16 (4x4) little squares. Each time a link is clicked, all of these little squares flip 180 degrees on the Y axis and display the new page.
Now what I’ve done:
Each little square is a movieclip; inside, there’s a loader and a mask. The loader attaches the next webpage, and places it, the mask only shows a part of it. There’s a script that makes my little squares’ scale go near 0, loads the next webpage, and return to 100%. All this is done with a setinterval (i find it more flexible than working with frames).
Now here’s my problem: As long as I don’t load a movieclip, I mean, while I was debugging the script that twists the squares one by one, everything works fine. As soon as I use the function that loads the next webpage, it goes crazy. All the square scale down to 0 just fine, they load the page like they should, but they don’t grow back to 100%. Some of them do, some others stay stuck at 10-20%, others around 60%…And it’s random, meaning, each time I test my swf, it gives me different results. One time They even got all stuck at 0% and diseappeared.
Am I doing something wrong? Or is there some flash limitation or bug that I’m not aware of?
Please help me.

Here’s a bit of my code, it’s not really clear and I guess there’s plenty of better ways of doing this, but I’m not a very good coder. Hope it helps you help me.

[SIZE=1]_global.MainVars=new Object(); //Main Variables
MainVars.Duration=new Number(1); //Speed of a cube spin (in seconds)
MainVars.ShrinkJump=new Number(4); //Speed of a cube spin (in shape change)
MainVars.Delay=new Number(0);//Delay between last cube turn and first cube turn

_global.Page=new Object() //Cubes to rotate for each type of page
Page.Full=new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
Page.Photo=new Array(3,4,7,8,11,12,15,16);

function LoadPage(PageType:Array,NextPage:String){
CloseClock = setInterval(SpinCubes,100,PageType,NextPage)}

function OpenPage(PageType:Array){
OpenClock = setInterval(OpenCubes,100,PageType)}

function OpenCubes(PageType:Array){
CurrOpenCube=PageType[CurrOpenNmb]
CurrOpenNmb+=1
}

function SpinCubes(PageType:Array,NextPage:String){
if(CurrNmb==(PageType.length-(PageType.length-MainVars.Delay))){
OpenPage(PageType)
}
if(CurrNmb==PageType.length*2){
CurrNmb=0;
CurrOpenNmb=0;
clearInterval(CloseClock);
clearInterval(OpenClock);
break;
}
else{
CurrCube=PageType[CurrNmb]
CurrNmb=CurrNmb+1
_root[“C”+CurrCube].Spin()
_root[“C”+CurrCube].CurrLoaded = NextPage
_root[“C”+CurrOpenCube].DoAttach()
_root[“C”+CurrOpenCube].Spin()
}
}

LoadPage(Page.Full,“PMain”)
[SIZE=2]
Oh, and everytime I say “load”, I mean I’m using attachmovieclip().
Thanks in advance.[/SIZE]
[/SIZE]