Flash
  Home arrow Flash arrow Using Function: The Beginner's Nightmare
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Using Function: The Beginner's Nightmare
By: Aleksandar Horvat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2004-10-27

    Table of Contents:
  • Using Function: The Beginner's Nightmare
  • Function statement
  • Do you like functions?
  • More on reusability: practical example
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    Iron Speed
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Using Function: The Beginner's Nightmare


    (Page 1 of 5 )

    Going past the basic stages of programming for any language usually involves the idea of modularizing code, especially when dealing with opbject oriented programming languages. ActionScript is no exception, and today we'll be getting started with functions, with a few samples to boot.

    How new is the function statement?

    Beginners and less experienced users of Flash 6 find many benefits when upgrading the Actionscript in FlashMX and Flash MX 2004. Writing Actionscript code with dozens of newly built-in objects, methods, and properties gives developers the opportunity to build high-end interactivity for both Web-based and standalone Flash applications. Many of the built in functions we’ve already used when first starting experimenting with Actionscript. Even using functions is nothing revolutionary, since we can use their full usability in combination with other Actionscript features. This article will cover the basics of creating your own functions, including some more advanced programming techniques. If you’re just starting out, you will need to take the right attitude to what you are doing and to the tools you have got offered.

    Then programming with “best practices” in mind, the programmer should centralize the code and make it as modularized as possible. This means that good programming should rely on reusable segments. Any part of application could reach and execute such segment. This is why functions are the best choice when making reusable parts of code. They can save you lots of writing, copying, and pasting through the code. The best part is that functions can be easily located and maintained in one place while affecting all objects that invokes them, without interacting with other functions and parts of code.

    Eventually your script would become more complex and you will face repeated or very similar sets of statements on different parts of the main timeline or inside the movieclip actions. This is the right time to consider placing those parts of code into a function.

    More Flash Articles
    More By Aleksandar Horvat


       · This is the most basic of introductions. S/he could have been more instructive if...
     

    FLASH ARTICLES

    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders
    - Fun Things to Do with Movie Clips in Flash MX
    - Referencing Movie Clips in Flash MX







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway