Set transform to middle via JSFL

November 27th, 2012 by Slav

I just wrote a quick JSFL script for the Flash IDE that I though I’d share..

Example of situation where this could be useful.  You just imported a bunch of images from photoshop via PSD importer. All of those would have a bitmap inside of them , that would be left top aligned to registration point, and so would be his parent.

However, you’d like to have some of those bitmaps center aligned as you want to do some nice scale in / rotation tweening like this for example :

TweenLite.from(my_mc, .4, {scaleX:2, scaleY:2, rotation:90, alpha:0, ease:Back.easeOut});

Instead doing all of this manualy:

  1. double clicking on the clip to go inside it
  2. selecting a bitmap
  3. center align it
  4. making sure it’s on the whole pixel position (deleting .5 from x or y position)
  5. going out of edit mode
  6. selecting parent and moving it back by the half x and y width / height offset
  7. repeating this for all the elements you need to have center aligned!

you can simply right-click on this link and select “Save link as” and download it to your commands folder.

On win 7 this is : C:\Users\[YOUR PROFILE NAME]\AppData\Local\Adobe\Flash CS5\en_US\Configuration\Commands

Then in Flash IDE just select desired clips on your stage and select “CenterClipToMiddle” from the menu.

It will only work on one child in nested timeline of the MovieClips you select on a stage. I have automatic rounding of position as well both for parent and nested clip, so it will always be on a whole pixel value.

Any questions or suggestions for improvement just give me a shout in comments below.

Posted in AS3, flash, JSFL | 2 Comments »

Flash Filters 2 AS2 Converter

November 8th, 2007 by Slav

With this extension you can apply the filters to MovieClip on stage in authoring time, run this command and it will generate and output the AS2 code for you to the output window with which you can replicate the same effect dynamically.

You can use any number of filters, any kind of filters and any combination of filters. Read the rest of this entry »

Posted in JSFL | 10 Comments »

Stage Animation Recorder

August 31st, 2007 by Slav

This extension enables you to live record your actions in flash environment. It is typically used to create “live handwriting” effect. Unfortunately due to the nature of the way flash executes the actions in IDE , you can’t actually record mouse fluidly but rather short strokes, as flash pauses the on Timer events until mouse is released.  So to actually create illusion of writing, you’d have to have graphics of fully written text, and use this extension to draw a mask over it, recording creation of the mask , with short strokes.

However, application of this extension is not limited to this effect, you can record any sort of animation as long as it’s happening on the stage. Read the rest of this entry »

Posted in JSFL | 5 Comments »

“Preloader junkyard” or how to keep everything in one clip extension.

July 5th, 2007 by Slav

You might have experienced the following situation : Just created a flash game or app which is too big to go online without preloader. You have 2 options.

  1. Create 1 file so preloader must be inside the same file as app.
  2. Create a separate small preloader swf that will load your big file.

Although the second solution is more elegant, there are various reasons why you will use option number 1. Read the rest of this entry »

Posted in flash, JSFL | Comments Off on “Preloader junkyard” or how to keep everything in one clip extension.

Convert Folder Images 2 Frames

July 2nd, 2007 by Slav

Imagine you need to import a bunch of images and place them on the frames in a movie clip. Sure flash has an import command that can recognise image sequence, but what if your images are not an animation sequence ? What if you need to convert them all into movie clips as well ? And have a different registration point other than default top left ? Read the rest of this entry »

Posted in flash, JSFL | 5 Comments »

Files 2 Movie Clips

June 22nd, 2007 by Slav

This extension lets you choose a folder with images , then takes the images from selected folder ,converts them into a movie clips and places them in the library.

You may choose whether you wish to link the movie clips for export and whether they should be exported on a first frame.

Quite useful when you have a bunch of images that you simply need to turn into movie clips… Read the rest of this entry »

Posted in flash, JSFL | 3 Comments »

Images 2 SWFs

June 18th, 2007 by Slav

This extension was created out of need to quickly wrap png files into swf. I was creating a dynamic multilingual website where each page needed to have an avatar popping out on a page. Of course if there’s only one or 2 you would embed them into the main swf file, but there were quite a few of them, and each of them were using alpha channel.

So you can’t use jpg files , because they don’t have an alpha channel , but you don’t want to use png, because they are too big. Obvious solution is to wrap the pngs into swf files, so you have both alpha channel AND jpeg compression.

This extension lets you select a folder with images you want to wrap, and converts them into swf files of the same filename as the sources. Read the rest of this entry »

Posted in JSFL | 1 Comment »

Make MC Button from a MovieClip

March 20th, 2007 by Slav

There are several ways to create buttons in Flash.  Some people will create a button class, where they’ll define all the methods for rollovers , active and disabled states and associate it with the particular MovieClip symbol in the library. The other will create a Button instance and place the graphics on the timeline under frames with labels “over”, “down” etc.

Not everybody is aware though, you can make any ordinary MovieClip to behave like Button type of symbol (i.e. going automatically to differently labeled frames depending on the mouse events). All needed is following :

  1. Your movie clip must have specifically named frame labels : “_up”,”_over”,”_down”,”_hit”
  2. Your movie clip must have some methods defined for it, such as onRollOver, onRelease ..etc.

I have written this extension to automate the process of creating the frames, label names and adding stop frames for it. Read the rest of this entry »

Posted in AS2, JSFL | 2 Comments »