我只是在学习 Flash/Actionscript 3,我正在尝试使用已经放置在场景中的对象创建一个新对象,这是它的代码:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Scene1 extends MovieClip
{
{
{
{
var theRoot:MovieClip = MovieClip(root);
var mouse:mouse1 = new mouse1();
//Scene1(void);
//onClipEvent(30);
function Scene1():void
{ this.addEventListener(MouseEvent.MOUSE_MOVE, Joe);
}
public function Joe(event:MouseEvent):void
{
mouse.x = mouseX;
mouse.y = mouseY;
mouse.x = 160;
mouse.y = 160;
trace(mouse.x + " " + mouse.y + " " + mouse.z);
}
}
}
}}};
它确实跟踪了应有的位置(160,160),bu 对象不会渲染,即使我更改 Z .. 虽然,无论如何,没有任何对象会在他们的视野中阻挡它。
这是鼠标1:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class mouse1 extends MovieClip
{
{
{
var theRoot:MovieClip = MovieClip(root);
mouse1(void);
//onClipEvent(30);
function mouse1():void
{
//this.z = -20;
trace("WROKZZZ");
}
public function Joe(event:MouseEvent):void
{
//this.x = mouseX;
//this.y = mouseY;
}
}
}
}};