1 Reply Latest reply on May 8, 2006 9:22 AM by DazFaz

    LoadMovie and LoadClip  - Interactions are dissapearing!

      Hi,

      I've been working on this problem for a couple of days but can't seem to find a way around it. I'd appreciate any help!

      Basically, I have a swf file which contains a small slideshow, simply 5 buttons along the bottom that flick between 5 different main pictures all inside the swf. I'm trying to load this swf into a larger application so that it displays on the centre of the page. I have tried the simple LoadMovie code as follows:

      this.createEmptyMovieClip("slideshow", 1);
      loadMovie("slideMy.swf", slideshow);

      slideshow._x = 200;
      slideshow._y = 200;

      and this loads in the swf but the buttons will not work at all. I can see the swf but can't interact with it. When you move the pointer over the buttons the mouse pointer does change to the hand to acknowledge it's clickable but on clicking nothing happens.

      In an attempt to get it to work I tried using the following method:

      var myMCL:MovieClipLoader = new MovieClipLoader();
      var myListener bject = new Object();

      myMCL.addListener(myListener);
      myMCL.loadClip("slideMy.swf", 5);

      and this loads in the swf perfectly, the buttons all function no problem at all, but I can't figure out how to reposition the swf in this manner as it's not loaded into a movie clip. I've tried _level5._x = 100 but this doesn't seem to affect it at all. I also tried loading into a movieclip using this method, replacing the 5 with an instance name, but again the buttons stop working.

      So basically, i have two questions... Firstly, why are my buttons refusing to work when loaded into a movieclip? And secondly, is there any way to reposition a swf when it's loaded in using the second method. Any help would be greatly appreciated, it's driving me crazy!

      Colin.
        • 1. Re: LoadMovie and LoadClip  - Interactions are dissapearing!
          DazFaz Level 1
          Question 1
          The chances are that the buttons in the swf that you are importing might well be referring to the "_root" timeline within the clip itself. When you import an swf into another swf then the "_root" timeline then becomes the one that is importing the swf. IF that makes any sense. So your buttons are jumping up a level and not finding what ever they are looking for. The quickest way to stop this from happening is by locking the root of the movie you are importing in:
          On the very first frame on the main timeline of your slides move type:
          _lockroot = true.
          Now the down side to this is that if you want to cross communicate with the imported swf you will have to change the _lockroot= true. If there is no communication needed then this method should do the trick for you.

          Question 2
          Because you are using an object to control your import method in your second example, the only way that I know to control the positioning is to place it into a moviclip as you need to direct your postioning commands to it.

          Thats a lie, there is another very complicated way of repositioning using the object commands but if you follow the steps in Q1 above you shouldnt go wrong unless you want to get you hands dirty that is. lol

          Well its all mud to me. I hope this helps. _lockroot. Actionscripters savior