我想从导入的类中调用 stage.stagewidth/stage.stagehieght。这是我的代码希望任何人都可以修复它或告诉我该怎么做
package
{
import flash.display.MovieClip;
import multyLoader;
public class program extends MovieClip
{
private var theLoader:multyLoader = new multyLoader();
public function program()
{
// constructor code-----------------
theLoader.My_Loader(mc_loaderHolder,myXML.IMAGE[1].@URL);
}
}
}
而multyLoader.as 文件代码是
package
{
public class multyLoader extends MovieClip
{
public function multyLoader()
{
trace(any);
}
public function My_Loader(loading_holder,myLoaderURL:String)
{
// pla pla code
loading_holder.x = (stage.stageWidth - loading_holder.width) / 2; // get Error #1009 or stage not found.
loading_holder.y = (stage.stageHeight - loading_holder.height) / 2; // get Error
}
}
}