A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Scrolling movieClip: Loop within set area?

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    49

    Scrolling movieClip: Loop within set area?

    I've got a movieClip that's scrolling across the stage that loops nicely (kinda like the many cloud animations out there).

    I've set the clip up to stop it's scrolling on a rollOver, and start up again on the rollOut.

    My problem is that after the rollOut the loop doesn't work. The movieClip just keeps travelling. Can anyone help me in terms of the code? Tnx

    Code:
    blue.onEnterFrame = function() {
    	blue._x -= 2;
    	if (blue._x<=-0) {
    		blue._x = 864;
    	}
    };
    
    blue.onRollOver = function() {
    delete blue.onEnterFrame;
    };
    
    
    blue.onRollOut = function(){blue.onEnterFrame=function(){
    	blue ._x-= 2;}
    	if (blue._x<=-0) {
    		blue._x = 864;
    	}
    };

  2. #2
    Member
    Join Date
    Apr 2006
    Posts
    49
    BTW, this is the effect I'm after:

    http://www.bestdesigns.com.au/

    I absolutely love the fish buttons and that they will scroll/loop, but stop when you mouse over. (If I'm not on the right track with my approach to the code, please let me know)

  3. #3
    Member
    Join Date
    Apr 2006
    Posts
    49
    *bump*

    Anyone?

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    49
    *bumpity*

    Anyone? Please lend a hand! This is driving me crazy.

  5. #5
    Member
    Join Date
    Apr 2006
    Posts
    49
    *crazy bump*

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    PHP Code:
    function travel(me) {
        
            
    me.onEnterFrame = function() {
                
    me._x me._x -= me._x 864;
                
            };
        
    }
    travel(blue);

    blue.onRollOver = function() {
    delete this.onEnterFrame;
    };


    blue.onRollOut = function(){
        
    travel(this);
    }; 
    functions are useful.

    gparis

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