首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Flash >

FLASH有关graphics使用的有关问题

2012-03-28 
FLASH有关graphics使用的问题下面的代码有什么问题么为什么我写在脚本里既没提示脚本错误也没提示编译错误

FLASH有关graphics使用的问题
下面的代码有什么问题么
为什么我写在脚本里既没提示脚本错误也没提示编译错误
为何就是不能显示效果呢?

////////////////////////////////////////////////////////////////////////////////////////////////////




package
{
import flash.display.MovieClip;
import flash.display.Sprite;
//import flash.display.Graphics;
public class debug4 extends MovieClip
{
public function debug4()//绘制图形
{
this.graphics.lineStyle(5,0x000000); //像素,颜色
this.graphics.moveTo(100,200); //直线起始点
this.graphics.lineTo(150,250); //终点
this.graphics.curveTo(200,300,250,250); //曲线,起点,控制点
this.graphics.lineTo(300,200); //终点
this.graphics.drawRect(50,50,300,250);//矩形,坐标,宽度,高度
this.graphics.drawRoundRect(40,40,320,270,25,25); //圆角矩形,在矩形的基础上增加圆角的宽度和高度
this.graphics.drawCircle(150,100,20); //圆形,坐标,半径
this.graphics.drawEllipse(180,150,40,70); //绘制椭圆形,坐标,宽度,高度
this.graphics.beginFill(0x333333);
this.graphics.drawCircle(250,100,20);
this.graphics.endFill();
}
}
}





[解决办法]
代码对的,可以显示

热点排行