A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Stopping the Scroll!

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    49

    Stopping the Scroll!

    I've got a moving menu that contains several thumbnails of movieClips. When you get the scrolling going and hover over a thumbnail, some text pops up. What I'd like to do is get the scrolling to stop when you hover over the movieClips (these movieClips each contain buttons to get the text to pop up). As it works now, the timeline is a bit of a pain to control in order to read the text. Here's the code:

    Code:
    onMouseMove = function(){
    	constrainedMove(bg_mc, 4, 1);
    }
    function constrainedMove(target:MovieClip, speed:Number, dir:Number){
    	var mousePercent:Number = _xmouse/Stage.width;
    	var mSpeed:Number;
    	if(dir == 1){
    		mSpeed = mousePercent;
    	}else{
    		mSpeed = 1-mousePercent;
    	}
    	target.destX = Math.round(-((target._width-Stage.width)*mSpeed));
    	target.onEnterFrame = function(){
    		if(target._x == target.destX){
    			delete target.onEnterFrame;
    		}else{
    			target._x += Math.ceil((target.destX-target._x)*(speed/900));
    		}
    	}
    }

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    If I am reading your question correctly.. you want to stop the moving a some movieClip (that scrolls onMouseMove()?....correct?) when you touch one of the movieClips/buttons inside this moving clip?

    can you remove the onMouseMove() function when you hit one of the 'buttons/clips'?

    onMouseMove = function(){
    //null
    }

    or try changing the parameters in the function call?

    onMouseMove = function(){
    constrainedMove(NULL, 0, 1);
    }

    then replacing it once you have moved off it?

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