这是我的代码。外部ActionScript 3.0 MOUSE_UP和可见
package core
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.geom.Point;
public class earth extends MovieClip
{
protected var position:Point = new Point(x, y);
public function earth()
{
stage.earthText_mc.visible = false; //HAVING PROBLEM WITH THIS LINE
buttonMode = true;
addEventListener(MouseEvent.MOUSE_DOWN, down);
}
protected function down(event:MouseEvent):void
{
parent.addChild(this);
startDrag();
addEventListener(MouseEvent.MOUSE_UP, up);
}
protected function up(event:MouseEvent):void
{
stopDrag();
if(dropTarget)
{
if(dropTarget.parent.name == "mercury_drop")
{
x = position.x = 279.95;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "venus_drop")
{
x = position.x = 342.55;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "earth_drop")
{
x = position.x = 418.2;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "mars_drop")
{
x = position.x = 497.6;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "jupiter_drop")
{
x = position.x = 613.65;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "saturn_drop")
{
x = position.x = 738.4;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "uranus_drop")
{
x = position.x = 844.8;
y = position.y = 267.15;
}
else if(dropTarget.parent.name == "neptune_drop")
{
x = position.x = 939.65;
y = position.y = 267.15;
}
else
{
x = position.x = 517.2;
y = position.y = 35.5;
}
}
}
}
}
所有我想要的就是让文本“EARTH”看不见的,当我打开运行Flash,仅使用代码。但我无法连接到该影片剪辑“earthText_mc”。这个脚本仅在“earth_mc”处连接..我不知道如何调用其他影片剪辑并使它们可见或不可见,因为我希望它们能够...
earthText_mc是实例MovieClip?在已经阶段? – 2012-08-06 12:00:57
是的,这是...请帮助..我真的需要这个 – 2012-08-06 12:05:02
我只是不知道这一行..我刚刚编码出来.. = D – 2012-08-06 12:08:40