Importing Flash SWF Vector Assets & Animations

Favorite This Post!
1 Votes
Posted by Lavon on March 24, 2013
Learn how to import flash assets and animations into GBS

With GameBuilder Studio (GBS) there is a particular way you have to export your swfs from Flash in order to get it to work. I will outline the export steps here. It is important to start with a blank flash project. Things can get really cluttered quickly.

Publish Settings

First of all make sure that your publish settings are set to "ActionScript 3.0"

Setting Up Your Assets

- Try to keep your timeline animation simple. Avoid a lot of nested movie clips with complex timelines of varying lengths. GBS will only look at the length of frames on the root timeline of your MovieClip. So if you have a nested movieclip with a longer timeline those frames will be ignored.

Frame Labels Mapped To Animations in GBS (Coming soon...)

if you want your animations to be seperated and named automatically for you when you import a movieclip asset in GBS add a frame label to the start of the animation frame. GBS will take that frame label and add an Animation Controller Component to the entity with the animation name mapped to the frame label, swf sprite sheet, and start and end frames all setup for you. This can save some time. To add a frame label simply click on the frame on the timeline and click the properties tab. Under the "LABEL" section you will see a Name input field for you to add the frame name. (Even though this is not implemented yet setting this up ahead of time will allow for an easy transition when this functionality is implemented in GBS)

Go To The Library Panel In Flash Pro CSX

Right click on an asset in the list and click "Properties"

Export For ActionScript

Make sure that you check the "Export for Actionscript" and "Export in frame 1" check boxes. Give the symbol a class name that you will want to recognize over in the editor. Remember to pay attention to the registration point of your symbol. This registration point will be used over in GBS.

Repeat this step for all of the different assets that you want to load into GBS. This will group all of the assets into one swf and GBS will extract them when you import the main swf.

Caveat - Image Settings

It is very important to check the compression of any bitmap images that you are trying to export in a flash symbol. Make sure the compression type is "Lossless (PNG/GIF)" otherwise your flash symbol will not export correctly.

Importing Into GBS

Once everything is setup publish the swf and import the resulting swf into GBS via the Assets panel and all of the exported symbols in the Flash library will be extracted and appear in the list. Once the swf asset appears in the list just drag and drop it into the game scene and a swf entity will be created for you. It is important to note that if the symbol exported from the swf file has more than one frame on its top level timeline GBS will utilize a SpriteSheet rendereing technique to display your swf. Each frame of the swf is then cached to be reused whenever the same swf asset is used again anywhere in your game. If there is only one frame on the timeline of the symbol the asset will be treated as a vector bitmap.

Scaling SWF Renderer & SWF Sprite Sheets

To scale up a swf animation make sure to set the scale property on the SWF SpriteSheet component instead of the Renderer. If you have a simple vector swf then you can just set the scale property of the SWF Renderer to scale up the asset. This will redraw the swf asset without loosing any quality.


Congratulations on finishing this tutorial! Found it helpful? Spread the word...


Comments

There are no comments yet!


Anyone can leave a comment!


You just need to signup for an account or log-in before you can comment.