954,164 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

why wont my flash game work?

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

oohmygod831
Newbie Poster
4 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

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

OurNation
Master Poster
780 posts since Aug 2004
Reputation Points: 16
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: