Actionscript New
Actionscript New
• Overview
• History
• What is ActionScript?
• Advantage of ActionScript
• Understand ActionScript 3.0
• Common syntax
• Action Panel
• ActionScript code
Overview
• Initially focused on animation, early versions of Flash
content offered few interactivity features and thus had very
limited scripting capability. Later versions added
functionality allowing for the creation of web-based games
and rich web applications with streaming media
• A scripting or script language is a programming language
for a special run-time environment that automates the
execution of tasks; the tasks could alternatively be executed
one-by-one by a human operator.
History
• ActionScript started as an object-oriented language for
Macromedia's Flash authoring tool, now developed by Adobe
Systems as Adobe Flash.
The first three versions of the Flash authoring tool provided
limited interactivity features.
Early Flash developers could attach a simple command, called
an "action", to a button or a frame. The set of actions was basic
navigation controls, with commands such as "play", "stop",
"getURL", and "gotoAndPlay".
ACTIONSCRIPT
• Curly braces {}
• Dot (period) .
• Slashes / or //
• Parentheses ()
• Quotation marks ““
• Semicolon ;
• Most syntax errors are the result of improper
capitalization or missing punctuation. In fact,
some developers find it best to first type open
and close punctuation, such as parentheses,
quotation marks, and braces and then use the
arrow keys to move back within the
punctuation to type the code.
Use the Action panel
• You use the Actions panel to place ActionScript code in
a movie. ActionScript must always be attached to a
frame (or included in an external file, which is a more
advanced skill). In this unit, you’ll be placing
ActionScript in keyframes. The Actions panel consists
of the Script pane, where you type code and
informational text called comments, the Actions
toolbox which contains ActionScript elements you can
drag to the Script pane, and the Script navigator,
which shows the Flash element associated with the
Enter ActionScript code
• Frame 1
stop();
• Now test your movie!
2nd Activity
• import flash.events.MouseEvent;
• stop();
• function passwordcheck(e:MouseEvent):void{
• if (username1.text=="luzzette" && password1.text=="mora")
• {
• gotoAndStop(2);
• }
• else{
• text1.text="You have entered an incorrect username/password"
• }
•
• }
• login1.addEventListener(MouseEvent.CLICK,passwordcheck);
NEXT ACTIVITIES
• WEBSITE STYLE/FORM
• CALCULATOR