background preloader

Flash based Mobile App Development

Facebook Twitter

ActionScript 3 Tutorials - Intermediate. Flashandmath.com Site Search Tutorials in this section illustrate objects and user interactions more complex than those in the Basic Constructs and Interactions section.

ActionScript 3 Tutorials - Intermediate

NEW! AS3 Events Properties: target, currentTarget, eventPhase, localX, localY We look at basic properties of events in AS3: target, currentTarget, localX, localY, as well as eventPhase. We provide a simple utility that displays those properties for MouseEvent.CLICK. Some results may surprise you, especially Event.target and localX, localY. Bridging the gap: writing AS3 classes Introduction to Writing and Using Custom ActionScript 3 Classes with Flash CS3 In this first tutorial, we discuss the three ways that AS3 custom classes can be used with Flash CS3. AS3 Flash: Low CPU Clouds Animation - Perfect for Mobile. In our our recent tutorial on clouds effect via BitmapData.perlinNoise and ColorMatrixFilter, we presented a nice clouds animation but very CPU intensive and not suitable for larger images or for mobile devices.

AS3 Flash: Low CPU Clouds Animation - Perfect for Mobile

Here we present a version that is extremely CPU efficient, runs very well on Android 2.2, and can be used to generate large images. In the two examples linked below we generate 500 by 380 animations. Click each screen shot or the corresponding text link to open a Flash movie. Download Download all source files corresponding to these effects: cloudsfast.zip How is performance optimized In our previous tutorial, Realistic White Clouds on Blue Sky in AS3 Flash, we presented a method for producing a continuously evolving picture of white clouds on a blue background, making use of Perlin noise and a ColorMatrixFilter.

Creating an instance of the clouds is easy: simply use the constructor as follows: Assigning dynamic/unique variable names in a for loop in AS3. Assigning dynamic variable names to objects created in a for loop in AS3. You have to get very creative to search these questions on google because words like “for” and “loop” are so utterly common. If you have a loop in AS3 creating multiple variables but need them to have unique names (for later modification) you need to create something like an array to store the references to the variables. For example, anything you create in a for loop is a temporary reference. It disappears after the loop is complete, and whatever objects were created stick around in the displayObject. In my situation I had a loop creating my navigation elements, but needed to position each X value separately.

Here is the method I used to keep the references to these variables: Now, to use those references: Now if I wanted to access those individual MovieClips I could use the mcArray to do so. Object-oriented programming with ActionScript 3.0. ActionScript® 3.0 Reference for the Adobe® Flash® Platform. The ActionScript® 3.0 Reference for the Adobe® Flash® Platform contains the ActionScript language elements, core libraries, and component packages and classes for the tools, runtimes, services and servers in the Flash Platform.

ActionScript® 3.0 Reference for the Adobe® Flash® Platform

Filter by product using the preset filters This reference combines the information about the ActionScript language elements and libraries for the following Adobe products and runtimes. Click on a product name below to filter this reference to show only the content for the latest version of that product and related runtimes: Filter by product using the filter controls. String - ActionScript® 3.0 Reference for the Adobe® Flash® Platform. Splits a String object into an array of substrings by dividing it wherever the specified delimiter parameter occurs.

String - ActionScript® 3.0 Reference for the Adobe® Flash® Platform

If the delimiter parameter is a regular expression, only the first match at a given position of the string is considered, even if backtracking could find a nonempty substring match at that position. For example: var str:String = "ab"; var results:Array = str.split(/a*? /); // results == ["","b"] results = str.split(/a*/); // results == ["","b"].) If the delimiter parameter is a regular expression containing grouping parentheses, then each time the delimiter is matched, the results (including any undefined results) of the grouping parentheses are spliced into the output array.

Var str:String = "Thi5 is a tricky-66 example If the limit parameter is specified, then the returned array will have no more than the specified number of elements. XML Basics. By Blue_Chi | Flash CS3 | ActionScript 3.0 | Beginner Using XML is one of the best ways for structuring external content in a logical format that is easy to understand, process, and update.

XML Basics

This tutorial will teach you the basics on how to load and process XML in Flash using ActionScript 3.0. You are assumed to have basic knowledge of ActionScript in order to follow this tutorial. This tutorial is for working with XML in ActionScript 3.0. If you would like to learn how to work with XML in ActionScript 1/2 then please review our previous Flash XML tutorial. Our tutorial will be divided into the following short sections: What is XML? What is XML? XML stands for Extensible Markup Language, it is a markup language used to structure data logically using tags that look very similar to HTML.

<? As you just saw, XML makes it possible for authors to create and name their tags in whatever form they choose as long as they adhere to the basic rules of the language.