| [ Web Proxy ] |
| Viewing: https://riptutorial.com/actionscript-3/example/9466/type-casting | [Back] [Original] |
[logo rip]
Type casting is done with either the as operator:
var chair:Chair = furniture as Chair;
Or by wrapping the value in Type():
var chair:Chair = Chair(furniture);
If the cast fails with as, the result of that cast is null. If the cast fails by wrapping in Type(), a TypeError is thrown.
| Web Proxy Viewer | New URL | Original Page |