A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help syntax error

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    12

    Exclamation Help syntax error

    i am left with one error which says Scene 1, Layer 'Layer 5', Frame 5 1084: Syntax error: expecting rightbrace before end of program.

    I will show you all of my code for that.
    Any help would be appreciated!
    Corey

    PHP Code:
    stop(); 
    stage.focus stage;


    Hammer.x=mouseX;
    Hammer.y=mouseY;
    Hammer.mouseEnabled false;


    stage.addEventListener(MouseEvent.MOUSE_MOVE,redrawCursor);

    Mouse.hide();


    function 
    redrawCursor(event:MouseEvent):void
    {
        
    Hammer.event.stageX;
        
    Hammer.event.stageY;
    }
    stop();

    var 
    cDepth:int100;
    var 
    xSpeed:Number 4;
    var 
    stageWidth:Number stage.stageWidth;
    var 
    stageHeight:Number stage.stageHeight;

    stage.addEventListener (Event.ENTER_FRAMEmain);

    function 
    main(event:Event):void{
        
    createSpider1();
    }

    function 
    createSpider1():void{
        if (
    randRange(010) == 0){
            var 
    thisMC:MovieClip = new Spider1_mc(); 
    addChild(thisMC); 
            
    cDepth++;
            
    thisMC.= -thisMC.width
            
    thisMC.speed xSpeed
            
    thisMC.randRange(thisMC.heightstageHeight-thisMC.height);
            
    thisMC.name "Spider1" cDepth;
            
    thisMC.addEventListener(Event.ENTER_FRAMEspider1MoveHandler);
            
    addChild(thisMC); 
        }
    }

    function 
    spider1MoveHandler(event:Event):void {
        var 
    Spider1MC:MovieClip event.currentTarget as MovieClip;
        function 
    spider1MoveHandler(e:Event):void 

        if (
    thisMC.stage.stageWidth
        { 
                  
    removeChild(Spider1MC);
                  
    trace("I'm here"); 
            
    thisMC.removeEventListener(Event.ENTER_FRAMEspider1MoveHandler); 
        } 
    }  

    function 
    randRange(minNum:NumbermaxNum:Number):Number {
        return (
    Math.floor(Math.random()*(maxNum minNum 1)) +minNum);


  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    You have 2 of these "function spider1MoveHandler(e:Event):void" inside of one another, but I posted on your different thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center