0

嗨,我已经查找了很多答案,但无法解决我的问题。我正在使用外部操作脚本,并且我使用了以下代码:

package
{
    import flash.display.MovieClip;
    import flash.net.*;
    import flash.events.*;
    import flash.display.Loader;
    import fl.motion.MotionEvent;
    import flash.ui.Mouse;

    public class submenu1 extends MovieClip
    {
        private var movieLoader:Loader; 

        //everything in this function is exicuted when you start the application
        public function submenu1()
        {
            movieLoader = new Loader(); 

            image3_btn.addEventListener(MouseEvent.MOUSE_DOWN,addMovie);
            image4_btn.addEventListener(MouseEvent.MOUSE_DOWN,addMovie);
            exit_btn.addEventListener(MouseEvent.MOUSE_DOWN,closeTheMovie);

        }


        private function addMovie(e:MouseEvent)
        {
            if(e.target.name=="image3_btn")
            {
                loadTheMovie("image3");
            }
            else if(e.target.name=="image4_btn")
            {
                loadTheMovie("image4");
            }

        }
        private function loadTheMovie(m:String)
        {
            var movieRequest:URLRequest = new URLRequest("../swf/" + m + ".swf");
            movieLoader.load(movieRequest);
            addChild(movieLoader);
        }

        private function closeTheMovie (e:MouseEvent)
{
        removeChild(movieLoader);
        exit_btn.addEventListener(MouseEvent.MOUSE_DOWN,closeTheMovie);
        }
        }

        }

我可以让子电影打开,但我不能让 exit_btn 关闭子电影并返回到原始状态。单击以删除子项并带您返回纹理页面时,我想要 exit_btn。闪光灯本身不会出现任何错误,只是按钮不起作用。有什么建议么?

4

1 回答 1

0

您是否将退出按钮导出到操作脚本?右键单击退出按钮,然后选择属性,然后单击名为 export for actionScript 的框。

于 2012-04-24T12:55:51.323 回答