A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to stop scrolling mc disappear off edge of stage?

  1. #1
    Junior Member
    Join Date
    Feb 2002
    Posts
    19

    How to stop scrolling mc disappear off edge of stage?

    Help!

    I've being going crazy trying to work out how to stop a scrolling movieclip stop scrolling when it reaches the edge of the stage, using Flash 8.

    I've been trying to work out an IF function that detects if the ._x is =< 1, which - if I could get it to work, would either

    A) Simultaneously stop the scrolling and make the right scroll button disappear

    or

    B) Seamlessly generate a copy of the scrolling movieclip appear at the end of the disappearing one to give the impression that it was endless

    Can any one PLEASE help?

    My file is online at http://www.fortescueonline.co.uk/move.fla
    Lily

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    try this:

    1.) change yo FPS to NOT be 12..use something like 33

    2.) you mov_thumbs.. edit it.. so its not in the middle/centered..have the edge start at X:0

    3.) use this code:

    PHP Code:
    stop();
    but_right.onRollOver = function() {
        
    mov_thumbs.onEnterFrame = function() {
            
    this._x += 4;
            if(
    mov_thumbs._x >= 0){
                
    trace("edge reached");
                
    delete mov_thumbs.onEnterFrame;
            }                    
        };
    };
    but_right.onRollOut = function() {
        
    delete mov_thumbs.onEnterFrame;
    };

    but_left.onRollOver = function() {
        
    mov_thumbs.onEnterFrame = function() {
            
    this._x -= 4;
            if((
    mov_thumbs._x mov_thumbs._width) <= Stage.width){
                
    trace("edge reached");
                
    delete mov_thumbs.onEnterFrame;
            }
        };
    };
    but_left.onRollOut = function() {
        
    delete mov_thumbs.onEnterFrame;
    }; 

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