0 Replies - 3005 Views - Last Post: 14 November 2012 - 07:35 PM

#1 Redbird5  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 67
  • Joined: 07-July 12

Automatic slide show

Posted 14 November 2012 - 07:35 PM

I have some code that I would like to add an automatic slide to. Right now the slide show works if you mouse over it, but I would like it to change every three to five seconds.

var verticalCenter:Number = stage.stageHeight / 2;
var limit:Number = stage.stageHeight - content_mc.height; 
var speed:Number = 0.1;
var scrollY:Number = 0;

addEventListener(Event.ENTER_FRAME, scrollContent);

function scrollContent(e:Event):void {
	scrollY = - speed * ( mouseY - verticalCenter ); 
	content_mc.y+= scrollY; 
	if (content_mc.y>0) { content_mc.y= 0;}
 	else if (content_mc.y< limit) { content_mc.y= limit; }
}


Is This A Good Question/Topic? 0
  • +

Page 1 of 1