In this experiment, we continue examining new ActionScript 3 methods that will be available in Flash Player 10. If you need help installing the beta version of FP10 and the authoring tool, consult our first Flash Player 10 tutorial: Getting Started with 3D Methods in Flash Player 10.
To open the live version of the 'free transform of a bitmap' applet, click on the appropriate link below the picture. If you have Flash Player 10 Beta 1 (relased May 15), click on the first link. If you have Flash Player 10 Beta 2 (released July 2), click on the second link.
- A zip file p10triangles.zip
The zip file linked above contains all the 'as' and 'jpg' files related to the applet.
You might notice that the functionality of this applet is similar to that of A Gummy Bitmap: Custom Bitmap Transformations in ActionScript 3. The engines behing the two applets are very different, however. In the previous, FP9, version we had to use our custom AS3 class, BitmapTransformer. Here, we use the new AS3 method, drawTriangles, that will come with Flash Player 10. The zip file above contains the complete source code. On the next page, we explain the method itself.
The drawTriangles method is most useful for texture mapping in 3D applications. It allows for covering a triangulated surface that is projected into the 2D view plane with a bitmap texture. But drawTriangles can also be used for 2D image transformation, as in our example. It is easier to illustrate the method away from the 3D complexities. Thus, we use the present applet to do so.
Note: The 'as' files in the zip package corresponding to beta 1 and beta 2 versions of the applet are the same. The swf files are different and were compiled for each of the two betas separately, using two different versions of the nightly build of the FlexSDK. We used FlexSDK nightly build dated July 9 to compile for Beta 2 version, and the nightly build dated May 15 for the beta 1 version.
On the next page, we discuss the drawTriangles method.
The image that we used comes from Wikipedia. It depicts a typical domestic leadlight in 1920s.