大家帮我看看这段代码怎么老是出现:1046:找不到类型,或者它不是编译时常数 :MovieClip.
packageapp.demo.MyTouchApp{importflash.display.*;importflash.events.*;importapp.core....
package app.demo.MyTouchApp{
import flash.display.*;
import flash.events.*;
import app.core.action.RotatableScalable;
public class MyTouchApp extends RotatableScalable {
public function MyTouchApp() {
//--------connect to TUIO-----------------
TUIO.init(this,'localhost',3000,'',true);
trace("MyTouchApp Initialized");
//----------------------------------------
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);// adds an event listener looking for a mouse click - runs "onMouseDown"
}
private function onMouseDown(event:MouseEvent):void {//creats a circle when the mouse is clicked
var circle:Sprite = new Sprite();
circle.graphics.lineStyle(10, 0xff0000);//set line width to 10px and red
circle.graphics.drawCircle(0,0,40);// draw a 40px circle
circle.x = mouseX;//put it where the mouse clicked
circle.y = mouseY;
addChild(circle);//add the circle to the plane
}
}
}
这段代码是我从网上复制下来的多点触摸的一段代码!发布时老出现这样的错误! 展开
import flash.display.*;
import flash.events.*;
import app.core.action.RotatableScalable;
public class MyTouchApp extends RotatableScalable {
public function MyTouchApp() {
//--------connect to TUIO-----------------
TUIO.init(this,'localhost',3000,'',true);
trace("MyTouchApp Initialized");
//----------------------------------------
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);// adds an event listener looking for a mouse click - runs "onMouseDown"
}
private function onMouseDown(event:MouseEvent):void {//creats a circle when the mouse is clicked
var circle:Sprite = new Sprite();
circle.graphics.lineStyle(10, 0xff0000);//set line width to 10px and red
circle.graphics.drawCircle(0,0,40);// draw a 40px circle
circle.x = mouseX;//put it where the mouse clicked
circle.y = mouseY;
addChild(circle);//add the circle to the plane
}
}
}
这段代码是我从网上复制下来的多点触摸的一段代码!发布时老出现这样的错误! 展开
1个回答
2011-05-06
展开全部
不是SDKS 的原因!
DataService是你自己开发的组件吧!
你要把它引入的你命名空间!
假如DataService组件在src文件夹下的view文件夹下,那么应该在Application加入你自定义的命名空间!
<mx:Application xmlns:mx=""
xmlns:view="view.*">
然后把
<mx:DataService id="ds" destination="sql-product"/>改成
<view:DataService id="ds" destination="sql-product"/>
而且敲入<view:后,会出现view文件夹下的所有可引用组件!
另外,虚机团上产品团购,超级便宜
DataService是你自己开发的组件吧!
你要把它引入的你命名空间!
假如DataService组件在src文件夹下的view文件夹下,那么应该在Application加入你自定义的命名空间!
<mx:Application xmlns:mx=""
xmlns:view="view.*">
然后把
<mx:DataService id="ds" destination="sql-product"/>改成
<view:DataService id="ds" destination="sql-product"/>
而且敲入<view:后,会出现view文件夹下的所有可引用组件!
另外,虚机团上产品团购,超级便宜
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询