autoscroll AS3
No notes
Syntax:
ActionScript
- TinyURL for this snippet: http://tinyurl.com/pkamu9
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; } });