jSoftApps jSoftApps - 1 month ago 8
ActionScript Question

ActionScript Syntax Errors

I need some help solving some compile errors.

I was following a tutorial (at http://www.youtube.com/watch?v=E8oM808ETWs) and typed down all of the code displayed in the video. When I tried to publish, I was presented two compile errors:


Scene=Scene 1, layer=action, frame=1, Line 16 '{' expected

Scene=Scene 1, layer=action, frame=1, Line 33 Syntax error.


Here is the code that I have

import flash.external.ExternalInterface
import gfx.motion.Tween
_global.gfxExtentions = true;

var angle:Number;

function init()
{
_root.Health._yrotation = 30;
_root.Ammo._yrotation = 30;
angle = 0;
}

init();

_root.onEnterFrame = function();
{
angle +=0.1;
var sined:Number = Math.sin(angle) + 2;
sined /=2;

_root.Health.Title._z = -200 * sined;
_root.Health.Bar._z = -500 * sined;
_root.Health.Value._z = -200 * sined;
_root.Health.Background._z = 200 * sined;

_root.Ammo.Title._z = -200 * sined;
_root.Ammo.Bar._z = -500 * sined;
_root.Ammo.Value._z = -200 * sined;
_root.Ammo.Background._z = 200 * sined;

_root.Weapon._z = -200 * sined;
}

Answer
_root.onEnterFrame = function(); // <-- lose this semi-colon
{
Comments