2 Replies Latest reply on Jul 12, 2010 5:45 AM by Kwangle

    Detecting RollOver Without Button

    Kwangle Level 1

      Hi All,

       

      I have made a movie that loads many sub movies into itself and I want an information box to appear  when the mouse pointer rolls over each movie. Some of the movies just play and loop so to get the box to pop up I just load the movie then attach an invisible button over it in the same size and position, which works fine. The problem is that some of the movies are interactive and have internal buttons that respond to the mouse rolling over them, so if I put a external button over them their interactivity is blocked. I also want to avoid putting custom code that targets the parent movie into the loaded movies so I don't have to adjust every movie I want to load. Is there a way to keep the interactivity of the loaded movie but still detect a mouse rollOver?

       

      The scale and position of the loaded movies changes continually, but the only way I can think of of achiving what I want is to write code that continally calculates the size and position of the loaded movies and compares the position of the mouse pointer with them and brings up the info box if a hit is detected. This would be fairly complex - is there an easier way?

       

      Thanks.

        • 1. Re: Detecting RollOver Without Button
          Ned Murphy Adobe Community Professional & MVP

          Continuously checking the mouse position against the loaded movies is probably your best bet.  If you are loading the movies dynamically, then it might be easier for you to have the dimension information stored with along with whatever other data you use to load the swf's.

          • 2. Re: Detecting RollOver Without Button
            Kwangle Level 1

            Thanks for your help.

             

            I've started coding the checking function and it's working quite well. The size and position data was already stored in arrays so it was a matter of running a loop ro retrieve it and do a few calculations to get the position on screen and size of each ad and checking if the mouse pointer was in that area. The code had to take account of the fact that the ads were loaded into a parent movie clip which has a variable scale, and the ads themselves were also scaled a uniform amount inside that clip. Not too hard to code but only works with rectangular areas - would be very difficult with non-geometric shapes!