Ultrashock Tutorials > Flash 8 > Alt Captions  
 
by Julian Wilson, Neverrain.net
Download Source Files  
 
Alt Captions
 
 Introduction: Alt Captions
 Step 01: Setting up the Flash file
 Step 02: Caption Class
 Step 03: Finishing up
- discuss this tutorial -

Setting up the Flash file

Let’s start by making a new movie (File > New). Set the dimensions to 300x200 pixels with dark grey (#333333) as the background color.

File Menu
(Note: All screenshots were taken using Flash 8 on Macintosh)

Create a new movieclip (Insert > New Symbol) and draw a button size square inside.

New Symbol

Give this movieclip the instance name of “hotspot”.

Properties

Open up the movie Publish Settings panel (File > Publish Settings) and then click on Settings (next to the ActionScript version details). The ActionScript 2.0 Settings window should now be displayed. By adding a new class path we are telling Flash to look in the caption/actionscript folder for our soon-to-exist AS2 classes (the path is relative to the Flash file).

Click on the big plus sign and then type in “actionscript” (without quotes) and hit the Enter key. The new class path is now added…

Publish Settings

Open up the Actions panel (Window > Actions) and enter the following:

var usCaption = new Caption("Visit Ultrashock.com", hotspot, 500);

The Caption class will have 3 parameters, 2 of which are required. Parameter explanations as follows:

  • Label - Text the caption will display (e.g."Visit Ultrashock.com").
  • Path - Path to the base movieclip containing all required assets.
  • Delay - Number of milliseconds before the caption will start fading in.

Go into the library panel (Window > Library) and select “New Font” from the options menu (shown below).

Library Menu

The Font Symbol Properties window should now be displayed. Enter the following settings:

Font Properties

Select the newly added font in the Library panel, and then go into the options menu like we did before, only this time select “Linkage”. Put “arial” as the identifier, check the “Export for ActionScript” box, and then hit enter.

Save the file (File > Save As) in the same directory as the actionscript folder. You can use any name you like as long as the file is placed within the base directory (caption/).


- discuss this tutorial -
 
©2006 Ultrashock.com - All rights reserved