0% found this document useful (0 votes)
2 views

Actionscript New

ActionScript is an object-oriented programming language developed for Adobe Flash, initially focused on animation but later expanded to support interactive web applications. ActionScript 3.0 enhances scripting capabilities, allowing for complex applications and improved code reusability. The document outlines the history, advantages, syntax, and practical applications of ActionScript, including examples of coding for interactive elements like buttons and login forms.

Uploaded by

vinsaixnt
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Actionscript New

ActionScript is an object-oriented programming language developed for Adobe Flash, initially focused on animation but later expanded to support interactive web applications. ActionScript 3.0 enhances scripting capabilities, allowing for complex applications and improved code reusability. The document outlines the history, advantages, syntax, and practical applications of ActionScript, including examples of coding for interactive elements like buttons and login forms.

Uploaded by

vinsaixnt
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

ACTIONSCRIPT

• 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

• Flash uses a scripting language to


interpret and execute user actions. Just
as .fla files are native Flash files,
Actionscript 3.0 is the native scripting
language in flash. You can use interactivity
in your movies in several different ways.
• ActionScript is the programming language for the Adobe® Flash®
Player and Adobe® AIR™ run-time environments.
• ActionScript was an object-oriented programming language
originally developed by Macromedia Inc.
• ActionScript was used primarily for the development of websites
and software targeting the Adobe Flash Player platform, used on
Web pages in the form of embedded SWF files.
• ActionScript was initially designed for controlling simple 2D vector
animations made in Adobe Flash
• ActionScript 3.0 to create interactive projects in Flash, such as
controlling the movie’s playback and making buttons interactive in
the Flash Player.
• You enter ActionScript in the Actions panel.
Advantage of ActionScript 3.0
• ActionScript 3.0 goes beyond the scripting
capabilities of previous versions of ActionScript.
• It is designed to facilitate the creation of highly
complex applications with large data sets and object-
oriented, reusable code bases.
• ActionScript 3.0 is not required for content that runs
in Adobe Flash Player.
Understanding ActionScript 3.0
• Flash uses a scripting language to interpret and execute
user actions
• .fla files are native flash file, ActionScript 3.0 is the native
scripting language in flash.
• Flash provides different version of ActionScript.
Choose the appropriate
ActionScript version
• Flash provides different version of
ActionScript. When you open a new
document, you can choose the version of
ActionScript to use the document. You write
code very differently in ActionScript 3.0 the
most recent version, than you do in previous
version of ActionScript.
Understanding ActionScript 3.0
building books
• Learning to write ActionScript code resembles learning
any new language. In language learning, you use
vocabulary and grammar to communicate ideas. Words
are the fundamental units that combine to form
sentences, but they only make sense when you follow a
set of rules, known as syntax. In computer language,
the syntax governs the order, structure, and use of
words in a sentence of code. A complete sentence in
ActionScript is known as statement
COMMON SYNTAX
• Punctuation is critical to a scripting language. Common syntax
includes the following:

• 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

• You’ll primarily use ActionScript to control


a button’s action. The basic process is to
Flash to listen for a particular event, and
then when it hears that event, perform the
requested function.
Activities
• Play, and Stop
• Login Form
1st Activity:
• First Draw an object or shape or anything you like and convert it to a
‘Graphic’ symbol.
• Right Click on frame 1 and select ‘Create Motion Tween’.
• Click on the last frame of the tween and insert keyframe there and drag
the object or create a motion for that.
• Now insert a new layer and draw a button like shape there.
• Convert that symbol to a button and copy that and paste it two times on
the stage
• Select text tool and set the property for that as static text and type play on
one button and stop on the other
• Click on Play button and give the action script as :-
on(release){
play();
}
• Click on Pause button and give the action script as :-
on(release){
stop();
}
• Click on Stop button and give the action script as :-
on(release){
gotoAndStop(1);
}

• 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

You might also like