Jump to content
Search Community

loaded swf not visible

ash allen test
Moderator Tag

Recommended Posts

Hi,

Any chance someone might know why I can't see my loaded swf files.  I can hear the audio and the trace statements says they are loaded, but they are not visible.  I'm guessing it has something to do with the container.  I'm hoping you can see something obvious in my code.

Thanks.

 

public class Main extends MovieClip
    {
        private var currentSWFLoader:SWFLoader;
        private var swf1:SWFLoader = new SWFLoader("movie1.swf", {container:movieTwo_mc, autoPlay:false,  width:480, height:480, x:300,scaleMode:"proportionalInside",onComplete:completeHandler});
        private var swf2:SWFLoader = new SWFLoader("movie2", {container:movieTwo_mc, autoPlay:false, width:480, height:480, x:300, scaleMode:"proportionalInside",onComplete:completeHandler});
       

        public function Main()
        {
            homePage_mc.movieOne_btn.addEventListener(MouseEvent.CLICK, loadOne);
            homePage_mc.movieTwo.addEventListener(MouseEvent.CLICK, loadTwo);
        }

        //LOAD MOVIE ONE;
        private function loadOne(event:MouseEvent):void
        {
            trace("one");
            currentSWFLoader = swf1;
            currentSWFLoader.load(true);
            homePage_mc.movieOne_btn.removeEventListener(MouseEvent.CLICK, loadOne);
        }
        private function loadRed(event:MouseEvent):void
        {
            trace("two");
            currentSWFLoader = swf2;
            currentSWFLoader.load(true);
            homePage_mc.movieTwo_btn.removeEventListener(MouseEvent.CLICK, loadTwo);
        }     

        function completeHandler(e:LoaderEvent):void
        {
            trace(e.target + " loaded");
            e.target.rawContent.play();
            homePage_mc.visible = false;
            btnListener();
        }

        private function btnListener():void
        {
            home_btn.addEventListener(MouseEvent.CLICK,resetScreens);
        }


        //RESET SCREENS;

        public function resetScreens(event:MouseEvent):void
        {
            currentSWFLoader.unload();
            home_btn.removeEventListener(MouseEvent.CLICK,resetScreens);
            homePage_mc.visible = true;
            trace("reset screens");
        }

    }

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...