Tag Archives: Flash

AGAL Error #3613: The native shader compilation failed

What a cryptic error message, yeah? Good grief! Thanks Adobe! Googling didn’t come up with very much, either.

Turned out I was passing two constant registers to an operation.

So basically, in order to compare two temporary registers, you have to copy one of them to a temporary register first.

This code failed in my vertex shader:
ife vc7.x, vc5.x

But this code works:

mov vt1, vc7
ife vt1.x, vc5.x

Go figure. Wonder why that is. Solution found on a comment on this article.

Export vector graphics from Flash CC to Illustrator CC

If you’ve used Adobe creative suite/creative cloud programs for any length of time, you know they have some big quirks. One of the things that as always irked me was how difficult it is to get Flash vectors into Illustrator, even though the other way is as easy as copy/paste.

Flash CC 2014 added a new “export to SVG” option, which is great – Illustrator natively supports SVG! However, in my experience, Illustrator often crashes when opening said SVG file. In order to not crash Illustrator, here are some instructions (I’m using the CC 2014 versions of both Flash and Illustrator):

  1. Copy and paste the symbol you’re exporting into a new FLA (this removes unused symbols).
  2. go into every symbol in the library and delete all empty/hidden/guide/code layers.
  3. go to file > export image and choose SVG.
  4. open the SVG file in Illustrator – everything should be there!

I found the workaround here: https://forums.adobe.com/thread/1573625

Flash Builder 4.7 crashes loading workbench OSX

Today I had a similar problem to the one in this post – but instead of hanging, Flash Builder just failed to start up and quit during the “loading workbench” phase of initialization.

In the earlier post, I mentioned deleting a .snap file in [workspacelocation]/.metadata/.plugins/org.eclipse.core.resources, but previously I hadn’t been able to find it. This time, there WAS a .snap file in that folder, but it was hidden.

Deleted it, and Flash Builder starts up like a champ.

Extract sounds and images from FLA in Flash CC with JSFL

Recently I learned that Flash CC dropped the ability to export WAV files! Dumb move by Adobe in my opinion, but what’s done is done.

After some Googling, I discovered this post on stackoverflow that contains a JSFL script to enable extracting sounds or images from the library of an FLA. It’s a few years old at this point, but I can confirm it still works for sounds as of Flash Pro CC 2014. If anyone has a more modern solution I’m all ears, but I’ll repost the code here in case that link ever breaks:

// Result of attempts to export will go to the output panel,
// so clear that first fl.outputPanel.clear();

// If bitmaps/audio in the library have been selected, export only
// those. Otherwise, export all bitmaps/audio in the library.

var lib;
if (fl.getDocumentDOM().library.getSelectedItems().length > 0) {
    lib = fl.getDocumentDOM().library.getSelectedItems(); 
} else { lib = fl.getDocumentDOM().library.items; } 

// Get destination directory for files 
var imageFileURLBase = fl.browseForFolderURL("Select a folder."); 
var imageFileURL; 

var totalItems = lib.length;
// Iterate through items and save bitmaps and 
// audio files to the selected directory.
for (var i = 0; i < totalItems; i++) 
{
    var libItem = lib[i];
    if (libItem.itemType == "bitmap" || libItem.itemType == "sound") 
    {
        // Check the audio files original Compression Type if "RAW" export only as a .wav file
        // Any other compression type then export as the libItem's name defines.
        if(libItem.itemType == "sound" && libItem.originalCompressionType == "RAW")
        {
            wavName = libItem.name.split('.')[0]+'.wav';
            imageFileURL = imageFileURLBase + "/" + wavName;
        } else {
            imageFileURL = imageFileURLBase + "/" + libItem.name;
        }
        var success = libItem.exportToFile(imageFileURL);
        fl.trace(imageFileURL + ": " + success);
    }
}

You'll need to save this to a file with a .jsfl extension, select any number of sounds or images from the library, and then go to Commands > Run Command in Flash Pro and navigate to the file. It'll ask you for an output directory and save the selected items there. If you don't select items in the library beforehand, it'll export all sounds and images found in the library.

To get the command to show up in the commands menu, put the file here:

Windows 7: boot drive\Users\username\AppData\Local\Adobe\Flash CC\language\Configuration\Commands

Windows Vista: boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CC\language\Configuration\Commands

Mac OS X: Macintosh HD/Users/userName/Library/Application Support/Adobe/Flash CC/language/Configuration/Commands

filesystem data from here

Flash Builder 4.7 won’t reload SWC when it changes

According to this thread, Flash Builder will only notice when your library SWC changes if it’s in your project folder. Kind of sucks if you use the same SWC in multiple projects, like I do, but it appears to be the only option. Also, sometimes you need to clean the project to make the refresh happen.

Now, I’m not using the Flex framework, but also from the linked thread, if you use Flex you might be able to turn off a “global SWC cache.” I tried it for my plain-jane actionscript projects and it didn’t work.

Here’s the secondary method:

Find the .options file in the /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flexbuilder.project_4.7.0.349722/ folder and look for a line like this:

# use a global swc cache across all projects when compiling with flex sdk 4 or higher
com.adobe.flexbuilder.project/useGlobalSwcCache=true

Try setting useGlobalSwcCache to false then restart Flash Builder and see if that helps.

NOTE: This may result in longer compile times in Flash Builder if your workspace includes Flash Library Projects since those generated SWCs will no longer be cached and instead will be rebuilt every time.

Again, I tried this secondary option, but it didn’t work for me (OSX 10.10.3 Yosemite), possibly because I don’t actually use Flex, and the comment in the config file specifically mentions Flex SDK.

Flash Builder 4.7 hangs loading workbench OSX

Today Flash Builder randomly started hanging while loading the workbench on startup.

I found a lot of places that said to delete the .snap directory located at [workspacelocation]/.metadata/.plugins/org.eclipse.core.resources but there was never a .snap file or folder.

Eventually I found a trick here that said the following:

remove all the <editor> elements in workspace\.metadata\.plugins\org.eclipse.ui.workbench\workbench.xml

I did that and at least got Flash Builder to start up.

You apparently can also delete all the files in the [workspacelocation]/.metadata/.plugins/org.eclipse.ui.workbench as well (this removes your custom window layouts), but I haven’t tried this method.

As a last-ditch effort, you could do one of the following:

  • delete your .metadata folder in your workspace folder. You will have to reimport ALL your projects after doing this.
  • close Flash Builder, rename your workspace folder (defaults to “Adobe Flash Builder 4.7”), and re-open Flash Builder. It will create a new, empty workspace. Then quit flash builder again, delete the empty workspace, and rename your old workspace to its old name. Hopefully when you start Flash Builder again, things will work better.
  • This post has the following workaround (copied here to protect against link-rot). This is for Flash Builder 4.5 but may work for 4.7.
    This happens because the Eclipse workspace gets corrupted. The easiest way I've found to recover from this is as follows:
     
    1. Use Windows Task Manager (Ctrl+Shift+Esc) to make sure FlashBuilder.exe isn't running as a process. End the process if it is.
    2. Navigate to your workspace folder (the default location is under your users folder in "Adobe Flash Builder 4.5", though you may have placed is elsewhere).
    Mine is c:\Users\grayson\Adobe Flash Builder 4.5
    3. There is a folder named .metadata (on Windows 7 there is an issue where it may appear as a nameless folder because Windows started truncating the "extension")
    move it to another location on your hard drive.
    4. Launch Flash Builder to make sure that this it has solved the issue.
    5. Close Flash Builder (this writes the default workspace settings to the .metadata folder in your workspace location)
    Inside the original copy of the .metadata folder you made, COPY the following folders to the same location in the newly created .metadata folder in your workspace folder, overwriting the files and folders that are there.
    .metadata\.plugins\org.eclipse.core.resources\
    .metadata\.plugins\org.eclipse.core.runtime\
    (as I mentioned before, Windows 7 can truncate the folder names to be without the last portion of the name, so you may see two folders that appear to be named "org.eclipse.core.runtime". Copying them will still work)
    6. This will restore the projects, workspace settings, and key bindings. (the dialog/window layout will be reset to the defaults and External Tool Configurations aren't copied. I looked but didn't find where those are stored)

FlashDevelop 4.5.2.5 crashes on startup under Win8.1 x64

I use FlashDevelop for a lot of work projects. It’s a much better IDE for writing code-based ActionScript 3 projects than Flash itself.

Today, out of the blue, it started freezing on startup while trying to load the last project I had open. I thought I’d post about it in case a.) it ever happens to me again, or b.) it helps you, dear reader.

A quick Google search produced this forum thread, which solved it for me.

The solution was to rename/delete the file C:\Users\[USERNAME]\AppData\Local\FlashDevelop\Data\ProjectManager\Settings.fdb, which probably got corrupted.

Back to work! 🙂