1 Reply Latest reply on Aug 1, 2006 6:16 PM by Craig Grummitt

    Overlapping/Target Problem

    Level 7
      Please tell me what's wrong with my script.....

      on (press) {
      startDrag("_root.b1", true);
      }
      on (release) {
      stopDrag();
      }
      ifbOverlap:Boolean = b1.hitTest(bowl2);
      setProperty("_root.b1",_x,"182.8");
      setProperty("_root.b1",_y,"188.3");
      tellTarget("_root.WELLDONE"){
      play();
      }
      }

      If the b1 instance is dropped on bowl2, I want it to play the WELLDONE mc.

      Errors.........

      **Error** Scene=Scene 1, layer=b1, frame=1:Line 7: '(' expected
      if bOverlap:Boolean = b1.hitTest(bowl2);

      **Error** Scene=Scene 1, layer=b1, frame=1:Line 8: Statement must appear
      within on/onClipEvent handler
      setProperty("_root.b1",_x,"182.8");

      **Error** Scene=Scene 1, layer=b1, frame=1:Line 9: Statement must appear
      within on/onClipEvent handler
      setProperty("_root.b1",_y,"188.3");

      **Error** Scene=Scene 1, layer=b1, frame=1:Line 10: Statement must appear
      within on/onClipEvent handler
      tellTarget("_root.WELLDONE"){

      **Error** Scene=Scene 1, layer=b1, frame=1:Line 13: Unexpected '}' encountered
      }

      Total ActionScript Errors: 5 Reported Errors: 5

      Thanks

        • 1. Overlapping/Target Problem
          Craig Grummitt Level 3
          hmm.. would you like the short or the long(thorough) answer?
          the short answer is you'll manage to get it to pretty much work if you remove the curly bracket after stopDrag(); and remove ':Boolean'. however if i was to give you feedback on this code there are many other comments i would make if you would like it. If you would, let me know first - what version of Flash you are using?

          Also - you have submitted this post FIVE times(at least!) - please edit your other posts to show they are no longer active.