First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Pascal ECHEMANN | Website: http://www.flashapi.org/
'

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.*;
UIManager.initialize(this);

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.*;
UIManager.initialize(this);

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

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: http://www.flashapi.org/

» 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!

Comments

  • 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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.