|30 August 2007
Flash 9, Flex and AS3 have been out for awhile now, but a lot of client development work must done with Actionscript 2, to be viewable with Flash 7 or 8 players. Here's a primer on using EventDispatcher to communicate between classes, and a class-based revision of the dart shooter game.
|Structure/purpose of flash-creations.com
Sample content: what is Flash, make a site, Actionscript basics, XML, load photos or swfs, simple game, Flash with MySQL & PHP, SVG & Flash.
You can search on any term with the box above, or look at the Notes Index page for a list of all pages.
|Often recommended on the flashcoder list: "Sooner or later, all programmers run into coding issues that will require an understanding of mathematics or physics concepts like collision detection, 3D vectors, transformations, game theory, or basic calculus. This book provides a simple but thorough grounding in the mathematics and physics topics that programmers need to write these algorithms and programs, using a non-language-specific approach."|
8 August 2007
Here's an introduction to using Flash ActionScript 2 with the Yahoo! Maps API. The sample includes a call to get the latitude and longitude for a specified input address, display it on a map, and drag the marker on the map to to see how the latitude and longitude change. Useful for map admin.
19 November 2006
Need an easy way to implement a series of tweens? This sample uses Moses Gunesch's Fuse class to do sequential tweens. Fuse provides a nice straightforward alternative to coding separate functions for each onMotionFinished event, as I did with this same sample previously. In this version, I also changed the data source for the sample to be an array of objects.
28 Oct 2006
A revision of an earlier sample; this one uses Flash as a preprocessor to create an actionscript array of global elevation data (from NOAA) for a particular quadrant on a map, which is saved in a swf for fast access by the Flash movie that displays the map. You can compare the speed with the original June 4 version to see the difference.
|7 Oct 2006|
How to use duplicateMovieClip or attachMovie to make a bunch of different views of an image and create a funhouse-mirror distorting magnifier. Also updated the Flash detection page with notes about using SWFObject to avoid users having to click multiple times with Flash in Internet Explorer.
|19 Sep 2006|
Added a new page on using onEnterFrame and other event properties, and the use of "this" in event handler functions. Updated the code in the sample at the bottom of the previous event handlers page to use named functions.
|2 Sep 2006|
Added new pages to the beginning of the Actionscript Basics section to provide more detail on how to create button-like controls that control other movieclips by the use of gotoAndStop and gotoAndPlay for movieclips with keyframe-defined states and sequences, play and stop for continuously looping movieclips, and movieclip properties and the Tween class for single-frame movieclips.
18 Jul 2006
A look at creating a two-level menu with eased category-level options and sub-options: on click, selected button is highlighted, corresponding photo fades in.
13 May 2006
Added a couple more examples and some explanation to the page on controlling a group of buttons. One is free to download, the other I've added to the zip file available previously.
9 May 2006
Using a PHP script with Flash to display all jpgs in a directory.
Page includes actionscript and PHP code.
|1 Apr 2006|
Six ways to scroll text: click and hold, scrollbar, by line of text or by pixel.
|25 Mar 2006|
Added a fifth page in the series on creating a dynamic data-driven application:
23 Mar 2006 Posted a page with information about timers, counters and delays.
|18 Mar 2006|
Example of drifting snowflakes using attachMovie to dynamically add movieclips to the stage at runtime.
|3 Mar 2006|
Put notes for the Flash detection used for the front page of this site into the Flash detection page.
21 Feb 2006 Added a page to the site with a sample code framework that may be used for procedurally-based code (as is used throughout the AS Basics section) and which is extensible to class-based code. Modified the TV player example on the toggle button page to use this structure, and to explain the steps of populating each section.
|18 Feb 2006|
Added several sections to the MovieClipLoader page to explain how a MovieClipLoader instance and its associated Listener work together when loading external jpgs or swfs into a Flash movie.
16 Feb 2006 Added a section on functions to the Code blocks page.
12 Feb 2006 Changed the LoadVars page to use one LoadVars instance for sending data and another for receiving, so the sending instance won't have extra onLoad garbage attached to it.
2 Feb 2006 Added a third example (a swf video player) to the Toggle Button page to show use of two keyframes in a control to display different states, and use of _currentframe to track the state. Cut-and-paste code framework also included on page.
|31 Jan 2006|
Updated the sliding photo viewer code to fix a problem with thumbs shifting and to make the mask size & position independent of the thumbnail movieclip. Cut and paste code included. The page was originally posted 20 Sept 2005, as an extension of the simpler photo viewer which uses the drawing API, createTextfield and the movieClipLoader to create a photo viewer from scratch
27 January 2006 Redid the clock sample on the Date page.
22 January 2006
Embellished the dynamically generated pie chart example a bit to make each wedge stand out from the others on mouseover. Cut and paste code included.
Also revised the actionscript code in the second example on the LoadVars page to get rid of an extraneous "else". Thanks to Jon Bauer for noting there was a problem.
20 January 2006
In preparation for the first session of DM3260, I've revised the actionscript syntax intro page to use with either Flash 8 or Flash MX 2004, and to simplify the movieclip nesting in the bee game sample. Free downloadable start fla, finished fla available by subscription.
17 January 2006
Revised the datagrid-AMFPHP remoting example to sort correctly, per suggestions by Patrick Mineault. Fla and php files now downloadable too.
18 December 2005
Use the Color class to make twinkly lights and color transitions (Flash MX & MX 2004). Also added recently to the Tween class sample: perpetual motion using the Tween class.
18 November 2005
Here's a sample that displays records from a MySQL database with the datagrid component, and allows insertion and deletion of records using PHP scripts and Flash MX 2004 components. Includes notes for doing a custom sort on nickname and score fields.
13 November 2005
It's that darn bird again: this time he's an AS2 bird, produced from an SVG file and drawn and colored in the Flash movie with Animation Package (also reproduced as is in Flash without AP).
6 November 2005
Control the jumping green man with Flash MX 2004 v2 components -- an intro to some of the UI components, including checkbox, radio buttons, pushbutton, textarea, combobox.
28 October 2005
The Tween class in Flash MX 2004 makes it possible not only to produce a scripted tween with easing, but to trigger a sequence of tweens by using the onMotionFinished property. (Updated 10/30 to use the Tween stop method to interrupt a tween in progress.)
|20 October 2005|
This emailer sample shows how to associate one class with a contact form and use another to deal with server communications. EventDispatcher handles communications between the two, and Delegate makes sure event handlers are scoped to the right class instead of to the component that triggered the event.
|19 October 2005|
Put up experiments from 2002 on ways to save shapes drawn in a Flash movie, with zip of actionscript 1 (Flash MX) files included. One way saves a big array of points (reducible with Martin Wood's optimizer), the other saves a series of quadratic bezier curves. Output includes SVG text and shared objects.
|14 October 2005|
Using Michelle Holder's creative rendition of the dart shooter game, this page shows how to control sound in a movie using instances of the Sound class and a simple home-grown volume control.
|12 October 2005|
Nothing says "Put me to sleep this instant" like a page about ActionScript operators, eh? But you can't program without them, so here are some examples, with a bit of explanation. If that doesn't put you to sleep, maybe this lookup table with AS - PHP equivalents will do the job (posted 24 Oct 05 because I find that I need it all the time).
|5 October 2005|
Reworked the interactive pie chart example that used to be at astb. Uses the drawing api, an external data file and event handlers to create the chart in a blank movie.
Started the Flash-Server Communications section, with pages on LoadVars (examples with PHP) and reading an external data file.
|1 October 2005|
Wrote up notes for the Dart Shooter game we looked at in class this week, in which dragging and collision detection are applied, along with a look at how to use Math.random to make game elements more interesting. The fla and as files are available as a free download from the notes page.
|30 September 2005|
Added a page about dragging movieclips and two kinds of collision detection.
Also put up a Key class page to show how to handle keyboard interactions.
|23 September 2005|
The bounce and collide sample is one of my favorites from astb, even though it was done almost 3 years ago. The sentries-around-the-edge idea is still a valid collision detection method.
21 September 2005
Began posting previous content from astb, as is, including the 3d outlines sample (the "rotating vase thing")
|15 September 2005|
This page has information on what XML is, when to use it with Flash, and how to read it and convert it to a useable structure. Free downloadable sample fla and xml file used with v2 components also available on that page.
|30 August 2005|
Began updating and moving content from actionscript-toolbox.com to this site, including the Math class page. Items previously under the "tools" section will now be in the AS Classes section.
|30 June 2005
Revised the intro sections (Intro through Publish) of this site for the fourth time for teaching the summer session of Intro Flash at the Corcoran, in which we build a sample website with the structure shown at left. (Updated 9/20/05 to Site Structure 2 -- how to make the same movie using external swfs for each of the website sections.)