hat973 Wrote:- Code: Select All Code
package
{
import flash.display.*;
import flash.events.*;
public class Player extends MovieClip
{
var parentMC:MovieClip;
var playerMC:MovieClip;
public function Character(mcParent:MovieClip)
{
parentMC = mcParent;
playerMC = null;
}
public function AddCharacter(xPos:Number, yPos:Number, charName:String)
{
playerMC = new Player();
parentMC.addChild(Player);
playerMC.x = xPos;
playerMC.y = yPos;
playerMC.name = charName;
}
}
}
this code is driving me batty i double and tripled checked it but the thing keeps saying it wants a RIGHT bracer on line 25 so i give it what it wants then check it onece more it passes the writing part then i do a ctrl+enter and it tells me it wants a Right bracer on line 25 >.< help
Not a actionscript man myself but i put the code into Notepad++. It seems Package isn't a key word in the syntax according to Notepad++ so that might be the cause but as i said i don't program in AS.
hat973 Wrote:Okay its been a while since iv asked a question on this subject
im fallowing a If and if else statment but i want to add a bug like if a person enters the wrong code and is alirted to it the player gets hit by one animion cause i have in the code else if code is wrong it pops up Wrong in he txt input box
Not trying to be rude, but can you please use something like word when asking a technical question or double check it before posting. I'm literally not sure what your asking.
Okay something about you causing a bug using a if else statement but you want to cause this bug.
More over, this bug is to detect a error in code?
Well what you could do is to surround a block of code with a
try statement and then follow it with a
catch statement that surrounds your debug code.
This however wont trigger the catch statement unless a exception is thrown inside of the try catch statement.
Example and bit of explanation for AS3
http://stackoverflow.com/questions/3455 ... rrors-in-wEDIT
Maybe restating the question would help.