First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing! | Flash Jobs
Search tutorials
Author: James McNess | Website: http://www.codeandvisual.com
With the release of the new Flash Builder Beta from Adobe labs, more Actionscript developers will be tempted to leave the Flash IDE and head to what is now the rebranded Flex Builder. Previously there has been a bit of confusion over what Flex and Flex Builder were for, not everybody realised that you could write non-Flex applications (i.e. plain actionscript ones) in Flex Builder. And then even without this confusion those of us used to the Flash IDE still had to get to grips with not having any sort of timeline or way to edit library assets. Long story short, you still need to use the Flash IDE to create and edit your library assets, though once this is done you can export them to a .SWC file in order to use them in Flash Builder. Here's a quick tutorial to show you how.



Using Movieclips in Flash Builder - Step 1

Firstly, in the Flash IDE, create your asset and save it as a MovieClip. I'm using a character from an upcoming game called "Tooth'n'Claw" that I'm going to release soon through Actionsprite.



Using Movieclips in Flash Builder - Step 1_b

Next you need to open up the properties window for your MovieClip where we will give it a Linkage ID that will allow Flash Builder to identify the Movieclip.



Using Movieclips in Flash Builder - Step 2

In the properties window, check both "Export for ActionScript" and "Export in frame 1" - you should see that the Class value is automatically filled out by Flash - it's the same name as you've given the MovieClip. You can change this to whatever you want, but remember it because it will be the name you use to refer to the MovieClip in Flash Builder.



Using Movieclips in Flash Builder - Step 3

Now that your MovieClip is prepared, go to "File>Publish Settings" and click on the "Flash" Tab. On this screen you want to make sure "Export SWC" is selected.



Using Movieclips in Flash Builder - Step 4

Now publish your file (I've named mine "Assets.Fla") and you'll notice that a .SWC file of the same name has been created. This file contains all of the assets that you have selected for export and is the file that you will use in Flash Builder to gain access to them.



Using Movieclips in Flash Builder - Step 5

Now you can load up Flash Builder and create a new project. You'll see there are various types of projects you can create, but the one we are going to deal with is an ActionScript project seeming as this is the whole point of the tutorial.



Using Movieclips in Flash Builder - Step 6

Give your new project a name, and then click the "Next" button.



Using Movieclips in Flash Builder - Step 7

Now this is where you tell Flash Builder about the .SWC file you created. Choose the "Library Path" tab and click on the "Add SWC" button.



Using Movieclips in Flash Builder - Step 8

A dialog will appear with a "Browse" button. Click this and point Flash Builder to the Assets.SWC file you made previously.



Using Movieclips in Flash Builder - Step 9

Now that you've located your .SWC file, you should be able to view it's contents via the Package Explorer window.



step_10 Once opened, you should see the Package Explorer window open to the side of your layout. Open up the "Referenced Libraries" section. Drilling down you should ba able to see the MovieClip you named in the properties window back in Flash. In this Case its called "ninja_cat" and has a little "c" icon next to it (for "class").



Using Movieclips in Flash Builder - Step 11

Finally in the code window you can write your ActionScript as you normally would. This is where you'll start to see some of the benefits of working in Flash Builder. As a coding environment there are a lot of little touches that make your life easier - some of which is incorporated into the Flash IDE, but for some reason, not all. Firstly you'll notice that when you create a new Actionscript project Flash Builder will automatically create a Document Class for you and prefill some of it out. Create a new instance of your library item as you usually would and attach it to the stage. Flash Builder should be smart enough to realise that it needs to import the MovieClip Class as well, which it will do for you automatically - see, I told you it was good.



Using Movieclips in Flash Builder - Step 12

Finally "Run" your movie and you'll see the MovieClip has been successfully imported and added to your stage. From here on in you should be able to import and use items as you need to. If you need to add more assets, or update existing assets, simply republish a new .SWC from Flash.



So that's all there is to it. I will try and cover some more aspects of Flash Builder in future articles.
» Level Basic

Added: 2009-07-28
Rating: 7.67 Votes: 3
(10 being the highest)
» Author
James McNess is owner of Code and Visual, a Sydney based company specialising in developing Flash games, HTML and Flash websites and also Flash applications for a variety of clients both large and small. They also develop Rainbow - a free online XML editor that can be used as a very simple Flash CMS for small to medium based websites.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • Instructional Designer

    Posted by mark frailey on 10/21/2012 12:52pm

    Screen shots with highlights was effective. There was no audio recording. The audio could have bumped up the effectiveness.

    Reply
  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.