我在某个问题上遇到困难:我有一个加载不同内容的主 Flash 应用程序 - 游戏、应用程序等。在某些游戏中,当它被加载时,它的部件(电影剪辑)的行为会发生变化。例如,如果没有加载器应用程序,您在内容游戏中射击并杀死一个人,但在加载器中,当您玩同一个游戏时,您射击并且虽然子弹已经触及 person-mc,但没有任何反应。我希望我能解释清楚))。知道为什么会这样吗?谢谢我提前
更新 :
嗨 Malte Köhrer,非常感谢您的回复!它只是让我发疯-答案就在附近,但被遗漏了)。这是代码 - 在 Event.COMPLETE 上,我更改了加载内容的位置。我有另一个在 COMPLETE 期间运行的函数,它添加了它们的位置发生变化的部分。在COMPLETE 上更改它们的重要性不在之前。谢谢你的帮助。
var loader:Loader = new Loader();
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadingFunc);
loader.load(new URLRequest(urlAdr));
function loadingFunc(event:Event):void
{
var loaderInf:LoaderInfo = event.target as LoaderInfo;
dispObj = loaderInf.loader;
//dispObj.x = stage.stageWidth/2-loaderInf.width/2; --------------- That how it was before I changed root property
//dispObj.y = stage.stageHeight/2-loaderInf.height/2;
var mb:MovieClip = dispObj.loaderInfo.content as MovieClip; //----------- That how it's now
mb.x = stage.stageWidth/2-loaderInf.width/2;
mb.y = stage.stageHeight/2-loaderInf.height/2;
//var app:App = new App(mb); This give the same resault as var mb:MovieClip = dispObj.loaderInfo.content as MovieClip;
}