autoscroll AS3

by anonymous on October 10th, 2008

No notes

Syntax: ActionScript - TinyURL for this snippet: http://tinyurl.com/pkamu9
Show lines - Hide lines - Show in textbox - Download
import flash.display.*;
import flash.events.*;
 
var directionInt:Number = 1;
 
addEventListener(Event.ENTER_FRAME, function(){
	if(((test.y+test.height) < stage.stageHeight) && (test.y > 0)){
		test.y = test.y+directionInt;
	}
	else if((test.y+test.height) >= stage.stageHeight){
		directionInt = -1;
		test.y = test.y + directionInt;
	}
	else if(test.y <= 0){
		directionInt = 1;
		test.y = test.y + directionInt;
	}
											  });

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS