Useful Cell class

June 3rd, 2014

Here is a class I keep reusing in different games

Make an object pulse with tweenmax

December 17th, 2013

Example:

glowPulse example zip

 

1
TweenMax.to(mc, 0.5, {repeat: 5, yoyo: true, glowFilter: {color: colour, alpha: 1, blurX: 10, blurY: 10, strength: 5}});

JSFL – copy filters stack from Flash IDE into as3 code

September 6th, 2013

Here it is a very useful command to quickly get all filters applied to a movieclip.

http://greladesign.com/blog/2011/07/21/jsfl-copy-filters-stack-from-flash-ide-into-actionscript-2-or-3-code/

Cannon Shooting

June 28th, 2013

Warning: Illegal string offset 'delimiter' in /home3/gogogobo/public_html/as3/wp-content/plugins/swfobject-reloaded/wp_swf_shortcode.php on line 123

Cannon shooting in all directions

Sorry, either Adobe flash is not installed or you do not have it enabled

 

CannonGame

Cannon Rotation

June 28th, 2013

Warning: Illegal string offset 'delimiter' in /home3/gogogobo/public_html/as3/wp-content/plugins/swfobject-reloaded/wp_swf_shortcode.php on line 123

Sorry, either Adobe flash is not installed or you do not have it enabled

How to Delete Unused Library Files with JSFL in CS5

November 1st, 2012

Unfortunately  the select unused files option is not available through JSFL neither the useCount.

Save and compact has been deprecated and as far as I know adobe doesn’t give us any alternatives for any of these after CS5.

So the best I could do for a recent project in witch I really needed to optimize some files was select all, copy and paste into a new document. This way I got rid of everything that was not in use.

It worked for me as my files have only one movieclip and everything inside that. And I had already done a script to align it right and give the stage the dimensions I wanted.

Here is the code:

function createCleanDocsAll(){
var docs=fl.documents;
var docs_length=docs.length;
var folderURI = fl.browseForFolderURL(“Select a folder to create the files.”);
for (var i=0; i<docs_length; i++) {
var doc=docs[i];
doc.selectAll();
doc.clipCopy();
doc.selectNone();

var doc2 = fl.createDocument();
doc2.clipPaste();

fl.saveDocument(doc2, folderURI +”/” + doc.name.replace(“.fla”, “”)+”_CLEAN.fla”);

fl.closeDocument(doc2);
}
}
createCleanDocsAll();

 

 

Please do let me know if you find any better solutions as this one is definitely not an ideal one.

Download the file here: createCleanDocs

 

Export all fla files in a folder

May 15th, 2012

If you need to export several flash files at once, this jsfl will help you exporting all fla files in a folder specified by you.

Just run the scrip, it will ask to select the folder, them just let it do its job.

Download exportAllFiles.jsfl

 

The code:

var folderURI = fl.browseForFolderURL(“Select a folder…”)+”/”;
var fileExtension = “*.fla”;
var list = FLfile.listFolder(folderURI + “/” + fileExtension, “files”);
if (list) {
for (i=0; i<list.length; i++){
fl.openDocument(folderURI+list[i]);
fl.getDocumentDOM().publish();
fl.closeDocument(list[i]);
}
}

 

If you don’t know how to use this script check the previous post:
Name several selected instances in flash at once

 

If you are searching for a script to export all opened files I suggest this one:

http://www.agileflash.com/2010/04/publish-all-opened-fla-files-using-jsfl/

How to write jsfl flash commands

May 14th, 2012

The Flash JavaScript API lets you write scripts to perform several actions its very helpful to optimise process.

But the documentation is really hard to find. The best I could find was this pdf in adobe site.

If you are just stating I recommend reading this.

I will be writing some more scripts soon.

 

FlashDevelop Syntax Coloring

May 1st, 2012

To customize the syntax highlight of flashDevelop just unzip the file, drag the containing SyntaxColoring.fdz file into FlashDevelop, confirm, then close and restart FlashDevelop and you’re good to go.

My own theme: colorsintax

There are other themes available.

 

 

Name several selected instances in flash at once

March 21st, 2012

I had several sequential frames with the same movieclip in different positions that I need to name so I bump into this FLASH COMMAND – AUTOMATICALLY NAME SELECTED INSTANCES… SEQUENTIALLY.

Its not exactly what I needed, but with small changes I made it do what I wanted, give all intances the same name.  You can download it here name-instances.

For that I just had to select the option edit multiple frames select all instances (in the different frames) and then run the command.

In CS5.5 to  run the command you can simply go to Commands > run command > select he JSFL file and your good to go.

If you plan to keep using the command you can add it to the configuration folder (Win 7):

C:\Users\username\AppData\Local\Adobe\Flash CS5.5\language\Configuration\Commands

for other operating systems : check here.