一个简单的按钮

    技术2022-05-20  40

    简单的用flash的影片剪辑做一个按钮 主要是为了能动态的改变按钮上文本的值

     

    第一层上四针分别对应这out over  down up 四种状态

    如果想做的复杂可以在这四针分别用做好的影片剪辑  那就绚丽了

    buttonMode = true;

    addEventListener(MouseEvent.MOUSE_OVER,over);

    addEventListener(MouseEvent.MOUSE_MOVE,over);

    addEventListener(MouseEvent.MOUSE_DOWN,down);

    addEventListener(MouseEvent.MOUSE_OUT,out);

    addEventListener(MouseEvent.MOUSE_UP ,up);

    function over(e:MouseEvent)

    {

    gotoAndStop(2);

    }

    function out(e:MouseEvent)

    {

    gotoAndStop(1);

    }

    function down(e:MouseEvent)

    {

    gotoAndStop(4);

    }

    function up(e:MouseEvent)

    {

    gotoAndStop(2);

    //fscommand("Click",label.text);

    }

    在主场景中  第一句用来设置影片剪辑中动态文本的值

    等做成的时候就从XML中读取   后面就是按钮点击之后向容器发送命令

    delphi的flash控件有相应的时间处理

    myb.label.text="1";

    myb.addEventListener(MouseEvent.CLICK,fs);

    function fs(e:MouseEvent)

    {

    fscommand("Click",myb.label.text);

    }


    最新回复(0)