Home arrow Flash arrow Using Function: The Beginner's Nightmare

Using Function: The Beginner's Nightmare

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.

Author Info:
By: Aleksandar Horvat
Rating: 4 stars4 stars4 stars4 stars4 stars / 22
October 27, 2004
  1. · Using Function: The Beginner's Nightmare
  2. · Function statement
  3. · Do you like functions?
  4. · More on reusability: practical example
  5. · Conclusion

print this article

Using Function: The Beginner's Nightmare
(Page 1 of 5 )

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.

blog comments powered by Disqus

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials