Processing
 

How do I escape a reserved word in Actionscript?

27/06/2012 21:26#1

Joined at: 9 months ago

Post: 3

Thank: 0

Thanked: 0

In scala one can use backticks (`) as illustrated below:

match is a reserved word so the following will not compile:

class Foo(var match: String)  

but this will:

class Foo(var `match`: String)  

Similar to the above, what does one do to escape reserved words in AS3 in the example above without using dynamic properties?

09/07/2012 17:54Top#2

Joined at: 8 months ago

Post: 2

Thank: 0

Thanked: 0

It is normally not recommended to use reserved words as part of your variables, function names, function parameters or Class names. Why? Because as in any language reserved words are meant to only be used for specific uses.

You can also always add another small word in camel case to differentiate your variable from the reserved word.

09/06/2016 02:40Top#3

Joined at: 7 months ago

Post: 1

Thank: 0

Thanked: 0

I ran into a similar problem with posting variables to paypal. For example:

URLData.return = "mystring"; 

won't work because return is a reserve word. So simply use:

URLData.['return'] = "mystring"; 
Similar articles

Open a folder in finder/explorer from a webpage?

5 years ago - Reply: 2 - Views: 80

How do I escape a reserved word in Actionscript?

5 years ago - Reply: 2 - Views: 199

Save PPS/PPT files as SWF using C#

5 years ago - Reply: 2 - Views: 171

Ways of making a graphic/visual novel in flash

6 years ago - Reply: 3 - Views: 114

Use PhoneGap + HTML5 and an Embedded Flash Movie

5 years ago - Reply: 2 - Views: 96

View word docs and PDF in browser?

5 years ago - Reply: 2 - Views: 52

ActionScript 3 Read JPEG quality

7 years ago - Reply: 2 - Views: 59

Export/Test Movie Issues

5 years ago - Reply: 3 - Views: 39

Flash always on top in Android browser workaround?

5 years ago - Reply: 2 - Views: 149

Sending Json Form from Flash AS3

5 years ago - Reply: 2 - Views: 29

parsing a swf/fla (using php?)

6 years ago - Reply: 2 - Views: 44

Getting high FPS on Flash/AIR games for mobile?

4 years ago - Reply: 2 - Views: 59

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re