package
{
import flash.display.MovieClip
import flash.events.Event
import flash.events.KeyboardEvent
public class DocumentMain extends MovieClip
{
public var _startmarker:Startmarker;
public var _player
layer;
public var _boundaries:Boundaries;
private var _vx:Number;
private var _vy:Number;
public function DocumentMain():void
{
// assing default values
_startmarker.visible = false;
_vx = 0;
_vy = 0;
// set focus for keyboard input
stage.focus = stage;
// add event listeners
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function enterFrameHandler (e:Event):void
{
// gravitate the player
_vy += 2;
// move the player
_player.x += _vx;
_player.y += _vy;
// process collisions
processCollisions();
// scroll the stage
scrollStage();
}
private function keyDownHandler (e:KeyboardEvent):void
{
}
private function keyUpHandler (e:KeyboardEvent):void
{
}
private function processCollisions():void
{
// when player is falling
if (_vy > 0)
{
// respawn if player fall of the stage
if (_player.y > stage.stageHeight)
{
}
// otherwise, process collisions with boundaries
else
{
_player.x = _startmarker.x;
_player.y = _startmarker.y;
_boundaries.x = 0;
_boundaries.y = 0;
_vy = 0;
}
}
}
private function scrollStage():void
{
}
}
}
THe problem is private function scrollStage():void WTF!! HELPP
Copyright © 2026, NextGenUpdate.
All Rights Reserved.