ActionScript 3 samples for flash cs4 professional

Source: Internet
Author: User

These ActionScript 3 samples demonstrate various features common in Flash cs4 professional development. some samples are complete applications, while others simply introduce a concept that you can use to build your own apps. use these files to investigate how each of the samples was constructed. using e the graphics and timelines in the FLA files, and using E The ActionScript code in the associated as files.

Samples are rated beginner, intermediate, and advanced. Intermediate developers and people with prior experience in ActionScript 2 will be interested in looking at the code to see how it works in ActionScript 3.

Get the source FLA files for all samples:
    • Flash_as3_samples.zip (ZIP, 10.1 Mb)

You can also download individual source files on each sample's detail page below.

Note:You may reuse these files as you want, but they are not officially supported as part of the product. Technical support will not be able to answer any questions about these files.


This work is licensed under a Creative Commons Attribution-nonequalcial-Share Alike 3.0 unported license

The samples and related concepts are grouped into the following categories:

    • Drawing Samples
    • Media Samples
    • Component sample
    • Time Samples
    • Interactivity Samples
    • Game Samples

Drawing Samples

ActionScript 3 has access to most aspects of the SWF environment. the first step to understanding how to work with ActionScript 3 is to understand how it relates to the visual environment. SWF applications are composed of timelines (movie clips or sprites) that act as containers for content and code. in ActionScript 3, timelines are Display object containers and the visual elements within them are called display objects. the following samples into E timelines, coordinate space, and ActionScript built-in drawing and color controls:


User level:Beginner
Coordinate space, radians, and degrees
Using e timeline coordinates and the distance and angle between points.


User level:Beginner
Movie clip nesting
Please e the effects of timeline nesting and graphic placement within timelines.


User level:Intermediate
Drawing API
Using e the built-in drawing tools available in sprites and movie clips.


UserLevel:Intermediate
Color Transformations
Explore color transformations on display objects.


UserLevel:Beginner
3D Rotation
Please e the effects of animating two-dimen1_objects in 3D space.

Media Samples

Sounds, images, and text can be used to enhance the content in your project. adobe Flash Player has the ability to use external or embedded media. actionScript 3 has greater control over media usage and media related events. the following samples highlight how to use text, images, and sound in your project:


UserLevel:Intermediate
Dynamic text
Explore a simple paycheck calculator that uses flash text fields and component text inputs to Display Dynamic text.


UserLevel:Beginner
Image loading
E a simple image loader and slide show application.


UserLevel:Beginner
Image masking
Effece three types of masking effects used over bitmap images.


UserLevel:Intermediate
Sound Loading
Need e a sample that loads sounds and provides a basic set of custom controls.


User level:Intermediate to advanced
Sound Channels
Please e more in-depth sound controls in this mixing board sample.


User level:Intermediate
Dynamic sound generation
Lead e the new sound generation capabilities of Flash Player 10.

Component Samples

One of the strengths of ActionScript is its ability to create organized, reusable components. flash cs4 professional ships with a set of built-in user interface components for ActionScript 2 and ActionScript 3. you can also build your own componm components. the following sample shows built-in and custom components in action:


User level:Beginner
Video
Explore video playback using the ActionScript 3 flvplayback component.


User level:Beginner to intermediate
Custom Components
Export e a custom-built arcadebutton component with author-time live preview.

Note:To learn more about components, check out the components Learning Guide for flash cs4 professional.

Time Samples

There are waiting occasions when you need to know the viewer's local time and date or the elapsed time in a movie (SWF file ). displaying the date and time in a user interface or the elapsed time during a game or interaction is an easy way to generate interest and a sense of change. the following samples show two approaches for handling time:


UserLevel:Intermediate
Timer
Choose e an example of a stopwatch-style timer.


User level:Beginner
Clock
Using e an example of a clock that displays the computer's local time.

Interactivity Samples

Flash cs4 professional is a great tool for building games, learning interactions, and interactive environments. actionScript 3 expands the options available to developers, allowing for creative solutions to old design problems. you can use the built-in components or build custom controls to create interactive elements in your movie. the following samples create animations through a series of interactive controls:


UserLevel:Intermediate
Button-controlled movement
Lead e an interactive screen where an animation is controlled by buttons.


UserLevel:Intermediate
Slider-controlled movement
Lead e an interactive screen where an animation is controlled by sliders.


UserLevel:Intermediate
Joystick-controlled movement
Lead e an interactive screen where an animation is controlled by a virtual joystick.


UserLevel:Intermediate
Keyboard-controlled movement
Lead e an interactive screen where an animation is controlled by keyboard presses.


UserLevel:Intermediate
Click-controlled movement
Lead e an interactive screen where an animation is controlled by Click location.


UserLevel:Intermediate
Object thrust
Lead e an interactive screen where keyboard controls change the thrust of an animation.


User level:Intermediate
Scrolling background
Login e an interactive screen where sregistrers control a dynamically generated sky background.


User level:Intermediate
Inverse Kinematics
Lead e an animation built with the new inverse kinematics feature in Flash cs4.

Game Samples

The swf format is a popular medium for online game development due to its history in animation, strength with graphics, and its integrated programming language. the following samples Combine previous concepts to form more complex game applications:


UserLevel:Intermediate
Maze
Lead e a maze game where arrow keystrokes control player movement through the boundaries of a maze pattern.


User level:Advanced
Amoebas
Lead e a starship game where obstacles and laser fire are dynamically generated through building game levels.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.