JSFL – Create Default File Command

As I mentioned in a previous post, I was looking for a reason to get off my butt and explore the JSFL library for Extending Flash. So I decided to make a really simple script that could save me a bit of time. Every time I create a new Flash file I always spend the first few minutes setting up my library, layers, framerate etc... Now I know you can make your framerate as part of the default file template, but I thought I'd add it in anyway.

It's nothing fancy but it was a cool project for me to get my feet wet with JSFL. Here's what the extension does:

Sets Frame - rate to 31fps
Creates basic layers -
---- actions : a layer for all code
---- interface : a layer for interface elements
---- background : a layer to place the background graphic or color box
---- trace : a guide layer for placing graphics used for placement only
Creates basic folders in the library -
---- Audio : place your sound files in here
---- Bitmaps : place your imported images in here
---- Buttons : place your button symbols in here
---- Components : place your components in here
---- Graphics : place your graphic symbols in here
---- Movies : place your MovieClip symbols in here
Locks actions layer prevents stage elements from being placed on that layer

Once installed you can access the command "Create Default File" from the Flash Commands Menu.

I'd like to figure out a way to have it automatically run this command every time I create a new file, but I haven't figured out if that's even possible yet. I picked up the Extending Flash MX 2004 book by Keith Peters and Todd yard as well, it's always good to have a nice reference handy.

Download (.mxp) | Source (.jsfl)

6 Responses to “JSFL – Create Default File Command”

  1. ido Says:

    Frame rate default value could be set by pressing Document Properties > Make Default button too.

  2. Keith Peters Says:

    I should be the last one to detract from a cool JSFL post, but a better solution to what you want to do would probably be “Save as Template…”

    Just set up the file the way you want it and save it as a template and next time you make a new file, just choose that template.

    I’ve been down the same road though, making a few JSFL scripts that do very similar things to what you describe, before realizing a template would be simpler. :)

  3. Crucial Says:

    @keith – :lol: yeah I hadn’t thought about that. Oh well it was a good experience I suppose. Broke down a lot of barriers for me to see its not all that hard and there are some really cool things you can do with JSFL (but maybe I’ll make sure theres not an eisier way to do it first next time). And yeah it is a bit ironic to hear this coming from one of the authors of the book :D Thanks for the tip!

    @ido – yeah thats the point I was making when I said “I know you can make your framerate as part of the default file template”, but I do appreciatte the affirmation.

  4. Just Another Rant » Blog Archive » JSFL - Automate Getters and Setters Command Says:

    [...] « JSFL – Create Default File Command [...]

  5. gnfontaine Says:

    Your source is missing…

  6. Crucial Says:

    sorry bout that, should be fixed now

Leave a Reply


Visit Portfolio :

Crucial Limit

Client List :

Aces Tattoos | 82 Tattoo | Eric Peacock | Kustom Tattooz | Laser Imaging & Design | Laterras R. Whitfield | Solipsum | Travelocity ExperienceFinder {beta} | Travelocity | ZSI

Socialize:

Flickr | View Dave Gillem's LinkedIn profileView my LinkedIn profile | Twitter | Facebook | Become a fan of Crucial Limit on Facebook Become a fan on Facebook

Add to:

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin