background preloader

ActionScipt Scripting Guides

Facebook Twitter

Fluid Website. Introduction to OOP. Twice a month, we revisit some of our readers’ favorite posts from throughout the history of Activetuts+. This week’s retro-Active tutorial, first published in October 2010, is an introduction to object-oriented programming in AS3. Don't forget to check out the other AS3 101 tutorials! Object-Oriented Programming is a bit of a hot topic. More and more programming languages are cropping up that support it (Ruby, for example), and more and more languages that previously didn't support Object-Oriented Programming (OOP for short) have been released with versions that do, like PHP and ActionScript.

Some languages only work if you utilize the whole OOP thing to begin with, like Java and Objective-C. It's actually been around for a long time, but came into the limelight in the 1990's primarily due to its advantages with programming GUIs and the rise of C++ and Objective-C. Introduction If you're new to Object-Oriented Programming, you have a bit of a learning curve ahead of you. Why? Dynamic Deep Linking Website. In this tut, we will be exploring the wonder that is SWFAddress, discussing why your site should have deep linking, and the processes involved in implementing deep linking in your Flash projects. This website is XML driven. Also we shall be looking at SWFAddress's built in functions and how they are used to create the final result. Enjoy! Check out the demo above in a new window. Notice how your browser's URL changes as you navigate through the mini-site.

Step 1: Why use Deep Linking? Deep linking is a great way to structure a website and also is great way to structure code. Deep linking is basically giving the user a chance to link to a certain area of a Flash movie through a simple URL. For example if you wanted to show a portfolio to a client and you gave them the link to a Flash website without deep linking. Deep linking has other benefits (for example, SEO) and it basically turns a boring Flash movie into an expandable application. Step 2: Getting Prepared Step 3: Import, #include, what?? Learn ActionScript. O'reilly: Gentle Introduction. I'm going to teach you to talk to Flash. Programming languages are used to send information to and receive information from computers. They are collections of vocabulary and grammar used to communicate, just like human languages. Using a programming language, we tell a computer what to do or ask it for information. It listens, tries to perform the requested actions, and gives responses.

So while you may think you are reading this book in order to "learn to program," you are actually learning to communicate with Flash. But, of course, Flash doesn't speak English, French, German, or Cantonese. Flash's native language is ActionScript, and you're going to learn to speak it. Learning to speak a computer language is sometimes considered synonymous with learning to program.

What would happen if we were to say, "Flash, make a ball bounce around the screen? " Flash couldn't fulfill our request because it doesn't understand the word "ball. " Most programming has nothing to do with writing code. Snippets and hinting. Code snippets. Adobe Flash Professional CS5 has a feature called the Code Snippets panel that contains ActionScript 3 snippets that are commonly used in projects such as banner advertisements and games.

If you've been searching for an easy way to start learning ActionScript 3 and want to add simple interactivity to your projects, then you should learn about this panel. Code snippets are useful not only individually, but can be mixed and matched to rapidly create complex interactive projects. Advanced programmers can use this panel to create and store custom snippets for later use.

Each snippet comes with instructions that explain how to use it and what code in the snippet needs to be modified. Use snippets to add simple interactivity to your projects quickly, without having to know much about ActionScript. During this tutorial, you will learn how to do the following: You will also learn various tips to get the most out of the Code Snippets panel.

The following snippets are featured in this tutorial: Create an AS3 class. FLV Playback. There have been quite a few changes to the way in which you implement a custom FLV player using the NetConnection and NetStream classes in ActionScript 3. You can look at the code here to see the current ActionScript 2 implementation. The ActionScript 3 version starts out the same way by defining the NetConnection object and passing null its connect method. Also the same is the creation of the NetStream object by passing in a reference to the aforementioned NetConnection object. var nc:NetConnection = new NetConnection();nc.connect(null);var ns:NetStream = new NetStream(nc); We can finally create an embedded video object using only code! We previously had to go the library, create the object, and drag it out onto the stage. In ActionScript 3 we simple create the video object just like we do with any class that inherits from DisplayObject.

Var vid:Video = new Video(320, 240);this.addChild(vid); Once we’ve created the video object we now need to connect it to the NetStream object. Lee. Create Events. Hi, This is Sachin Patil, ActionScript developer. I am a Flash, Flex developer/designer toooo but coding is my passion. I am using this community since i am playing with Flash.I have completed my Bachelor Degree and Master Degree in Computer Science and Computer Application resp.I loved JAVA but coincidentally i meet to Flash and I got crush on Flash.Now i love Flash Coding.I am satisfied with my life and Flash....Happy living......... View all articles by sachin patil Event means action, as Mouse Clicks, Mouse Moves, Error occurs , File loads. Whatever happens means event occurs. While migrating AS 2.0 to AS 3.0 you can see you have lot of control on events. I am not theoretical guy so not able to explain you. I created an example for loading bulk of images serially.

For that, 1) I created my own event (BulkImageLoaderEvent) who tells me that all images are loaded or one image loaded and also it passes me that loaded data. 3) I have some code on timeline to pass raw data. package. EventCollector Class. ActionScript 3.0 Best Practices: Using the EventCollector Class Pascal ECHEMANN I'm an ActionScript developer in the French Riviera.I've created the Swing Package for ActionScript 3.0 (SPAS 3.0) which helps Flash developers to easily create RIAs with the Flash Platform and both Flash and Flex: View all articles by Pascal ECHEMANN SPAS 3.0 EventCollector class 1) Introduction A few weeks ago, I worked on a project based on the Youtube AS3 API and I was really surprised how Flash developers still have concerns with event management. 2) Requirements In order to go through this tutorial, we assume that you have an ActionScript 3.0 environment set-up and that you are familiar with the basic concepts of event handling.

User level: Beginning. Prerequisite knowledge: Experience in developing ActionScript OOP applications.Experience in using SWC ActionScript libraries.Experience in using an ActionScript 3.0 objects profiler is a plus but not necessary. Products: Trace. I Trace, Therefore I Know Where I Am Senior Flash Developer for US based company. I've been coding in Flash for about 7 years. I've been doing AS3 development for the passed 3 years. I have developed more than 50+ complete web and desktop applications done exclusively in Flash.

I specialize in advanced coding for the layman. View all articles by Thom Duppstadt Logical and consistent tracing is essential, particularly when it comes to large projects. As a rule, I leave enough trace to know what the program is doing without having to look at the stage... but removing those needed for a detailed troubleshooting session that has since been resolved. Trace (" * <ClassName.methodName> information to be traced"); ...For submethod data tracing. Trace (" * -- Submethod data trace"); ...then for alert traces, for example this method did a check and came up possitive for a null object. Trace ("! What's important to note here are the spaces in the beginning of the trace. Drag and Drop. Reusable classes. Make your own reusable classes using Flash and AS3 My interest in Flash started mostly because of a Jib-Jab cartoon ("This Land") in 2004.

I'm the author of a feature I call "Mazoons," which are a combination of mazes and cartoons. In 2002, I even had a book published, "Super Silly Mazes. " I'm not a professional programmer, but making my mazes interactive by programming them with Flash became a hobby/obsession of mine, to the point where I have now learned more than I bargained for. Lately I'm working on a new website about Flash and Actionscript 3.0 called The Flash Connection. View all articles by Jody Hall Let's suppose that in your programming experience, you know how to make a Movie Clip draggable with the mouse, and you also know how to write a routine to make a MovieClip respond to the arrow keys and move around the stage. Packages are just directories (or folders, if you prefer) on your hard drive. There are two ways in Flash to designate a classpath.