Reprinted from: http://blog.163.com/liu_huan820/blog/static/133497406200910280155383 4/
1. Customize the swf size and frame rate. The declared position must be in the package, before the class definition[SWF (width = 800, height = 216, backgroundcolor = 0 xffffff, framerate = 30)] 2. When you directly reference external images, videos, fonts, and other resources in the class, the format is
- Image Statement: [Embed (source = 'woshi.png ')]
Public var pic: Class;
Reference: Private var bm: Bitmap;
Bm = Bitmap (new
Pic ());
AddChild (bm );
The same is true for swf loading. We select a file to import to the project.
Next we will create a component in swf and add it to the stage.
Font loading:
The font loading is slightly different. We import a font file to the project.
Here we create a TextField to use this fontName.
Note
Tf. embedFonts = true. It must be set to true to be valid. If it is not set to true, the font is the default font.
The method of resource embedding is very easy to use, but because the resources are compiled into the swf file, the published swf file will be much larger.
Liu_huan820