----------------------------------------------------------
  Release Notes for Transform SWF for Java, Version 2.0.
----------------------------------------------------------

This edition of Transform is based on the previous release: Transform SWF for 
Java 1.4.1. This document describes the changes made.

    Different Editions are now available for each release of Flash.
    Flash Versions 6 &amp; 7 are now fully supported.
    Pixels are no longer supported, coordinates must be specified in twips.
    Error reporting and handling when encoding or decoding files is improved.
    Validation has been removed and will be handled by a separate, stand-alone class.
    Flash files using different string encodings are now supported.
    Flash Video is now supported.

The development and packaging of the code in Transform SWF for Java has been 
radically changed. Editions are now released for each version of Flash with 
releases for Flash 5, 6 and 7 are now available. The documentation for each 
release fully describes all the classes and features available. Information on 
the differences between editions are available on Flagstone's web site. An 
Evaluation Edition is also available that implements all of the classes required 
to support Flash 1. This allows all of the features available in Flash to be 
explored for evaluation purposes.

Each Edition nominally contains 100% of the functionality required to support 
a given version of Flash. Although Transform has been available for almost 2 
years there may still be errors due to bugs and incorrect interpretation of the 
Flash file format as documented by Macromedia. To distinguish between releases 
of the code each edition has a corresponding build number which is incremented 
each time a new release is made. With the exception of removing support for 
values expressed in pixels, the new release will only require minor changes to 
existing code. The changes described in more detail are as follows:


New Classes       
    New classes for Flash 5.    
    New classes for Flash 6.    
    New classes for Flash 7.    

Class Changes      
    Values must now be specified in twips.    
    Error handling and reporting has been improved.    
    All validation has been removed from Transform SWF.    
    Different string encodings are now supported.    
    FSColorTable class is now a factory for FSColor objects.    
    The FSEnd and FSEndShape classes have been removed.    
    Constructors for JPEG image classes no longer support filenames.    
    The FSTextStyle and FSTextRecord classes were merged into FSText.    
    The localization methods in the Transform class have been removed.    
    FSDefineFont2 now supports language attribute for line-breaks - Flash 6 and Flash 7 Editions only.    
    FSFontInfo and FSDefineFont2 now supports small fonts - Flash 7 Edition only.    
    FSFrameLabel now supports anchors - Flash 6 and Flash 7 Editions only.    
    Movie clips now support button events - Flash 6 and Flash 7 Editions only.    
    FSRegisterCopy now supports up to 256 registers - Flash 7 Edition only.    
    FSDefineEditText has been renamed to FSDefineTextField.    
    Factory methods for creating FAction objects have been removed.    
    The FSButtonRecord class has been renamed to FSButton.    
    setIs... methods on FSFontInfo, FSDefineFont2 and FSDefineTextField renamed.    
    The FSWith action now supports an array of actions.    
    FSDefineImage and FSDefineImage2 no longer supports separate colour table and image data.    
    Simplified constructors on FSFontInfo and FSDefineFont2.    
    Renamed sound formats.    
    FSText attributes indent and baseline are renamed to offsetX and offsetY.    

---------------
  New Classes
---------------

1. New classes for Flash 5.

FSEnableDebugger - part of Flash Version 5, though not previously included in 
Transform.

2. New classes for Flash 6.

A number of classes were added to support Flash 6:

FSInitialize is used to initialize a movie clip before it is displayed.

FSEnableDebugger2 - implements the same functionality as FSEnableDebugger but 
with a different internal format.

FSFontInfo2 - extends FSFontInfo to include a language attribute to support 
line-breaking.

The following byte-code actions have been added to the FSAction class:

StrictEquals - checks that the values on the stack are the same type as well as 
representing the same value. 

Greater - the operation can be specified directly rather than synthesised.

StringGreater - same as Greater but performed on string values.

InstanceOf - supports the instanceof keyword in ActionScript 2.0.

Classes added to enable video to be displayed directly in the Flash Player:

FSDefineVideo - defines a video stream that will be displayed by the Player, 
similar to the FSSoundStreamHead class.

FSVideoFrame - contains the video information that is displayed in a frame.

Classes to support Flash Video format files:

FSVideo - is the contain class for video objects, similar to FSMovie.

FSVideoObject - is the abstract parent class for video objects, similar to 
FSMovieObject.

FSAudioData - is used to add sound to a video stream.

FSVideoData - is used to specify the video data played in each frame.

will be included in a separate edition of Transform - due for release in the 
immediate future.

3. New classes for Flash 7.

New classes added to support Flash 7:

The following byte-code actions have been added to the FSAction class:

Implements - supports the implements keyword in ActionScript 2.0.

Extends - supports the extends keyword in ActionScript 2.0.Cast - supports the 
cast keyword in ActionScript 2.0.

Throw - supports the throw keyword in ActionScript 2.0.

FSExceptionHandler class was added to provide support for exceptions in 
ActionScript 2.0.

FSNewFunction2 class was added to optimise function definitions and improve the 
performance of scripts.

FSLimitScript is used to limit the resources available to a sequence of actions, 
preventing runaway scripts from crashing the Flash Player.

FSTabOrder is used to define the tabbing order of objects displayed on the Flash 
Player screen.

FSRegisterVariable is to specify which argument in an FSNewFunction2 object will 
be stored in one of the Flash Player's expanded set of 256 registers.

-----------------
  Class Changes
-----------------

A number of the changes to the existing classes in Transform are only supported 
in the Flash 6 and 7 Editions. The documentation for each edition is updated to 
reflect the changes made. 

1. Values must now be specified in twips.

The flags COORDINATES_ARE_PIXELS, IMAGE_SIZES_ARE_PIXELS and FONT_SIZE_IS_PIXELS 
in the Transform class have been removed. Coordinates and font sizes must now be
specified in twips. There were several reasons for doing this:


Classes in the Transform Utilities framework, particularly the new 
FSShapeConstructor class which is used for drawing, support specifying values 
in pixels rather than twips as an object attribute. This provides a cleaner 
model, allowing values expressed in pixels or twips to be used on a case by case 
basis.

Having a single global flag which had to be 'shared' among all the classes 
caused confusion, resulted in bugs and was useless in a threaded environment.
Removing support simplified the API for heavily used classes such as FSBounds, 
FSLine, FSCurve, etc.

IMAGE_SIZES_ARE_PIXELS was redundant as ALL image dimensions are specified in 
pixels. The use of the flags was not completely consistent across the entire 
framework.


2. Error handling and reporting has been improved.

When encoding or decoding FSMovie objects, errors can now be handled in one of 
two ways:

    Throw an exception.
    Report the error to a listener object.

In previous releases of Transform SWF error handling was a mix of the two 
approaches. Exceptions would be thrown if a file could not be read or written, 
while errors that resulted from objects underflowing or overflowing while being 
encoded or decoded were reported to any listener object registered with the 
movie. This approach was inconsistent and difficult and to use effectively.

Now the two mechanisms have been cleanly separated. The FSMovie class now 
provides different methods for each approach.


public FSMovie(String fileName)
            throws FileNotFoundException, DataFormatException, IOException
public FSMovie(byte[] data) 
            throws DataFormatException, IOException
public void decodeFromFile(String fileName) 
            throws FileNotFoundException, DataFormatException, IOException        
public void decodeFromData(byte[] bytes) 
            throws DataFormatException, IOException
public void encodeToFile(String fileName) 
            throws FileNotFoundException, IOException


The listener interface is maintained, though with some name changes. All error 
and status messages are sent to the listener. Although the listener interface 
is principally used by Flagstone's development teams for debugging it is also 
useful when decoding a file that may contain corrupted data, allowing the 
invalid objects to be identified and the entire file decoded without an 
exception being thrown.


public FSMovie(String fileName, FSMovieListener listener)
public FSMovie(byte[] data, FSMovieListener listener)
public void decodeFromFile(String fileName, FSMovieListener listener)
public void decodeFromData(byte[] bytes, FSMovieListener listener)
public void encodeToFile(String fileName, FSMovieListener listener)


3. All validation has been removed from Transform SWF.

Validation was primarily used as a debugging tool to verify that the attributes 
of each of the classes that would be encoded to generate a Flash file were set 
correctly. All the validation logic will be provided as a separate package, 
removing the overhead from the classes and allowing changes in the validation 
logic to be made more frequently.

Error checking is performed in the constructor and set methods. If an argument 
is invalid then an IllegalArgumentException will be thrown. Note however that a 
lot of error checking is contextual, for example referencing an object that is 
not included in a movie so the Validation Framework is still recommended for 
detailed error checking.

4. Different string encodings are now supported.

Attributes containing strings contained UTF8 encoded strings which anticipated 
with the move to support Unicode that started with Flash 6. However files 
created using localized versions of the Flash authoring application, for example 
those Japanese character sets could not be successfully encoded or decoded. An 
encoding attribute has been added to the FSMovie class which identifies the 
character set that will be used to encode or decode a file.

5. FSColorTable class is now a factory for FSColor objects.

Colours from the Netscape Color Table can now be created directly using factory 
methods in the FSColorTable class. In previous releases of Transform colours 
were created using the following code:


FSColor aquamarine = new FSColor(FSColorTable.aquamarine);


By creating a class using factory methods for the colours in the table this is 
now simplified to:


FSColor aquamarine = FSColorTable.aquamarine();


For transparent colours the alpha channel value can now be specified in the 
factory method:


FSColor transparentAquamarine = FSColorTable.aquamarine(128);


The factory methods were not added to the FSColor class to reduce the size of 
the compiled code, particularly since a small subset of colours defined in the 
table are normally used.

6. The FSEnd and FSEndShape classes have been removed.

An FSEnd object no longer needs to be added to an FSMovie or FSDefineMovieClip 
object to mark the end of an array of movie objects. The marker will be encoded 
(or decoded) by the FSMovie or FSDefineMovieClip. Similarly an FSEndShape object 
no longer needs to be added to an FSShape object to mark the end of the shape 
definition.

7. Constructors for JPEG image classes no longer support filenames.

The FSDefineJPEGImage, FSDefineJPEGImage2 and FSDefineJPEGImage3 classes allowed 
the name of a file containing a JPEG image to be specified in a constructor. The 
contents of the file would be loaded to initialize the object. These 
constructors have been moved in the the new FSImageConstructor class in the 
Transform Utilities framework. The goal is to add methods that support a wider 
range of image formats and to provide a more consistent way of creating objects 
- similar constructors were not available for FSDefineImage, FSDefineImage2 
classes.

8. The FSTextStyle and FSTextRecord classes have merged.

The FSTextStyle class has been merged into the FSTextRecord class and renamed 
to FSText. The same level of functionality is maintained - text records can 
contain style information or text strings or both. The change was made to 
maintain compatibility with Flash Version 6. File containing Flash 5 or earlier 
will still be encoded or decoded correctly.

9. The localization methods in the Transform class have been removed.

The Transform class contained several methods for creating localized strings 
using a ResourceBundle object loaded from a properties file. With the new model 
of using keys to identify errors, when reporting errors using the listener 
interface, applications using the framework can now use the error key in their 
own localization implementations therefore providing methods for localization 
was no longer useful.

10. FSDefineFont2 now supports language attribute for line-breaks - Flash 6 and 
Flash 7 Editions only.

A language attribute has been added to FSDefineFont2 class in Flash 6 and Flash 
7 Editions. This provides the Flash Player with information on the spoken 
language for the text in a given font and is used to provide locale specific 
line-breaking for better display of text.

11. FSFontInfo and FSDefineFont2 now supports small fonts - Flash 7 Edition only.

Reserved fields in the FSFontInfo and FSDefineFont2 classes were changed to 
support the small attribute. This is a boolean flag indicating that the font 
definition is for a small font which may be aligned on pixel boundaries for 
faster display.

12. FSFrameLabel now supports anchors - Flash 6 and Flash 7 Editions only.

When a label is specified for a frame using the FSFrameLabel class it can also 
be identified as an anchor, allowing the frame to be specified in a URL just 
like a named hyperlink in HTML.

13. Movie clips now support button events - Flash 6 and Flash 7 Editions only.

The FSClipEvent object has been updated to support the new event model for movie 
clips introduced in Flash 7. Compatibility with Flash 5 is maintained.

14. FSRegisterCopy now supports up to 256 registers - Flash 7 Edition only.

In Flash 7, actions can now access up to 256 registers for storing values, 
rather than using slower variables in memory.

15. FSDefineEditText has been renamed to FSDefineTextField.

The FSDefineEditText class has been renamed to make its purpose more obvious.

16. Factory methods for creating FAction objects have been removed.

The factory methods on the FSAction class that were used to generate stack 
based actions were removed for several reasons: 1) to reduce the size of the 
compiled class 2) to reduce the size of the data-sheet for the class. Since the 
type of each action was documented the factory method documentation was 
repetitious and 3) the Translate parser and particularly the ASNode class from 
Translate can be used to generate sequences of actions more easily than 
generating the individual byte-code actions.

17. The FSButtonRecord class has been renamed to FSButton.

FSButtonRecord was renamed to the simpler FSButton.

18. setIs... methods on FSFontInfo, FSDefineFont2 and FSDefineTextField renamed.

Accessor methods for boolean attributes on the FSFontInfo, FSDefineFont2 and 
FSDefineTextField classes were renamed. For example setIsBold(boolean) was 
renamed to setBold(boolean).

19. The FSWith action now supports an array of actions.

The FSWith action was introduced in Flash 5 to temporarily change the context 
for actions, replacing the FSSetTarget action. The main movie or a movie clip 
object is popped of the stack and the FSWith action executes a set actions to 
update the object. In previous releases the FSWith action contained an 
actionLength attribute which contained the number of bytes that the set of 
actions following, occupied in memory. This has been replaced by an array so 
the actions associated with an FSWith action form part of the object. This will 
simplify the creation and manipulation of FSWith objects.

20. FSDefineImage and FSDefineImage2 no longer supports separate colour table 
and image data.

The FSDefineImage and FSDefineImage2 classes supported constructors and accessor
 methods where the colour table and image data could be specified separately. 
 The object would then combine and compress the data using the zlib algorithm 
 so it could be encoded to a Flash file. The constructor and methods are no 
 longer supported, the same functionality is supported in the FSImageConstructor 
 class in Transform Utilities which simplifies the process.

21. Simplified constructors on FSFontInfo and FSDefineFont2.

The FSFontInfo and FSDefineFont2 classes contain several attributes. 
Constructors which allowed all of the attributes to specified in a single step 
have been removed to make code more readable. Simplifying the constructors also 
improves code compatiblity between different versions of Flash - the language 
attibute was added in Flash 6 and support for small fonts was wadded in Flash 7.

Each class now supports a single constructor:

public FSFontInfo(int anIdentifier, String name)
public FSDefineFont2(int anIdentifier, String name)


While

public FSDefineFont2(int anIdentifier,
                     int anEncoding,
                     boolean italics,
                     boolean bold,
                     String name,
                     ArrayList glyphArray,
                     ArrayList codeArray)

public FSDefineFont2(int anIdentifier,
                     int anEncoding,
                     boolean italics,
                     boolean bold,
                     String name,
                     int ascent,
                     int descent,
                     int leading,
                     ArrayList glyphArray,
                     ArrayList codeArray,
                     ArrayList advancesArray,
                     ArrayList boundsArray,
                     ArrayList kerningsArray)

public FSFontInfo(int anIdentifier,
                   String aName,
                   int anEncoding,
                   boolean isItalic,
                   boolean isBold,
                   ArrayList anArray)


have been removed.

22. Renamed sound formats.

Previously Pulse-Code Modulated (PCM) sounds distinguished between big-endian 
(FSSound.PCMB) and little-endian(FSSound.PCMB) formats. PCMB was renamed to 
NATIVE_PCM since the byte order depends in the platform on which the sound is 
played. PCML was renamed to PCM since this provides cross-platform 
compatilbility and should be the default format for PCM encoded sound.

23. FSText attributes indent and baseline are renamed to offsetX and offsetY.

The indent and baseline specified the position of the line of text relative to 
the bounding rectangle that completely enclosed an area of text. The attributes 
were renamedto make their purpose more clear.



