8 Replies Latest reply on Oct 8, 2007 10:37 PM by AScracker

    Issue in Mouse pointer

    AScracker Level 1
      Using the hit test i create the code to draw the lines inside the movieclip .but the two movieclip are very closed to each other
      so when i try to draw the lines the mouse pointer is hit on the second movieclip ,80% of the mouse(Arrow ) is be on first movieclip..... at that time it's not able drawn inside the clip
      if the whole mouse(arrow) will be inside the the movieclip means then it's drawn well
      is there any other possible way to solve this issue....

      i am ondragout,ondragover and hit test function .................

        • 1. Re: Issue in Mouse pointer
          hi AScracker,
          you can try this way that is create a very small movieclip and make that movieclip to follow the mouse arrow and check the hittest with the object you created newley instead of arrow.
          in this case even when your mouse is out of the movie clip your new movie clip what follow the mouse arrow will be inside the hitting movie clip
          i hope this will solve your problem...
          • 2. Re: Issue in Mouse pointer
            AScracker Level 1
            Hi Bala...

            In my code all the movieclip are all static position .....see what my problem is the two movieclip very close to each other(in minute pixel gap).
            if i hit the second clip the mouse pointer(that is arrrow sharp pointer is in second clip)
            remeaning portion of the pointer are in firstclip (bcoz of the Minute pixel gap between the two movie clip) ......at that that time i can't able to drawn

            if i need to draw means then again i need to click onsecond movieclip to draw the line....

            Actually this like game code that is user need to draw in the stem of the tree. main problem both the movieclip (tree) .

            • 3. Re: Issue in Mouse pointer
              balamurugan@flipdesign.in Level 1
              fine in this i will first explain how i understand and then explain the solution...
              that is when you draw a line in one tree since the next tree is so closer the focus of this tree is getting canceled and transfer to the next one because of this you want to click once again to draw once again right...

              for this type of thing you need to do some type of cheating that is like you are saying all the tree's are static position in that case what you can do is logically break the entire screen and check if it is in that particular region but if there is many tree this will grow very complex...

              the next way is you can draw the line outside the movie clip so that you can always trace the region only if the entire mouse went out of the tree by your code itself break the line... so that is appear to cut down
              • 4. Re: Issue in Mouse pointer
                clbeech Level 3
                here is an example that shows that you can actually have overlaping shapes and draw into each mc independantly. it uses a hitTest shapeflag method, and interval loop for control. place this code in a new document (it does not need any movieclips present, or on the stage) to see it operate. Adapt the methods used to your program.
                • 5. Re: Issue in Mouse pointer
                  AScracker Level 1
                  Thanks it's working fine .... But
                  What my issue in my code there are more than 14 to 16
                  1) Each Block Contain Two MovieClip
                  2) In the run time to get the current movieclip and NextMovieclip
                  I used Array store all the movieclip name in an order way .so if i click(hit) the 11 clip means the then
                  current clip is 11 and the next Clip is 12
                  3) to get the NextClip i'm Using the HitTest Methood
                  4) So it creates Problem for me... whenever i hit the clip it changes the current clip and the nextclip...
                  At that time ur code is not working for me.....

                  Can You guide me
                  • 6. Re: Issue in Mouse pointer
                    AScracker Level 1
                    with this message i attached my code..
                    can you tell me where i need to change the code

                    • 7. Re: Issue in Mouse pointer
                      clbeech Level 3
                      AS, it's very difficult to see what's not functioning here, because there are too many missing pieces of information, for instance, there are several functions that you're calling to that aren't listed here, and variables that I cannot guess how they are being assigned.

                      What I think though is that you have over complicated the issue, and that this could be accomplished in a much more streamlined manner. You'd stated that all the clips are 'static', good, and that they are listed within an array, very good, this means that you could check through all the clips with a single loop using hitTest to determine the clip to draw in. But you seem to be running too many checks, to try and isolate the clip, more that one even, as in '_global.detect' AND 'objMarkings.isAllowed' AND 'get/setActivePanelName' AND ... see I think that you could perform all of this with a simple statement loop without having to check and set all of these items.

                      If you want to simply draw into a clip, use a loop to check them all, it wouldn't matter which one is 'active' if they are all on the Stage simultaneously, but on the other hand this would still be fine too, but you could eliminate a lot of this checking. See in the code I wrote how the running interval checks both clips on each iteration, this is really all you need to do, but you could run the check with a nested FOR loop that loops through the array of clips on Stage. also the setting and passing of variables from function to function, really seems to not be necessary for what you trying to accomplish, and could be consolidated into a single script.

                      I realize you've put a lot of time into this code, but I would say that you might want to take a different approach. here's a basic script example of what I'm talking about by using a nested loop to check through an array of the clips, the names will not reflect the ones you have, this is only a basic example:
                      • 8. Re: Issue in Mouse pointer
                        AScracker Level 1
                        i tried this code but it's not working fine in my end.....