7 Replies Latest reply on Feb 4, 2007 9:22 PM by kglad

    Roll Over Hotspot to pop up button

    Puzzle
      I have a flash map of 1900. It has numbers on the image. I drew hotspot buttons on each number. On mouseover, I want an icon to appear that specifies the industry in that location. A click on the icon opens a popup window. My problem is that I have made the icons all invisible on load using the following code:
      this.iconBrewery_btn._visible = false;
      this.iconQuarry_btn._visible = false;
      etc, I want a mouse over to make the icon visible again. Roll off and the icon disappears. Click on the icon and the popup appears. I can do the popup part, but I can't figure out the rollover action script. I sure would appreciate some tips. Theoretically, this should be a really easy thing to do! I wrote the whole thing in HTML but I don't really like how it gets stuck so I thought I would write it over again in Flash. My HTML version is at http://cnyhistory.org/maps/1900.html but I thought a Flash version would be better. I attach the code I tried to use. The result is that the icon flashes rapidly. Very distracting. I also tried imbedding the icon in the Over state of my button and it also flashed on and off repeatedly. Any suggestions?
      Thanks,
      Karen
        • 1. Re: Roll Over Hotspot to pop up button
          kglad Adobe Community Professional & MVP
          instead of setting the _visible property to zero, set the _alpha to zero. then your buttons will be invisible and responsive to mouse events.
          • 2. Re: Roll Over Hotspot to pop up button
            Puzzle Level 1
            That was a good idea, but I must not have the right syntax. I tried the following but nothing showed up when I moused over. At least it wasn't strobing at me though.

            //Make invisible at Load
            this.OnonLake_btn._alpha = "0";
            hotspot2a.onRollOver = function() {
            OnonLake_btn._alpha = "100";
            };
            hotspot2a.onRollOut = function() {
            OnonLake_btn._alpha = "0";
            };
            • 3. Re: Roll Over Hotspot to pop up button
              aniebel Level 2
              Hi there. You don't need to use quotes on numbers unless you want it to be seen as a string. It should be:
              • 4. Re: Roll Over Hotspot to pop up button
                Puzzle Level 1
                Actually, I tried it without the quotes first and nothing showed up. Then I tried it with the quotes, same results. I thought it would work, but then again, I thought the _visible=true and _visible=false would work too and it did but the OnonLake_btn image flickered terribly while hovering over the btn. ???
                Karen
                • 5. Re: Roll Over Hotspot to pop up button
                  kglad Adobe Community Professional & MVP
                  then you have a logic problem. it may be that you have a rollover that causes another object to display and a rollout that causes that object to not display. if that's the case, you can't expect to define functioning mouse handlers for that object or the object will not display as soon as it detects a mouse event.
                  • 6. Re: Roll Over Hotspot to pop up button
                    Puzzle Level 1
                    After much hair pulling, I discovered how different doing this project in Flash is from coding it in HTML. In Flash, a hotspot is not necessary - and in fact makes the whole thing dysfunctional. When a hotspot is under a button, you can't access it by mouseover! So, I illiminated the hotspots and just did the _visible (or the _alpha) and it works! It was the logic, but not in the way Kglad thought. Flash thinks different than DreamWeaver layering. So I'm happy. My code now works!
                    this.Salt_btn._alpha = 0;
                    Salt_btn.onRollOver = function() {
                    Salt_btn._alpha = 100;
                    };
                    Salt_btn.onRollOut = function() {
                    Salt_btn._alpha = 0;
                    };

                    Thank you all for helping me figure this one out!
                    Karen
                    • 7. Re: Roll Over Hotspot to pop up button
                      kglad Adobe Community Professional & MVP
                      you're welcome.