Post: Flash script problem.. help?
03-04-2011, 07:30 AM #1
Snow Samurai
Climbing up the ladder
(adsbygoogle = window.adsbygoogle || []).push({}); hey boys!!! heres my problem:
im creating a game on flash professional CS5..
now ive done everything right so far but there is an error code (1126 "function does not have a body").this is beginning to piss me off! here is my script..
    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:Player;
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
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo