Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » AutoScroll with and without MouseOver


AutoScroll with and without MouseOver

Reply
  #1 (permalink)  
Old 06-19-09, 03:09 PM
kaceykeleher kaceykeleher is offline
Newbie Coder
 
Join Date: Mar 2009
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
AutoScroll with and without MouseOver

Hello, all!

I'm currently working on a website that I'm doing in Flash CS4, and I'm building an animation that I need to auto scroll when the mouse is not over it, and when it is to scroll according to the mouse position.

So far, I have it so the animation scrolls left and right with the mouse, and I can set it to scroll left or right when the mouse is out of the animation, but what I would like is for the animation to continue to loop as well. I'm not sure what information I should provide for a better understanding, so anything you may need just ask and I will give it to you.

Otherwise, I've attached the .swf and .fla file, and it should help with what I'm attempting. It scrolls left or right with the mouse, but ends at a certain position on both sides, and I would like it to continue to scroll infinitely both ways.

This is my ActionScript for the controller movie:

Code:
onClipEvent (enterFrame) {
	
	var speed:Number;
	speed = 15;
	
	var speed2:Number;
	speed = 5;

	var leftLimit:Number;
	var rightLimit:Number;
	leftLimit = 1160;
	rightLimit = -1350;

	var leftMouse:Number;
	var rightMouse:Number;
	leftMouse = 100;
	rightMouse = 650;
	
	_root.arrow_mc._x = _root._xmouse;
	_root.arrow_mc._y = _root._ymouse;
	
	if((_root.solutionsContainer._x < leftLimit) && (_xmouse > rightMouse)){
	   		_root.solutionsContainer._x = _root.solutionsContainer._x + speed;
			_root.arrow_mc.gotoAndStop("goRight");
	   }
	   
	   else if((_root.solutionsContainer._x > rightLimit) && (_xmouse < leftMouse)){
			_root.solutionsContainer._x = _root.solutionsContainer._x - speed;
			_root.arrow_mc.gotoAndStop("goLeft");
	   }
	   
	   else {_root.arrow_mc.gotoAndStop("select");
	   		_root.solutionsContainer._x = _root.solutionsContainer._x - speed2;
			_root.arrow_mc.gotoAndStop("goRight");
	   }
	   
}
Anyone have any advice for me?
Attached Files
File Type: zip solutions.zip (36.7 KB, 119 views)
__________________
"Where's that Peter Griffin? He told me he'd give me a hundred fifty bucks if I took off all my clothes off." - Peter Griffin, Family Guy

W3Schools - You'll be surprised what you can learn on your own!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 06:43 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.