7-day free trial to lynda.com video training library.

Flash Extension: Export as Motion Preset Preview

Justin | animation,extensions,Flash | Thursday, October 16th, 2008

This is the first extension that I’ve written exclusively for the new Flash CS4 features. Flash CS4 not only allows you to create extremely complex animations with a high level of control, but it also allows you to save those animations for reuse in the new Motion Preset panel.

I got the idea for this extension from Lee Brimelow’s excellent tutorial on the Motion Preset panel. Since I imagine that I’ll be creating a lot of my own motion presets, and I’d like them to have live previews just like the default presets, I decided to automate the process.

Here’s how it works:
Once you’ve created a custom motion preset, you can use this command to immediately create a live preview from your current document. This assumes that the motion preset is the only thing in your document. If that’s not the case, you may want to open a new document, paste the animation, and run the command from there.

Feedback welcome.

UPDATE:

  • Version 1.1.0 now supports multiple languages. Thanks to jeanphilippe for the catch!
  • Know issue: Preview is not retained if the preset is moved to a different folder within the Motion Preset panel. This is because Flash does not keep track of the preview files, it just knows to look for them.

Download
(compatibility: Flash CS4)
Export as Motion Preset Preview.mxp

Related Topics



21 Comments »

  1. [...] tutorial on creating your own animation presets, the folks over at Ajar Productions whipped up a nice extension that automatically creates the preview and places it in the appropriate directory. Very [...]

    Pingback by The Flash Blog » Automatic Motion Preset Previews — October 18, 2008 @ 6:04 am

  2. Hi,
    have you tested on Mac ?
    ’cause i’ve an error in line 31
    thanks
    JP

    Comment by jeanphilippe — October 18, 2008 @ 9:59 am

  3. oups !
    it’s normal under a Flash CS4 french language version
    the good code for french users is :

    //Export as Motion Preset Preview
    //Justin Putney
    //http://putney.ajarproductions.com
    //version 1.0.0

    var dom = fl.getDocumentDOM();
    var sel = fl.presetPanel.getSelectedItems();

    if(sel.length == 1) run();
    else if(sel.length > 1) alert (”You have more than 1 preset selected.”);
    else if (sel.length < 1) alert (”You must select a motion preset first.”);

    function run(){
    var sItem = sel[0];
    //check to make sure it’s not a folder
    if(sItem.isFolder){
    alert(”Please select a preset and not a folder.”);
    return;
    }
    //check to make sure it’s not a default
    if(sItem.isDefault){
    alert(”This cannot be applied to a default preset.”);
    return;
    }
    fl.trace(sItem.path);
    var pathArr = sItem.path.split(”/”);
    if(pathArr[0] == “Présélections personnalisées”) pathArr.shift();
    pathArr.unshift(”Motion Presets”);
    var fileName = pathArr.join(”/”) + “.swf”;
    var swfFile = fl.configURI + fileName;
    //export swf
    dom.exportSWF(swfFile, true);
    //refresh panel
    fl.presetPanel.selectItem(sItem.path, true, false);
    fl.presetPanel.selectItem(sItem.path, true);
    }

    Comment by jeanphilippe — October 18, 2008 @ 10:09 am

  4. Thanks for the catch and fix, jeanphilippe! The language variations in folder names was not something I had anticipated. I’ll check to see if there’s a way to get that information automatically and/or make it language non-specific.

    Comment by Justin — October 18, 2008 @ 4:31 pm

  5. Thanks Justin :)

    Comment by jeanphilippe — October 18, 2008 @ 4:37 pm

  6. Okay, I think I’ve got it fixed. Try version 1.1.0.

    Comment by Justin — October 18, 2008 @ 4:47 pm

  7. Oh my god ! it’s universal now !
    no way… your new version is great now
    thanks a lot for us !

    Comment by jeanphilippe — October 18, 2008 @ 5:24 pm

  8. Great stuff, thanx!

    Comment by Kribba — October 18, 2008 @ 5:49 pm

  9. It’s amazing, Thanks

    Comment by Abel — October 22, 2008 @ 11:41 am

  10. Very nice, Justin!

    Comment by Bob Sander-Cederlof — October 22, 2008 @ 8:35 pm

  11. [...] The flash motion plug in can be found here. [...]

    Pingback by Custom Flash Motion Presets – Automatic preview plug in | Flash Motion Presets — November 2, 2008 @ 11:21 am

  12. [...] Overall, CS4 makes animating is so much easier. It might be a little overwhelming at first, but after playing with it, you can animate your objects in ways you would have never imagined. And, if you really like your animation, you can save presets that can be applied to any object later with a couple of clicks. Flash includes some presets already, but they are pretty basic. I suggest that you create your own list of presets to reflect your own animation style. The only downside of presets is that Flash doesn’t show you examples in the preview box. Fortunately, an extension has already been created to fix that problem (get it here). [...]

    Pingback by Flash CS4—A huge improvement for animators! | Launchfire Interactive — November 18, 2008 @ 2:14 pm

  13. thanx alot.. !!
    it’s amazing & helps alot …

    thank u justin

    Comment by dr.nour — November 25, 2008 @ 2:01 pm

  14. Thank you Justin, this is so much easier than copying the swf over. Very much appreciated!

    Comment by another justin — March 9, 2009 @ 10:31 pm

  15. [...] selbst erstellten und gespeicherten Animationen erschwert dies den Überblick. Die Erweiterung Export as Motion Preview von Ajarproductions schafft da [...]

    Pingback by sonja vieten » Blog Archiv » Flash CS4 Motion Editor mit Preview — April 2, 2009 @ 5:47 am

  16. sorry guys, but it seems like i dont understand how this works
    now i downloaded that “gray” file
    but i dont know what to do next
    so if anyone has patience to give me detailed instructions to what to do, i would be grateful

    Comment by tarek — September 1, 2009 @ 5:42 am

  17. Tarek,

    Not sure what you mean by the “gray” file. Could you clarify?

    Comment by Justin — September 3, 2009 @ 6:13 pm

  18. *ref Ajar productions / Flash
    http://ajarproductions.com/blog/2008/10/16/flash-extension-export-as-motion-preset-preview/

    Comment by design_rs (design_rs) — December 1, 2009 @ 11:20 am

  19. Thank you very much…

    Comment by Gazi Tasarım — February 1, 2010 @ 11:10 am

  20. WOW!
    very nice job!

    Comment by Jesus — June 16, 2010 @ 4:30 pm

  21. Thanks, Jesus!

    Comment by Justin — June 18, 2010 @ 3:51 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

You may use the following html tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight=""> .

Subscribe without commenting