开发者

hitTestObject, stopDrag stops drag on two movieclips even though function states one movieclip to stop drag

开发者 https://www.devze.com 2023-02-28 20:37 出处:网络
I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they a

I have a function that states when movieclip1 is dragged and hits a line then it stops the drag, however it seems to stop the entire drag function in the swf on the other movieclips even though they arent called in the function. Can somebody please help me with this.

Regards T

Here is the code:

开发者_StackOverflow function hitTest(event:Event):void
 {
 if (movieclip1.hitTestObject(line))
   {
 movieclip1.stopDrag();
   }
 else
   {

   }
 }


Are you absolutely positive you only have one instance of movieclip1 on your stage? Definitely double check. Are you creating them dynamically, or are they preloaded when your SWF loads?

If they're preloaded:
Perhaps during testing you made some quick copies of it, and now those copies have the same name and they're all responding the same. That's my first guess.

If they're loaded dynamically:
Check the function where they're being created. If you're naming them in a loop (with a number on the end like the above), be sure that you're properly increasing the numeric value used on the end.

0

精彩评论

暂无评论...
验证码 换一张
取 消