ive made a game using flash mx 2004 professional and ive inserted it into a page in my website. the site is only running from a disk at the minute as its for a college project. when i view the site from my home pc it works fine and the game can be played ok bu t when i get to college and try the same thing i get an error message saying that the javascript is making the machine run slow and i should abort. the flash file is 989kb and below is the script ive inserted into the file ( the game is basically a memory game where you match up pairs of cards to reveal a picture underneath)

fadeout = function()
{
    this._alpha-=5;
    if (this._alpha <= 0)
    {
        delete this.onEnterFrame;
    }
}

fadein = function()
{
    this._alpha+=5;
    if (this._alpha >= 100)
    {
        delete this.onEnterFrame;
    }
}

moves = 0;
for (var i = 0; i < 20; i++)
{
    this["card" + i].gotoAndStop((i % 10) + 1);
    this["card" + i].onRelease = function()
    {
        if (secondCard != undefined)
        {
            secondCard.covering.onEnterFrame = fadein;
            firstCard.covering.onEnterFrame = fadein;           

            delete secondCard;
            delete firstCard;           
        }

        if (firstCard == undefined)
        {
            firstCard = this;
            this.covering.onEnterFrame = fadeout;
        }
        else if (firstCard != this)
        {
            moves++;
            score_txt.text = moves;
            if (this._currentframe == firstCard._currentframe)
            {
                firstCard.onEnterFrame = fadeout;
                this.onEnterFrame = fadeout;
                delete firstCard.onRelease;
                delete this.onRelease;
                delete firstCard;               
            }
            else
            {
                this.covering.onEnterFrame = fadeout;
                secondCard = this;
            }
        }
    }
}

shuffle = function()
{
    for (var i = 0; i < 100; i++)
    {
        var c1 = random(20);
        var c2 = (c1 + random(19)) % 20;

        var tx = this["card" + c1]._x;
        var ty = this["card" + c1]._y;

        this["card" + c1]._x = this["card" + c2]._x;
        this["card" + c1]._y = this["card" + c2]._y;

        this["card" + c2]._x = tx;
        this["card" + c2]._y = ty;

    }
}
shuffle();

also when i try to view the flash file at college , it says that my flash file is an unexpected format? college uses flash mx 2004 (but its an educational version i think)

please help

Im assumming the computers are all conected server like and if your program takes up to much memory it messes things up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.