Hi guys,

I am designing a website with html pages and flash pages. When the user open a flash page (embedded in an html page) i would want to have a preload script. I found a couple of them but they all need to start at the first frame and have a go to and play script after. So my problem is that I already have an important script that make a image follow my mouse and the script needs to be on the first frame to. Is there any way to have both or maybe to have the preloader on a separate file or even change the way my script is written ?

I am open to any ideas, here's the script I already need;

addEventListener(Event.ENTER_FRAME, loopX);
addEventListener(Event.ENTER_FRAME, loopY);

function loopX(e:Event):void
{
var xDist:Number = mouseX - stage.stageWidth * 0.5

if((karate.rotationY - (xDist * 0.001) >-3)&&(karate.rotationY - (xDist * 0.001) <6))

karate.rotationY -= xDist * 0.0002;

else

karate.rotationY -= xDist * 0.000;

}

function loopY(e:Event):void
{
var yDist:Number = mouseY - stage.stageHeight * 0.5

if((karate.rotationX - (yDist * -0.0005) >-5)&&(karate.rotationX - (yDist * -0.0005 ) <3))

karate.rotationX -= yDist * -0.0002;

else

karate.rotationX -= yDist * 0.000;

}


Thanks guys