0
votes

I'm new to action script

I have a problem with action script 3.0

I got the error

Scene 1, Layer 'actions', Frame 1, Line21 1084: Syntax error: expecting rightbrace before y

TweenLite.to(balk_mc, 1, {x:551 y:balk_mc.y});

i cant get to 1 screen its on a loop i thought that it would be over with the gotoandstop but it doesnt

    import flash.events.MouseEvent;
    import com.greensock.*;
    stop();



    button1.addEventListener(MouseEvent.CLICK, button1_clicked);
    function button1_clicked(e:MouseEvent):void{
            TweenLite.to(balk_mc, 1, {x:141.35, y:balk_mc.y});
            gotoAndStop("page1");
    }

    button2.addEventListener(MouseEvent.CLICK, button2_clicked);
    function button2_clicked(e:MouseEvent):void{
            TweenLite.to(balk_mc, 1, {x:330.6, y:balk_mc.y});
            gotoAndStop("page2");
    }

    button3.addEventListener(MouseEvent.CLICK, button3_clicked);
    function button3_clicked(e:MouseEvent):void{
            TweenLite.to(balk_mc, 1, {x:551 y:balk_mc.y});
            gotoAndStop("page3");
    }
            var number:Number = 1;

    next_btn.addEventListener(MouseEvent.CLICK, nextImage);

    checkNumber();
    function nextImage(event:MouseEvent):void {
        //trace("next button geklikt!");
        number++;
        loader.source = "images/tommorrowland"+number+".png";
        checkNumber();
    }

    previous_btn.addEventListener(MouseEvent.CLICK, previousImage);

    function previousImage(event:MouseEvent):void {
        //trace("previous button geklikt!");
        number--;
        loader.source = "images/tommorrowland"+number+".png";
        checkNumber();
    }

    function checkNumber():void {
        next_btn.visible = true;
        previous_btn.visible = true;
        if(number == 4){
            next_btn.visible = false;
        }
        if(number == 1){
            previous_btn.visible = false;
        }

    }
    }
    }

    button4.addEventListener(MouseEvent.CLICK, button4_clicked);
    function button4_clicked(e:MouseEvent):void{
            TweenLite.to(balk_mc, 1, {x:735 y:balk_mc.y});
            gotoAndStop("page4");
    }  
1

1 Answers

0
votes

It's clear that you are new to not only Actionscript, but to StackOverflow too. This website isn't designed to help you find your spelling or typing mistakes. Please revise your code before asking a question every time you get an error. Do some research.

This is the last time I or anyone else will help you with this kind of question. You are missing a comma before y.

Change this line:

TweenLite.to(balk_mc, 1, {x:551 y:balk_mc.y});

with this one

TweenLite.to(balk_mc, 1, {x:551, y:balk_mc.y});

And next time read your own code yourself please.