【问题标题】:Flash action script tweenlite 1084:Flash 动作脚本 tweenlite 1084:
【发布时间】:2013-10-05 11:08:57
【问题描述】:

我是动作脚本的新手

我对动作脚本 3.0 有疑问

我收到了错误

场景 1,图层“动作”,第 1 帧,第 21 行 1084:语法错误:在 y 之前需要右括号

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

我无法在循环中到达 1 个屏幕,我认为 gotoandstop 会结束,但它没有

    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");
    }  

【问题讨论】:

    标签: actionscript-3 flash actionscript flash-cs6


    【解决方案1】:

    很明显,您不仅是 Actionscript 的新手,也是 StackOverflow 的新手。本网站并非旨在帮助您查找拼写或输入错误。每次遇到错误时,请在提问之前修改您的代码。做一些研究。

    这是我或其他任何人最后一次帮助您解决此类问题。您在y 之前缺少一个逗号。

    改变这一行:

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

    这个

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

    下次请自己阅读自己的代码。

    【讨论】:

      猜你喜欢
      • 2013-10-05
      • 2010-12-24
      • 2013-06-22
      • 1970-01-01
      • 2012-04-21
      • 1970-01-01
      • 2021-12-12
      • 2011-02-18
      相关资源
      最近更新 更多