开发者

MovieClip changes Stage alignment

开发者 https://www.devze.com 2022-12-24 06:44 出处:网络
I am loading a MovieClip using MovieClipLoader. When the MovieClip starts playing, it changes the alignment of my stage to 开发者_开发知识库LT, which incorrectly repositions all the other objects on m

I am loading a MovieClip using MovieClipLoader. When the MovieClip starts playing, it changes the alignment of my stage to 开发者_开发知识库LT, which incorrectly repositions all the other objects on my stage.

Is there anyway for me to:

  1. Prevent the MovieClip from changing the alignment of my stage?
  2. Adding an event handler to an appropriate event, so that I can reset the stage alignment when it gets changed?

I have already tried resetting the stage alignment on the onLoadInit event of MovieClipLoader and the onEnterFrame event of MovieClip, but both seem to reset the alignment too soon.


Try setting _lockroot = true on the offending clip once you've loaded it, this may keep it from messing with your stage.

http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001321.html


I tried to set _lockroot = true in the onLoadComplete event handler of my MovieClipLoader, but this did not solve the problem. My event handler is as follows:

lLoadListener.onLoadComplete = function(target_mc:MovieClip)
{
    Debug.info("lockroot is " + target_mc._lockroot);
    target_mc._lockroot = true;
    Debug.info("lockroot is " + target_mc._lockroot);
}

But this just prints lockroot is undefined twice. I have also tried to add _lockroot = true to the onLoad event handler of the MovieClip I am loading, but after some investigation and debug trace, it seems that the onLoad event is never being called.

Is there any reason why target_mc._lockroot should be returning undefined? Is it related at all to onLoad ever being called?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号