Holiday Reading

A bit of light holiday reading for me while up at Rarawa Beach on the North Islands East Coast. Can’t beat a dose of Essential ActionScript 3!

Holiday Reading

Simple ActionScript 2 XML Gallery

Sample Flash file for a very basic bare bones XML gallery with a scrolling thumbnails track, and simple load progress handling. This example is really meant as a basis to build something more elegant and interesting on. In that sense, it provides a skeleton for a site, and it is up to you, as a user of the file to skin it.

This file started life as a comparison to an ActionScript 3 implementation of the same idea. The ActionScript 3 version is more elegant and is slightly more flexible.

Gallery Features;

  • Horizontal or Vertical Scrolling Thumbs track
  • External XML Images
  • Load Progress Handling
  • Ability to load in different XML files

The source file contains two files, one file has a horizontal image scrolling track, while the other has a vertical images scrolling track.

View Example
Example can be viewed here;?Ǭ† http://www.noponies.com/dev/as2_simple_gallery/ (Note, no progress loading implemented)

Source Files
Here are the source files; ActionScript 2 Simple Gallery Files

Dependencies
File uses TweenLite, for image fading in and out.
Flash 8 or Flash CS3

ActionScript 2 Sliding Images Gallery

This file is a demo of a sliding images gallery, as used on my work site, http://www.thereformation.co.nz.

Basically images are loaded sequentially from an XML file into a movieClip, which is dynamically masked and then tweened. The gallery has support for text descriptions and also creates a dynamic image numbers navigation system which updates itself based off how many images you happen to load in. All text is CSS styled.

Contained in the .zip file are a Flash CS3 and Flash 8 source file, XML files, sample images, the tweenFilterLite class and the font used in the project.

Updates
09 June, 2008. File now supports multiple XML files

View Example
View an example of the project here; http://noponies.com/dev/slideimages/ (no preloader, 36k file size)

Source Files
Grab source files here; Sliding Images Gallery Source

Dependencies
TweenFilterLite http://www.tweenlite.com
Flash CS3 or Flash 8

ActionScript 3 XML Accordion Menu

This menu system was written as a means to display images or other content in a condensed manner.

Class based ActionScript 3 Accordion Menu, with either a rollOver/RollOff activation scheme for a onRelease activation scheme. Menu is built using a custom event dispatch scheme to keep each menu item synchronised with the changing states of the menu. The menu grabs a reference to the Stage via the ADDED_TO_STAGE event, which is uses as its base for setting up the communication between menu elements.

Menu Functionality

    Support for Images and Swfs as content.Swfs can contain their own interactivity.Either Click or MouseOver menu to activate it.XML Driven.XML can contain function calls with parameters, or URLs or nothing.Menu Highlighting is an option.Either the whole menu item, or just the menu bar can be used to trigger menu movement.Menu supports content of differing sizes. Menu will auto size the menu bar width, but is content height agnostic.Support for placement.Support for spacing between menu items and menu bar item height.Menu Bar has a test element, pulled in from the XML file.Column support. But you will have to add that change yourself.Menu uses either tweenLite or tweener for menu movement.Custom Event Dispatch class for sending events to particular menu instances. Eg, for telling one menu to slide open after all have loaded.Class has a reset method, should you need to reset the menu

If you are going to get the menu to trigger events it is generally it is better to only use the bar, so as to not interfere with your other nested actions.

Menu is a class file, which relies on be passed three values in its constructor,?Ǭ† (loader content, title text, menu action), all of which are values that are pulled in from the XML file.

Included in the download are two folders, one?Ǭ† accordianAS3_rel contains the onRelease version of the class. The other, accordianAS3_roll contains the RollOver version of the class. In each folder are each classes respective Flash CS3 document, its associated Document Class file, an XML file, an XML parsing class, the tweenLite Class and images and swfs.

Updates10th Feb, 2008: Added custom event dispatch class to both examples.

View ExamplesActionScript 3 XML Accordion Menu: On Release VersionActionScript 3 XML Accordion Menu: On RollOver Version

Source FilesHere are the source files; ActionScript 3 XML Accordion Menu V2

DependenciesClass uses the tweenLite tweening class for menu movement, highlighting etc; http://www.tweenlite.com

ActionScript 2 ToolTip Class

Simple ToolTip Class based off Lee Brimelow’s?Ǭ†http://theflashblog.com/?p=16?Ǭ†old ToolTip class.

I extended this as an exercise when helping out a poster on the?Ǭ†Kirupa.com?Ǭ†forums. I’ve added in support for a dropShadow beneath the tooltip. Support for different amounts of text ( the toolTip is still single lined, but it expands depending on text amount). And support for detecting the edge of the stage, so that the toolTip will flip horizontally if it would end up being displayed off the right hand edge of the stage, thus becoming unusable.

View Example
Here is an example;?Ǭ†http://www.noponies.com/dev/tooltip/
Source Files
Here are the source files;?Ǭ†ToolTip Source files
Dependencies
Flash 8 or CS3

ActionScript 3 Print all Items on Stage

Simple class for printing all items on the stage. Along with another class for printing from a contextual menu. Something to note, is that the Flash player wont allow you to add your own “Print” menu item, it seems that is a reserved keyword. Which makes sense.

This class is probably a dirty hack.

This has only been tested when being instantiated from either a document class, maintimeline or via a custom menu class.

Basically what this does is create a temp empty sprite, loop through all instances on the stageand add them to this temp sprite, then print this temp sprite as the print job class accepts only a single sprite as an argument. (unless I’m missing something?). When the print job has been sent the objects are removed from the temp sprite and added back to the stage. The temp sprite is then deleted. There is a degree of error handling in the print functions for trapping cancelled jobs etc. No support for page sizes, or other elements of the printjob class are provided. They can be added, but this was a quick dirty hack to see if printing the stage was relatively simple.

View Example

Here is an example;?Ǭ†http://www.noponies.com/dev/printstage/?Ǭ†

Source Files

Here are the source files; ?Ǭ†Print Stage Source Files?Ǭ†?Ǭ†Archive contains .fla, document class, print class and context menu class.

ActionScript 2 Full Browser Flash Sites – Video Tutorials

Two basic video tutorials and?Ǭ†associated?Ǭ†support files that take you through the steps for creating full browser Flash sites.

Tutorial One – Publish Settings (7 mins)

Publish Settings – Step by step guide for setting the correct publishing settings in Flash 8 for full web browser Flash sites.

Source Files – Contain Video Tuts and Fla’s

Here are the source files; ?Ǭ†01_publishsettings.zip

Tutorial Two – Responding to Stage Size (24 mins)

Step by step demonstration for creating a stage listener that will move content around based on the width and height of the stage size.

Source Files

Here are the source files; ?Ǭ†02_respondscale.zip

Dependencies

Quicktime 7+ or h264 capable movie viewer
Flash 8
Watch out for the bad porn sound in the tuts, had the microphone up a little high…

« Previous PageNext Page »