Avoiding reserved words and language constructs

When naming instances and variables, avoid using reserved words, which can cause errors in your code. Reserved words include keywords in the ActionScript language.

Also, do not use any word in the ActionScript 2.0 languages (called a language construct) as an instance or variable name. ActionScript constructs include class names, component class names, method and property names, and interface names.

WARNING

 

Never use different cases to avoid conflicting with reserved words. For example, naming an instance of the textfield TextField class (which doesn't conflict with TextField because Flash is case-sensitive) is a poor coding practice.

The following table lists reserved keywords in ActionScript 2.0 that cause errors in your scripts when used as variable names:

add

and

break

case

catch

class

continue

default

delete

do

dynamic

else

eq

extends

false

finally

for

function

ge

get

gt

if

ifFrameLoaded

implements

import

in

instanceof

interface

intrinsic

le

it

ne

new

not

null

on

onClipEvent

or

private

public

return

set

static

super

switch

tellTarget

this

throw

try

typeof

undefined

var

void

while

with

 

The following words are reserved for future use in Flash, from the ECMAScript (ECMA-262) edition 4 draft language specification. Avoid using these words because they might be used in future releases of Flash.

as

abstract

Boolean

bytes

char

const

debugger

double

enum

export

final

float

goto

is

long

namespace

native

package

protected

short

synchronized

throws

transient

use

volatile

 

 

 


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001093.html