Dakular's profile打哭了的拨烙锅PhotosBlogLists Tools Help

Blog


    10/18/2006

    关于removeMovieClip()失效

    前几天碰到removeMovieClip()失效的问题,虽然用变通的方法把问题避免了,还是没弄明白为什么,今天碰巧看到这篇文章,总结的还不错。

     Case1

     你肯定想不到,同样的代码,只是要attachMovieMC里有个ComboBox就会导致不能removeMovieClip()

     其中 box1 box2 按钮是attach box 元件

    你可以看到按了box1后再按box2, attachbox MC的深度变成了-32779,并且removeMovieClip不了

    而同样的代码,在box3box4按钮上不会发生,box3box4attachbox2元件

     如果成功 remove MC本身和深度都应该是 undefined 才对

     Case2

     库里的按钮元件attach了之后居然不能removeMovieClip,无论它的深度是多少 -_-|||

    所以要用按钮需要删除的话,得把按钮放在mc里再attach这个mc

     Case3

     这个应该不用多说了吧,深度小于 0 大于 1048575 的用不了removeMovieClip()

     补充

     其他要注意的应该都知道了吧,比如

    用第二版组件的时候,深度管理要用 DepthManager ,如果用 getNextHighestDepth() 会超出可删除深度范围,就要用swapDepths()把深度调回来再删

      

    转自:yellow

     

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://dakular.spaces.live.com/blog/cns!8668FFEC49BC51CE!410.trak
    Weblogs that reference this entry
    • None