1087: Syntax error: extra characters found after end of program.

1087: Syntax error: extra characters found after end of program.

Problem:
A block of code may be missing an opening brace ({).

Example:

if (!iconParent) 
	iconParent = Application.application;
}

Notice there is no opening brace after “(!iconParent)”.

Please reply in the comments below if this helped you or not. You can also use the Error Lookup Tool to look up Flex compiler or runtime errors. more info…

This entry was posted in Errors, Flash, Flex. Bookmark the permalink.

59 Responses to 1087: Syntax error: extra characters found after end of program.

  1. Harrie says:

    Im getting this error: 1087: Syntax error: extra characters found after end of program

    onClipEvent(“enterFrame”){
    if (Key.isDown(Key.LEFT)) {
    _x -= 3;
    }
    if (Key.isDown(Key.RIGHT)) {
    _x += 3;
    }
    if (Key.isDown(Key.UP)) {
    turret._rotation -= 3;
    }
    if (Key.isDown(Key.DOWN)) {
    turret._rotation += 3;
    }

    if (_x550) {
    _x = 550;
    }

    }

    can anyone help me?

  2. zack says:

    same prob, 1087: Syntax error: extra characters found after end of program.
    stop(button1.addEventListener)(MouseEvent.MOUSE_DOWN,mouseDownHandler)function mouseDownHandler(event:MouseEvent):void
    please help!!!!!
    email me answer at shepzach@gmail.com

  3. zack says:

    updated my code same problem
    stop()”button 1″.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);function mouseDownHandler(event:MouseEvent):void
    gotoAndStop(1)(“Scene 2″)

  4. zack says:

    1087: Syntax error: extra characters found after end of program.
    Action script 3.0 gives this error in my code plaz help
    stop(“button 1″).addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler)function mouseDownHandler(event:MouseEvent):void
    gotoAndStop(1)(“Scene 2″)
    email me answer at shepzach@gmail.com

  5. 51. What i don’t understood is actually how you are not really much more well-liked than you might be right now. You are so intelligent. You realize therefore considerably relating to this subject, produced me personally consider it from a lot of varied angles. Its like men and women aren’t fascinated unless it’s one thing to accomplish with Lady gaga! Your own stuffs nice. Always maintain it up!

  6. Kristoffer says:

    anybody see the problem ??

    package
    {
    import flash.display.MovieClip
    import flash.text.TextField
    import flash.events.Event
    import flash.events.MouseEvent

    public class DocumentMain extends MovieClip
    {
    public const GRAVITY:Number = 2;
    public const BOUNCE_FACTOR:Number = 0.8;

    public var _bounces:TextField;
    public var _highscore:TextField;
    public var _ball:Ball;

    private var _vx:Number;
    private var _vy:Number;

    public function DocumentMain():void
    {
    _vx = 10;
    _vy = 0;

    _ball.buttonMode = true;

    addEventListener(Event.ENTER_FRAME, enterFrameHandler);
    addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    }

    private function enterFrameHandler(e:Event):void
    {
    // gravitate the ball
    _vy += GRAVITY;

    // move the ball
    _ball.x += _vx;
    _ball.y += _vy;

    // check boundaries for collusion
    checkBoundaryCollisions();
    }

    private function mouseDownHandler(e:MouseEvent):void
    {
    //hit the ball if it has been clicked
    if (e.target == _ball)
    {
    hit(e.target.mouseX, e.target.mouseY);
    }
    }
    private function checkBoundaryCollisions():void
    {
    var left:Number;
    var right:Number;
    var bottom:Number;
    var top:Number;

    left = _ball.x – (_ball.width / 2);
    right = _ball.x + (_ball.width / 2);
    bottom = _ball.y + (_ball.height / 2);
    top = _ball.y + (_ball.height / 2);

    if (left < 0 && _vx stage.stageWidth && _vx > 0)
    {
    _ball.x = stage.stageWidth – (_ball.width / 2);
    _vx *= -1;
    }
    if (top < 0 && _vy stage.stageHeight && _vy > 0)
    {
    _ball.y = stage.stageHeight – (_ball.height / 2);
    _vy *= -BOUNCE_FACTOR;
    _vx *= BOUNCE_FACTOR;

    if (Number(_bounces.text) > Number(_highscore.text))
    {
    _highscore.text = _bounce.text;
    }
    _bounces.text = “0″;
    }
    }

    private function hit(hitX:Number, hitY:Number):void
    {
    //increment bounces
    _bounces.text = String.(Number(_bounces.text) + 1);
    //adjust the vertical velocity of the ball
    if (_vy > 0)
    {
    _vy *= -BOUNCE_FACTOR / 2 ;
    }
    //adjust the horizontaly velocity of the ball
    if (_vx * hitX > 0)
    {
    _vx *= -BOUNCE_FACTOR;
    }

    _vx -= ( 2 * hitX / _ball.width) * HIT_FORCE;
    }
    }
    }
    }

    • Judah says:

      It might have to do with this line,

      _bounces.text = String.(Number(_bounces.text) + 1);

      try,

      _bounces.text = String(Number(_bounces.text) + 1);

  7. Linda says:

    Im very new at Flash, can anyone tell me if you see the problem here?
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;

    stop( ) ;

    tilbake_btn.addEventListener(MouseEvent.CLICK, galleri);
    function galleri(event:MotionEvent) ;void
    gotoAndStop(1, “Scene 1″) ; {
    }

    btn1.addEventListener(MouseEvent.CLICK, play 1);

    function play1(event:MouseEvent):void
    gotoAndStop(1); {
    }

    btn2.addEventListener(MouseEvent.CLICK, play 2) ;

    function play2(event:MouseEvent):void{
    gotoAndStop(2);
    }

    btn3.addEventListener(MouseEvent.CLICK, play 3) ;

    function play3(event:MouseEvent):void{
    gotoAndStop(3);
    }

    btn4.addEventListener(MouseEvent.CLICK, play 4) ;

    function play4(event:MouseEvent):void{
    gotoAndStop(4);
    }

    btn5.addEventListener(MouseEvent.CLICK, play 5) ;

    function play5(event:MouseEvent):void{
    gotoAndStop(5);
    }

    btn6.addEventListener(MouseEvent.CLICK, play 6) ;

    function play6(event:MouseEvent):void{
    gotoAndStop(6);
    }

    • Judah says:

      This,

      btn1.addEventListener(MouseEvent.CLICK, play 1);

      should probably be this:

      btn1.addEventListener(MouseEvent.CLICK, play1);

Leave a Reply

Your email address will not be published. Required fields are marked *

Wrap your code before posting! Click the links below:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">