First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Pascal ECHEMANN | Website:

Page 4

Let's see how to use our widget directly from the Flash CS3 main timeline. When you use SPAS 3.0 from Flash IDE instead of the Application class (org.flashapi.swing.Application) you must declare the Stage instance. (This is a consequence of the impossibility to access to a global reference of the Stage instance in Actionscript 3.0.) Said like that, this could seem complex. But it's not! Indeed, you just have to put the following lines on the first frame of the main timeline:

import org.flashapi.swing.*;

Once you have done that, you can easily create and display the CelsiusConverter object, and even use SPAS 3.0 built-in effects such as shadow or reflection:

import org.flashapi.swing.*;

var cc:CelsiusConverter = new CelsiusConverter();
cc.shadow = cc.reflection = true;

Ok! It's finished; just compile it to see the result!

Notice that this example uses SPAS 3.0 alpha 2 release. In this release, the default L&F is the "spas" L&F, contrary to the previous release which uses the "basic" L&F as default Look and Feel.

I hope you've enjoyed this tutorial. You can find more resources and tutorials on the SPAS 3.0 Web site at:

» Level Intermediate

Added: 2008-12-11
Rating: 1 Votes: 1
(10 being the highest)
» Author
Pascal Echemann is a Web Developer and Project Manager for "Bananatree Design" on the French Riviera. He also is the creator of the "Swing Package for ActionScript 3.0" (SPAS 3.0).
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.