Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Date Date
Qty:
Subtotal
Promotions
Estimated Shipping
VAT
Calculated at checkout
Total
Checkout
Flash Professional Help / 

Tips for optimizing ActionScript in Adobe Flash movies

Adobe Community Help


Products Affected

  • Flash Professional

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

If speed is a primary concern, look at the visual aspects of the site. In most cases the majority of speed bottlenecks occur when attempting too many (or too complicated rendering tasks.) Optimizing the visual can achieve significantly greater gains than a slight improvement in code processing.

For optimization tips, see Streaming and file optimization techniques for Flash Player.

Some items to consider:

When possible, try not to manipulate long strings. Break the strings up into small pieces, run the string operations and concatenate the result into a final string for output. The smaller the string the faster the operation will complete.



This should also be a consideration with incoming XML data. Large amounts of XML should be broken up before loading into Macromedia Flash if possible.
If manipulating a lot of data on the client, consider using the server to pre-filter the data that the client actually sees.



Server side processing will be faster, eases the processing burden on the Macromedia Flash Player (and the viewer's CPU), and will become increasingly important as the audience for low-memory portable devices, such as PDA's and cell phones, increases.
Avoid lengthy scripts that may prevent the user from interacting with the content. If it's necessary to process a lot of information, considering breaking the processing into chunks and distributing the task across a series of frames.



One frame can do the initial calculation, set up the necessary variables, then finish processing and rendering the visuals. In the next frame pick up those variables, perform more calculation, then again allow the frame to process and render. This type of "distributed processing" may be more difficult to write and debug, but will insure a more consistent experience for your users.

On a similar note, there may be simple scripts that are being evaluated on every frame. Consider if it might be possible to run these scripts once, save their results and call them when needed instead of rerunning the script every time.

If you're controlling a large number of movie clip instances using ActionScript, consider how many times you might be repeating the same routines or resetting the same variables.



Can that information be broken out into a single custom Function? Is it possible to use a function to calculate that information once and pass it back to the clip instances instead of processing the function multiple times?

For Function details, see the definition of Function in the online Flash Dictionary

In some cases, it may be possible to achieve faster script processing by using deprecated Macromedia Flash 4 ActionScript syntax. This might achieve an immediate goal of faster code processing, but keep in mind that deprecated syntax is deprecated for a reason.



There is no guarantee that the underlying mechanisms used to achieve that speed will be around in the next revision of the Flash Player, and an extensive recoding might be necessary.

Note:Macromedia Flash Player 6 includes significantly improved ActionScript performance, eliminating virtually all the circumstances in which it would be necessary to use Macromedia Flash 4 ActionScript syntax.

Bitmaps are fixed-resolution images. They look best when one pixel of source imagery exactly matches one pixel of screen display. Because SWF streams and scales, it's rare to have this type of one-to-one correspondence.



This means you're asking the computer to create new screen pixels from groups of source pixels and draw them onscreen every time the playback moves to a new frame. Bitmap-heavy projects can be slower to redraw because of this. Make use of vectors and bitmap fills whenever possible to avoid this.

Also, it may seem simple to mention it, but any item used more than once in the SWF should be inside a symbol. This includes bitmaps, imported vector art and art created in Flash.

Looping: tight loops can be problematic. Give the player a chance to break out of the loop so it can process other actions.
Minimize simultaneous streaming whenever possible. Multiple streams cost processing power and bandwidth.If multiple streams of audio are necessary or multiple SWF's must be loaded, use a preloading technique at the beginning of the movie.



This costs more time up front, but at that point it's possible to let the viewer know that something is happening. Later in the movie a lag might be interpreted as a system problem or may lose the viewer's attention.


 
Keywords: tn_16094

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement