dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Problem with onRollOut

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    8

    Problem with onRollOut

    Hi,

    I have a problem with an image that gets larger onRollOver and then goes back to its standard size with onRollOut. It works just fine if the mouse goes slow enough. However, if the mouse goes quickly it just gets stuck at a certain frame (frame 20). Does anyone know how I can fix this?

    Here is the code on frame 1:

    stop();



    top_image.onRollOver=function() {
    gotoAndPlay(2);
    }
    top_image.onRollOut=function() {
    gotoAndPlay(20);
    }

    Much appreciated!

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    8
    Anybody?

  3. #3
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    It's probably an issue with it making the rollOut and rollOver calls while the image is tweening, which changes the size of the "hit" area.

    A few different workarounds to this depending on your particular situation.

    You could put a shape under the image and make that the hotspot (instead of the image itself). put 2 keyframes in, make one the small size, one the large size and don't put a tween between them so it doesn't try to trigger the rollout or rollover during the tween.

    You could also make a large background clip that tells the image clip to get smaller if it isn't already and remove the rollout command from the image.

    Hope that helps!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  4. #4
    Junior Member
    Join Date
    Jul 2008
    Posts
    8
    Thanks flashpipe1 for the advice but its still not working.

    I have a rectangle over the image (no alpha) and have made that my target area - so the size is constant. It still does the same thing.

    I can't just make a large image in one frame and a small one in the next becuase the image needs to visibly grow from its small state to its large state when the mouse is over it, not just become large.

    Your third idea might work, but I have no idea how to go about doing it.

    Any suggestions?

  5. #5
    Junior Member
    Join Date
    Jul 2008
    Posts
    8
    To Clarify - I made the large image (the one being rolled over) as large as possible for maximum "hit" area

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center