Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ActionScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===ActionScript 3.0=== ActionScript 3.0 has a similar syntax to ActionScript 2.0, but a different set of APIs for creating objects. Compare the script below to the previous ActionScript 2.0 version: <syntaxhighlight lang="actionscript3"> var txtHello: TextField = new TextField(); txtHello.text = "Hello World"; this.addChild(txtHello); </syntaxhighlight> Minimal ActionScript 3.0 programs may be somewhat larger and more complicated due to the increased separation of the programming language and the Flash [[integrated development environment]] (IDE). Presume the following file to be {{Mono|Greeter.as}}: <syntaxhighlight lang="actionscript3"> package com.example { import flash.text.TextField; import flash.display.Sprite; public class Greeter extends Sprite { public function Greeter() { var txtHello: TextField = new TextField(); txtHello.text = "Hello World"; this.addChild(txtHello); } } } </syntaxhighlight> {{See also|Sprite (computer graphics)}} ActionScript 3 can also be used in [[MXML]] files when using [[Apache Flex|Apache's Flex]] framework: <syntaxhighlight lang="mxml"> <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/mx/polysylabi" xmlns:mx="library://ns.adobe.com/flex/mx" layout="vertical" creationComplete="initApp()"> <fx:Script> <![CDATA[ public function initApp(): void { // Prints our "Hello, world!" message into title title.text = "Hello, World!"; } ]]> </fx:Script> <s:Label id="title" fontSize="54" fontStyle="bold" /> </s:Application> </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)