设置背景的大小为550X400后 把这个代码复制到第一帧~~~~~~~然后ctrl+enter测试~~~。 x=10;//设初始值;
_root.createEmptyMovieClip("mc1",2);//创建一个空的影片剪辑mc1;
_root.mc1.moveTo(100,200);//让mc1移动到(100,200)的位置;
_root.mc1.lineStyle(2,0x2233ff,100);//设置线条的粗细、颜色及透明度;
_root.mc1.onEnterFrame=function(){//这个函数的作用是画出图形;
this.lineTo(x+100,-(100*Math.sin(0.02*x)-200));
if(x<500){
x+=1;
}
}
//画出坐标及箭头; _root.createEmptyMovieClip("mc2",1);
_root.mc2.lineStyle(2,0x000000,100);
_root.mc2.moveTo(0,200);
_root.mc2.lineTo(550,200);
_root.mc2.moveTo(100,0);
_root.mc2.lineTo(100,400);
_root.mc2.moveTo(550,200);
_root.mc2.lineTo(530,180);
_root.mc2.moveTo(550,200);
_root.mc2.lineTo(530,220);
_root.mc2.moveTo(100,0);
_root.mc2.lineTo(80,20);
_root.mc2.moveTo(100,0);
_root.mc2.lineTo(120,20);
//显示字母“Y”; mc.createTextField("txt", 700, 13, 2, 27, 18); _root.createTextField("mytext",5,70,20,50,50);
mytext.multiline = true;
myformat = new TextFormat();
myformat.color = 0x000000;
myformat.size=36;
mytext.text = "Y";
mytext.setTextFormat(myformat); //显示字母“X”; _root.createTextField("mytext1",6,500,210,50,50);
mytext1.multiline = true;
myformat = new TextFormat();
myformat.color = 0x000000;
myformat.size=36;
mytext1.text = "X";
mytext1.setTextFormat(myformat); 只要修改AS中的红色的代码就有不同的效果~~(如cos,tan,log等你自己想的出来的就可以了^^)