3 Replies Latest reply on Sep 12, 2008 2:23 PM by kglad

    Need help with MovieClip issue

    kidvolt
      The idea is to run swf files inside the viewer window using external files. The file selected via an icon/button runs. I have all that working fine. But then I moved to a slide-in/slide-out menu to pick the selections from and though the code is nearly identical it doesn't work. But I can drag one of the icons that was formerly on the stage back onto the stage and it works fine there, just not from the slide-out menu. And of course I don't have enough experience here to have a clue why not. Hopefully someone else does. Here's some code:


      // hide hidden button layer
      hidden_btn._alpha = 0;

      // import TWEEN classes
      import mx.transitions.Tween;
      import mx.transitions.easing.*;

      // create variables
      var rolled_up = menu_mc._x;
      var rolled_out = 200;

      // menu slide-out function
      function slide_out() {
      current_x = menu_mc._x;
      var anim:Tween = new Tween(menu_mc, "_x", Strong.easeOut, current_x, rolled_out, 1, true);
      hidden_btn._x=0;
      menu_mc.menu_bg_mc.enabled=false;
      }


      // menu rollback function
      function slide_in() {
      current_x = menu_mc._x;
      var anim:Tween = new Tween(menu_mc, "_x", Back.easeOut, current_x, rolled_up, 1, true);
      hidden_btn._x=-1000000;
      menu_mc.menu_bg_mc.enabled=true;
      }

      // Event handlers
      menu_mc.menu_bg_mc.onRollOver = function(){
      slide_out();
      }

      hidden_btn.onRollOver = function(){
      slide_in();
      }


      That sets up the slide menu's. Here's the code that doesn't work on the slider menu:

      menu_mc.my_btn1.onRelease = function(){

      var movLoad:MovieClipLoader = new MovieClipLoader();
      var myListener:Object = new Object();
      myListener.onLoadInit = function(thisMc:MovieClip) {
      thisMc._height = 400;
      thisMc._width = 600;
      thisMc._x = 0;
      thisMc._y = 0;
      };

      movLoad.addListener(myListener);
      }

      menu_mc.my_btn1.onPress = function(){

      movLoad.loadClip("abc.swf",blank_mc);
      }



      However, here's the code that does work if i drop an icon on the stage:

      on (release) {

      var movLoad:MovieClipLoader = new MovieClipLoader();
      var myListener:Object = new Object();
      myListener.onLoadInit = function(thisMc:MovieClip) {
      thisMc._height = 400;
      thisMc._width = 600;
      thisMc._x = 0;
      thisMc._y = 0;
      };
      movLoad.addListener(myListener);

      movLoad.loadClip("abc.swf",blank_mc);

      }


      So how do I fix the first one please? What can I provide to help illuminate the issue? And thank you!