You are here: Recent News » MX v.2 Components Patch

 

MX v.2 Components Patch

Introduction

Many people use the Macromedia Flash MX V.2 Components to create user interfaces for their flash applications. Since Open Source UI frameworks (like ActionStep) aren’t released yet, Flash Developers have no worthy alternative in choosing the most comfortable and functional UI library with which to satisfy all their needs. Another issue is the absence of UI builder tools for existing Open Source frameworks. Consequently, Flash developers are often forced to use Macromedia’s UI framework.

However, because of the extremely poor quality of the V2 Components source code, it’s practically impossible to use it together with other open source tools. One of the most prominent issues is not being able to use MX source code with the MTASC SWF compiler. The coding standards used in the V2 Components code are incompatible with those of MTASC so its parser produces numerous warning and error messages. But even updated MX code compiled with MTASC won’t make SWF work properly. Because of differences in class registration order and using initialization code from assets inside SWF’s library, component skins are initialized incorrectly. As a result components may be displayed only partly or not at all.

So currently it is not possible to use MTASC to compile a SWF that uses the Macromedia V2 Components. MTASC has a special -mx option that allows the skipping of MX classes during SWF compilation and leaves it as is. But in practice, the inability to properly compile MX classes with MTASC makes its use inconvenient and seriously limits the area of its application.

Purpose

Provided patch serves for two purposes:

  • Contains special fixes allowed to create correctly worked flash applications contained MX V2 Components using MTASC.

So using this patch Flash Developer could feel the power and freedom of the open source development applied to MX solutions framework.

Prerequisites

Patch can only be applied to MX sources distributed with Macromedia Flash 8.

MX sources published with Flash 8 are different from sources distributed with Flash MX 2004. It contains missed packages like services and xpath. Also sources are updated and rewritten a little. So it made possible to patch it and makes compatible with MTASC.

Patched MX sources could be used to recompile not only SWF produced by Flash 8 but also SWF published using Flash 2004.

Also you need to install Macromedia Flash Remoting MX Components in order to have complete classes collection on your computer.

How To

Distribution Restrictions

Because of Macromedia Flash License Agreement, it’s impossible to publish patched MX sources. So below you can find patch files produced by DIFF tool and instructions how you can apply it to your MX sources.

License Agreement

Copyright the original author or authors.

Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Patching Tools

In order to apply this patch you need to download and install ANT (cross-platform, requires JRE) or get PATCH utility. PATCH utility is a standard UNIX tool. Microsoft Windows users could download ported version from GnuWin32 site. For OCX users PATCH utility is available within so-called “Developer package”.

Installation instructions could be found here:

Download Patch

All patches are grouped into 3 categories:

  • CORE 7 provides patches for Flash MX 2004 (Flash 7) core classes.
  • CORE 8 provides patches for Flash 8 core classes.
  • MX provides patches for MX package which is used to create both Flash 7 and Flash 8 applications and movies.

Each category contains a set of patches allowed to update original sources to any released patched version. Also it’s possible to update some particular patched version to any subsequently released version.

Below are the tables contained all released patch versions.

CORE 7

Version Original Subsequent
1.0 to 1.0 -

CORE 8

Version Original Subsequent
1.0 to 1.0 -

MX

Version Original Subsequent
1.0 to 1.0 -
1.1 to 1.1 1.0 to 1.1

Apply Patch

Before using patch it’s strongly recommended to backup your original Flash source files. Also it will be better to create local copies of the Flash Core and MX directories and apply patch to. Then you could edit CLASSPATH settings for MMC, MTASC and used IDE to use patched copies instead of original sources from the default location.

For the various OS you could find required sources at:

  • Windows: [DISK]:\\Documents and Settings\[USERNAME]\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes\

I’m not familiar very well with UNIX and OCX systems. So please contact me to help to complete this section with Flash sources location for this OS.

So, for example, create ”C:\Flash\lib\Macromedia” folder and copy FP7, FP8 and MX directories to. This example will be used below to illustrate how to apply patches.

Using PATCH Tool

  1. Copy required patch (core7.patch, core8.patch, mx.patch) to the ”C:\Flash\lib\Macromedia” directory.
  2. Run PATCH from the ”C:\Flash\lib\Macromedia” directory with appropriate arguments:
    • for core7 patch: “patch –u –p3 –d ./FP7 < core7.patch”
    • for core8 patch: “patch –u –p3 –d ./FP8 < core8.patch”
    • for mx patch: “patch –u –p3 –d . < mx.patch
  3. Read the next section :-)

IMPORTANT NOTE: Using Copy/Paste on patch execution strings can lead to patch failing with message patch: ûd: extra operand. In this case please type execution string manually.

Using ANT

Comming soon...

Use Patched Sources

You don’t need to modify your source code in order to work with patched MX classes. But there is one significant requirement. You need to force compilation of the mx.core.ext.UIComponentExtensions class into your SWF file. It could be done with 2 different ways:

  • Refer it from any (desirable, main) class:
private static var incExt = 
        mx.core.ext.UIComponentExtensions;
  • Include it to the MTASC command line:
mtasc -cp ./src -cp C:/Flash/lib/Macromedia mx/core/ext/UIComponentExtensions -main MyMainClass

And it seems that’s all. Enjoy the patch! :-D

Contacts

For more detailed information, issue reports, participation proposals and etc. you could contact:

  • Igor Sadovskiy (Author): isadovskiy[at]gmail[dot]com

Also you could use MXPATCH project page at SourceForge.net to commit bugs and request improvements.

mx_v2_components_patch.txt · Last modified: 2006/03/28 00:55 by guide