PDA

View Full Version : Flash Game


penguinsarecool200
02-20-2008, 08:57 PM
At the moment, I have two .fla files.
The first is my game, and the second is a congratulations screen, which you have to manually type in a password. If the password is right, then it will move into a movie clip. If it is wrong, it will reset itself and ask for the password again.
This works by loading text from a .txt file.

when i play both on their own, they work fine.
when i copy the frames from the second across to the game, suddenly, the actionscript goes crap.

When I have the actionscript:
on (release, keyPress "<Enter>")
{
if (user add pass != ""pass"")
{
gotoAndPlay(1177);
}
else
{
gotoAndStop(1194);
} // end else if
}

on the button, when put into the movie, i get four compiler errors.

1) ')' expected
2) Statement must appear within on handler
3) 'else' encountered without matching 'if'
4) Unexpected '}' encountered

These dont appear when the .fla is played separately.

I have tryed to import the .swf through a movie clip.
it loads up ok, but when i put in the password, it doesn't recognise it, and refuses to go tothe congrats screen, as if it cannot read the .txt file.

PLEASE SOMEONE HELP ME!

rrh
02-21-2008, 03:37 PM
if (user add pass != "" A5J3558ZB "")
Put your code inside [ as ] tags [ / as ] (without the spaces) Not doing so may have messed the formatting on this, but if it hasn't, then this line might be the source of your problems.

penguinsarecool200
02-26-2008, 05:28 PM
Grrrrr.... doing this hasnt helped at all....

rrh
02-26-2008, 06:24 PM
I'm not saying to use [ as ] tags in your code. I'm saying use [ as ] tags to post your code to this forum so the formatting isn't messed up.

And your new code, with
if (user add pass != ""pass"")
still has problems:
if (user add pass != "pass")
See what I changed there?