dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Roll_out glitch?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    7

    Roll_out glitch?

    Hi

    I'm making a Flashbanner which shows a movietrailer on rollover. All this works fine, and so does the banner. EXCEPT!

    If you roll in and out to quickly, it's like the movie gets confused about which frames it's in, and suddenly it works 'backwards', showing the movie when the mouse is NOT on the banner - obviously to great annoyance for the user.

    I tried the 'Mouse_leave'-command but it has a weird effect and either makes the roll_over not function - or has the trailer keep playing.

    Code:
    stop();
    
    function btnOver(event:MouseEvent):void {
    MovieClip(root).main_mc.gotoAndPlay(140)}
    
    function btnOut(event:MouseEvent):void {
    MovieClip(root).video_mc.gotoAndPlay(10)}
    
    
    clicker_mc.addEventListener(MouseEvent.ROLL_OVER, btnOver);
    clicker_mc.addEventListener(MouseEvent.ROLL_OUT, btnOut);
    clicker_mc.addEventListener(MouseEvent.CLICK,function():void {
        navigateToURL(new URLRequest(getClickTag()),"_blank");});

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    Maybe you could shrink your invisible button, so that a margin of 10px can't be ROLL_OVER'ed.
    This way, when ROLL_OUT'ing, you'll always touch the actual swf banner part that's not a button, thus triggering the ROLL_OUT function.
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    7
    I'v tried this but only with a 5 px border - it still glitches when I move the cursor too fast.

  4. #4
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Give this a try:

    PHP Code:
    stage.addEventListener(MouseEvent.MOUSE_MOVEbtnOver);
    stage.addEventListener(MouseEvent.ROLL_OUTbtnOut);
    stage.addEventListener(MouseEvent.MOUSE_LEAVEbtnOut);

    var 
    mouseInside:Boolean false;

    function 
    btnOver(event:MouseEvent):void {
        if(!
    mouseInside){
            
    mouseInside true;
            
    MovieClip(root).main_mc.gotoAndPlay(140);
        }
    }

    function 
    btnOut(event:MouseEvent):void {
        if(
    mouseInside){
            
    mouseInside false;
            
    MovieClip(root).video_mc.gotoAndPlay(10);
        }

    Please use [php] or [code] tags, and mark your threads resolved 8)

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