7 Replies Latest reply on Mar 25, 2012 11:41 AM by robdillon

    fl_ProLoader Help

    AlexanderKaran

      I was wondering if i could just ask for you help o this thing i am doing in

      flash as i cant get the code to work, i need to swf file to unload when i

      press any key on the keyboard

       

      So when your on frame 30 you click an image and it takes you to frame 35 and

      load the video in a container with this code

       

      movie1_btn.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);

       

      import fl.display.ProLoader;

      var fl_ProLoader:ProLoader;

       

      var fl_ToLoad:Boolean = true;

       

      function fl_ClickToLoadUnloadSWF(event:MouseEvent):void

      {

        if(fl_ToLoad)

        {

            fl_ProLoader = new ProLoader();

            fl_ProLoader.load(new URLRequest("Movie1-FullVersion.swf"));

       

            gotoAndStop(35);

            preholder.addChild(fl_ProLoader);

       

        }

        else

        {

            fl_ProLoader.unload();

            removeChild(fl_ProLoader);

            fl_ProLoader = null;

       

        }

       

        fl_ToLoad = !fl_ToLoad;

       

      }

       

       

      Then when your on frame 35 you press any keyboard key to return to frame 30

      but i cant get the code right so that it also unload the swf file

       

      here is the code i use to return

       

      stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_KeyboardDownHandler);

       

      function fl_KeyboardDownHandler(event:KeyboardEvent):void

      {

       

        trace("Key Code Pressed: " + event.keyCode);

       

        gotoAndStop (30);

       

       

      }

       

       

      what code do i need to put in there to unload?

       

      Please help as i am really stuck on this and its giving me a headache, iv

      tried so many combinations

       

      Thank you

       

      Alexander