【发布时间】:2014-02-05 12:30:26
【问题描述】:
这是我的代码:
Main.as
package
{
import flash.display.MovieClip;
public class Main extends MovieClip
{
public static var bg_width = 980;
public static var bg_height = 541;
public function Main()
{
trace("Main spawned")
this.width = bg_width;
this.height = bg_height;
stage.setChildIndex(this, 0)
}
}
}
主要时间线:
var image = new Main();
stage.addChild(image)
我的问题是将背景图像移到舞台后面。至于现在,它会出现在我希望可见的其他电影剪辑之前。
我都试过了
this.parent.setChildIndex(this, 0)
我最后一次尝试的,在代码中:
stage.setChildIndex(this, 0)
它们都没有工作。 这是我的错误信息:
TypeError:错误 #1009:无法访问空对象引用的属性或方法。 在主要() 在 _3_fla::MainTimeline/frame1()
有人知道解决方案吗? :) 谢谢!
【问题讨论】:
标签: actionscript-3 class this stage