2 Replies Latest reply on Jul 12, 2006 2:59 PM by kingtechkevin

    Button rollover issue

      Download zipped FLA

      If anyone is bored, I'm having a problem with a rollover issue in the above movie that I have been creating. It is an interactive, navigable map of city parks. Rollover of the individual dots marking park locations on the map works fine. But I am also trying to list all the parks' names on the right, where you see the "Bergen Park" button. This is so that the user can either mouse over the map locations and see the park name OR find where the park is located by mousing over the park name on the right. I want this "Bergen Park" button to cause a section of the movie clip that has an instance name of "bergen" to play, making the Bergen Park dot on the map enlarge when the "Bergen Park" button is moused over. I thought that this actionscript would do it:

      on (rollOver) {
      on (rollout) {

      But it is not working when the movie loads. Only if I mouse over the Bergen Golf Course dot on the map does the "Bergen Park" button start acting like a button. Otherwise it just gives me a text cursor when I mouse over the "Bergen Park" button. Any help would be much appreciated!

        • 1. Re: Button rollover issue
          Craig Grummitt Level 3
          had a look at your fla and didn't quite work out exactly what was "working fine" for you. a few comments on your code:

          1. don't you need a stop action on frame 92 ? otherwise it continues looping.

          2. flash is case sensitive - be careful of this - on (rollout) might work even though the correct syntax is on(rollOut), but this is because the on handler is ancient syntax (pre dot syntax). most flash syntax requires you to have the syntax case-correct.

          3. Why is each of your dot clips inside a group? They were very difficult to find. I can't think of a reason for them to be inside groups, so I'd recommend selecting all of them and breaking the group apart so that you can see where they are!

          4. The way you've structured your flash file has redundancy and is going to be a nightmare to make changes to. Imagine if you or your client decides that they want the dot to pulse twice when you rollover it. You're going to have to make that small change 42 times. Or even imagine if a URL changes for one of the buttons. There is a unique line of action-script to open that URL on every key-frame within the dot movie-clip. so changing a URL would require making that change on 6 keyframes, let alone the park name reference to it that you are building on the right. The minimum I would suggest you do is to have only one movieclip which contains the animation of the dot pulsing, and then for you to put the button event handlers on those movieclips, rather than inside those movieclips. There are even better ways you could go about this, (by storing the urls and titles in arrays, or even xml, and then placing the event handlers on the movieclips via their instance names on one frame of action-script), but this would at least remove your redundancy.

          5. but i digress... to return to your question - the text cursor appears not when you point to the bergen park button but when you point to the area between {2, 0} and {502, 20}, because this is where you created a dynamic text field:

          _root.ToolTip.createTextField("TipText", 2, 2, 0, 500, 20);
          _root.ToolTip.TipText.type = "dynamic";

          add this line after the above code:


          and your problem should be fixed...
          • 2. Re: Button rollover issue
            kingtechkevin Level 1
            Thank you very much Craig, that did it. Thanks also for the other suggestions. The grouping was an accident, I had grouped them just to move them along with the map to the opposite side of the workspace so that they would stay exactly where they should be on the map, then I forgot to ungroup them when I zipped it and wrote that post. Making the one dot movie clip sure slipped my mind and I have since made it so. Anyway, once again thank you much.