5 Replies Latest reply on Oct 4, 2007 5:51 PM by puks_07

    _droptarget

    puks_07
      Hi guys,

      I am just wanting to know how to do, hopefully something simple.

      I have a logo which I can drag around the screen. When I drop this logo over a particular area I call a fuction to run. This works perfect except the fact it doesnt work, if that makes sence.

      When I drop the logo over an area the function runs for the home page but I am loading an external swf file into a container and the external swf has set "drop zones". The function runs but for the whole loaded swf not just the "drop zones".

      Below is the code I am using:

      onRelease = function() {
      stopDrag();
      if (_root.mov_logo._droptarget == "/mov_home_drop") {
      trace("Logo")
      unloadMovie ("_root.mov_content_holder");
      loadMovie("slideshow.swf","_root.mov_content_holder");
      loadMovie("frank_says.swf","_root.mov_frank_animation_holder");
      }else
      if (_root.mov_logo._droptarget == "slideshow.swf", main.sequences.sequence1.mov_mp3_1){
      trace("MP3 1");
      }
      }

      Can someone please help me fix this?

        • 1. _droptarget
          Level 1
          i think the problem is that u're using "slash-syntax" which is not supported since flash 5

          according to flash help documents of _droptarget, it recommand using eval() function to convert the returned value from slash syntax to a dot-syntax reference.

          try rewrite
          if (_root.mov_logo._droptarget == "/mov_home_drop") {
          as
          if (_root.mov_logo._droptarget == eval("/mov_home_drop")) {
          or
          if (_root.mov_logo._droptarget == _root.mov_home_drop) {

          u may use trace() in your target MC to get the correct path

          also your loadMovie() seems provided wrong parameters
          the second parameter of loadMovie() should be an "object reference" but not a String, simply remove the double quote
          hope it helps u
          • 2. Re: _droptarget
            puks_07 Level 1
            This is starting to really do my head in a little. I just dont know why its not working.

            I am now trying to get it working in the external swf before I load it but still having the same issue as the external swf is importing movie clips.

            The root movie is calling an instance called main which is calling an instance called sequences which is calling an instance called sequence1, sequence2, sequence3 etc.

            I thought

            _root.mov_drag_me._droptarget == _root.main.sequences.sequence2.mov_mp3_3

            mov_mp3_3 is the drop area clip, would work but it doesnt.
            • 3. Re: _droptarget
              puks_07 Level 1
              Can anyone else help on this issue?
              • 4. Re: _droptarget
                Level 1
                have u trace your mov_mp3_3 on the root swf to see if u get the correct path by
                trace(_root.main.sequences.sequence2.mov_mp3_3)
                or place the scrip below on mov_mop3_3 then run your root swf
                trace(this)
                if your path is correct, since mov_mp3_3 is a movieclip, try using hitTest(), it maybe works
                furthermore, learn MovieClipLoader Class instead of using loadMovie(),
                MovieClipLoader makes much easier to control external swf and much powerful then loadMovie()
                • 5. Re: _droptarget
                  puks_07 Level 1
                  Hi, can I send you a private email with my source files for you to have a quick look at if you have time?

                  Thanks