New Snippets Panel Extension for Flash CS3!

I just polished off my second panel extension for Flash CS3. This snippets panel allows you to store code snippets that can easily be copied to the clipboard for easy insertion into the Actions panel. There currently is no editor for the snippets so you are left to edit an XML file in the same folder as the panel. You can click the pencil icon to get the path to the XML file though. I have included some example snippets with the extension.

Follow the steps below to try it out:

  1. Download and install the Snippets extension. (Right-click and choose Save Link As or similar)
  2. Open or restart Flash and choose Snippets from the Window > Other Panels menu.
  3. Select a snippet and then press the Copy to Clipboard button.
  4. Paste it into the Actions panel.

Let me know if you find any bugs with it. You can also leave a comment here if you think you have an idea how to make it better.

Thanks,
Lee

Comments

  1. February 19th, 2008 | 7:31 pm

    Oh man you made my day, this is so useful!

    thanks!

  2. allen
    February 19th, 2008 | 7:50 pm

    Hey Lee… it would be cool… as a sequel to have an AIR app to edit the xml file :)

  3. Ben
    February 19th, 2008 | 7:59 pm

    This is really cool!

  4. Rafael Lima
    February 19th, 2008 | 8:04 pm

    Great Lee. :D

  5. lee
    February 19th, 2008 | 8:22 pm

    @Allen Great idea. Hopefully I’ll some more free time soon :)

  6. February 19th, 2008 | 8:45 pm

    Very useful.. thanks!

    I guess an insert right into the actions window is not possible..??

  7. February 19th, 2008 | 9:10 pm

    Very nice, so very useful thanks. I’m sure you are already thinking of it but being able to do the reverse and copy code from the AS editor to a snippet would be super cool.

  8. February 19th, 2008 | 10:00 pm

    Thank you! <3

    I love this functionality in editors such as Coda for OS X and have always wanted it in Flash.

  9. February 20th, 2008 | 12:38 am

    DUDE:.. that´s what i was working on…. :o (

    hehehe Thanks, for sharing!

  10. February 20th, 2008 | 12:54 am

    Awesome!

  11. February 20th, 2008 | 1:05 am

    Thanks. Very good for Flash users. I liked it.

  12. February 20th, 2008 | 2:39 am

    Merci beaucoup !

  13. February 20th, 2008 | 3:30 am

    Oh my!
    This is GREAT!!!

    Niklas

  14. Sjors
    February 20th, 2008 | 3:52 am

    hm i have a dutch version of Adobe Flash cs3 running and it seems like it’s not working here, any clue?

  15. February 20th, 2008 | 6:34 am

    Hi, You continue to amaze! and help us all alot, thanks!!! when are you guys considering an AIR tour to Africa???

  16. Mike
    February 20th, 2008 | 6:56 am

    This is awesome, I keep having to open old projects to pull code that I don’t have memorized yet. This will come in very handy! Love the blog, have fun in Europe

  17. Bobby
    February 20th, 2008 | 7:01 am

    Dude! You are taking the Flash IDE to the next level with your extension :) You rock!

  18. Siemer
    February 20th, 2008 | 8:07 am

    Lol! I was looking for this last week!

  19. Siemer
    February 20th, 2008 | 8:24 am

    And here’s a list of possible improvements (inclusing some previous suggestions by others) :)

    – “Add snippet to script” button
    – Drag snippet into code functionality
    – “Make snippet of selected code” shortcut & button
    – Snippet editing window
    – Tabs or multiple instances with user-defined titles
    – Color coding of snippets

  20. dizy
    February 20th, 2008 | 8:35 am

    A much easier/robust/global way of this very thing can be accomplished with TextExpander for mac or Texter for pc

    check those out… it will change your life :)

    PS. Thanks for all the great tutorials

  21. February 20th, 2008 | 9:31 am

    [...] Snippets kick ace! and events don’t hurt either! [...]

  22. Johan
    February 20th, 2008 | 10:14 am

    Something Ive needed for long time, thanks a lot! Usually Id look for code in old projects, but this can really save time.

  23. February 20th, 2008 | 1:28 pm

    hey lee how are you getting your code to format correctly when you copy and paste it? I added my own snippet to the XML doc but its formatting is broken when I paste it in. Is there a trick?

  24. lee
    February 20th, 2008 | 2:02 pm

    @corbanb Are you including the \n and \t escape characters in your XML. This is how it does line breaks and tabs. Anyone else having trouble with this?

  25. moringo
    February 20th, 2008 | 10:20 pm

    Snippets panel seems to be useful.
    I’ve installed this.but I cant use this panel.
    for english CS3 only? My Flash CS3 is Japanese version.
    There is no snippets panel in window>other panels

  26. February 20th, 2008 | 11:34 pm

    [...] ??? ?????? ?????, ?? ??? ????? ??? ??? ?? ??????? ????. Extension ?? Flash, ????? ?????? ?????? ????? ??? Flash! [...]

  27. pf
    February 21st, 2008 | 12:25 am

    Great idea, mr lee!
    I tried to make s simple for loop – no success …
    Much anticipated it is ” that s***ws things up.

  28. pf
    February 21st, 2008 | 12:27 am

    whoops. Start and end tags are missing in the above post!

  29. February 21st, 2008 | 6:08 am

    [...] Lee Brimelow stellt in seinem WebBlog seine neue Snippets Extension vor. Dieses Erweiterung erlaubt die komfortable Speicherung sogenannter Codesnippets. Diese Codeschnipsel können ganz einfach vom Clipboard in das ActionScript Panel eingefügt werden. Webseite besuchen [...]

  30. February 21st, 2008 | 7:23 am

    Lee I like where you are going with this extension. I wish there was more access to customizing the actionscript editor, though.

    dizy, Texter seems really cool. I am gonna dl it and give it a shot.

  31. February 21st, 2008 | 10:04 am

    Instead of having ascript as an attribute of the snippet node, would it be easier to create a ascript node as a child of the snipped node so that we coud use CDATA? Wouldn’t that eliminate the need to comment out quotations and such?

    If possible, could you post the .fla file?

    Thanks for the work Lee. Really saves time in setting up a movie.

  32. February 21st, 2008 | 10:04 am

    Downloading! … Thanks!

  33. February 21st, 2008 | 10:04 am

    Here is a snippet for loading a style sheet followed up with loading an xml file.

  34. February 21st, 2008 | 10:06 am

    Sorry … the snippet didn’t post.

  35. Daniel
    February 21st, 2008 | 10:07 am

    Nifty little app. The only thing that bugs me is that the bottom right hand icon to resize the app overlaps the “Copy to Clipboard” button. Otherwise…fireworks and Eskimo Pies.

  36. Freddy
    February 21st, 2008 | 11:31 am

    Nice work Lee…some ideas though:

    I been using one panel called “Prototype manager” since 2003 for this purpose…can’t remember or find it or where I got it.

    this one lists snippets on categories: movieclip, sound, array, etc on a drop down list, to add one snippet you select the category, hit add button, write a title, write or paste the code on the edit textfield, hit save button and that’s it.
    to recover the snippet you select it from a list box that shows all the snippets titles, or the available snippets if any particular category is selected. you can edit the snippet by selecting the snippet title and clicking on edit button… really useful panel

    Cons. it saves all the snippets on a shared object… not easy to backup :( so xml is way better idea!

  37. Mike
    February 21st, 2008 | 11:50 am

    Hey Lee,

    This is truly a great addition to the flash IDE. However, I’m having one small problem with it. It appears for me at least, that the when I close flash and re-open it, the xml generated list in Snippit is in absence. To fix it, I have to close the panel and re-open it though the Other Panels menu. Not a big deal, just would be nice to leave it in my panel group all the time and not have to open it every time I start flash.

    Again, thankyou.

  38. February 21st, 2008 | 12:25 pm

    One more tool, yess!! Thanks Mr. Lee.

  39. February 21st, 2008 | 1:34 pm

    @lee it was the ‘\t’ I was missing. Thanks for the heads up!

  40. February 24th, 2008 | 7:56 am

    Why not use CDATA?

  41. Rob
    February 25th, 2008 | 8:13 am

    http://www.gotoandlearnforum.com/viewtopic.php?f=9&t=16255&start=0&st=0&sk=t&sd=a

    Custom Extensio i built to make Tweener easier to use, sorry its a bit off topic.
    keep up the great work
    Rob

  42. Mike
    February 26th, 2008 | 2:34 pm

    Lee — This is awesome! The only thing is when I paste in my snippets, it pastes the escape characters with it, unformatted. Has anyone else experienced this? Is there a workaround? (Running Mac 10.5.2)

  43. Andrew
    February 27th, 2008 | 4:59 pm

    It’s about time someone thought of this. And I knew it most likely would have been lee.

  44. Justin
    February 28th, 2008 | 12:06 am

    Thanks Lee. This saves a ton of time.

  45. Jer
    February 28th, 2008 | 11:13 am

    My \n shows up as \n.. This isn’t my code, I’m trying to use the default codes included with the panel.

  46. Reini
    March 2nd, 2008 | 10:33 am

    Hi, I’m having the same issue with the panel. When I copy the code to the Clipboard the \n shows up in the code. Is there a away to fix this problem. The panel itself would be a really great extension, if it would work as suggested ;-)

  47. Chris
    March 4th, 2008 | 9:51 am

    THANK YOU!!! BEEN WAITING YEARS FOR SOMETHING LIKE THIS!
    Can’t wait for upgrades! =D

  48. Mutek
    March 15th, 2008 | 1:34 pm

    Cool panel!

    It would be good to double click a snippet and get it ready on the clipboard without press the “copy to clipboard” button.

    Would you share the FLA someday?… so we can personalize it.

    Thanks good work!

  49. Chris
    March 25th, 2008 | 9:47 am

    Hi Lee,
    first off, thank you for this nice snippet panel!

    Sadly it seems that the .mxp only works with english versions of flash, right?
    Is there a way to use the extension on foreign versions of flash?

    Thanks and best regards,
    Chris

  50. Paul
    March 26th, 2008 | 5:32 am

    This is perfect! Thank you very much

  51. May 3rd, 2008 | 12:07 am

    Hi Lee,

    Very nice extension indeed, there is a glitch as you know with the four extra snipets, I’ve fixed it by just using single quotations where there’s double and vice versa. I’ve then wrapped the old snipets and the four new ones in an updated mxp, here it is:

    http://rapidshare.com/files/112166176/Snippets.mxp

    Thank you for your contributions to the flash community.

    Wassim

  52. May 19th, 2008 | 6:38 am

    when you get a code that you want to save into the snippet, how can you condense the script into one line of code like the existing ones on there? it pastes the same as when you copy it and thats causing an error..

    any ideas?

  53. Byron
    June 3rd, 2008 | 11:56 pm

    Thank you, this is extremely valuable.

    I’m having trouble when inserting:
    var button:String = “”;

    Apparently “” is the issue.
    Is there a workaround for this?

    Thanks again.

  54. ???
    June 23rd, 2008 | 11:43 pm

    ??!????????,??????FLASH.???????.

  55. anton
    June 25th, 2008 | 10:05 am

    Yep, using quotations inside of a snippet seems to be a no-no at the moment. Blast.

  56. benway
    June 26th, 2008 | 9:01 am

    This looks very cool! It’s a shame the quotation bug basically makes this useless. Hope you can work that out!

  57. August 16th, 2008 | 4:21 am

    [...] Free components can make life easier. I use the components from TheFlashBlog: Snippets Panel: http://theflashblog.com/?p=336 Event Generator: http://theflashblog.com/?p=331 calculator: [...]

  58. nick
    September 6th, 2008 | 11:32 am

    Have just discovered this extension, which in theory is a great idea. I won’t go to the trouble of explaining the javascript syntax error, but since the last post in the blog entry was almost a month ago, I was hoping there had been some clever cookie that had found a solution?

  59. September 25th, 2008 | 9:44 pm

    Sweet, Snippet! Widget! Gizmo!. Works a treat…

  60. kaa
    October 24th, 2008 | 8:16 pm

    hi lee.
    yours is very cool mxp,i used it.
    but i feel its can be more usefull tool.
    so i remake such one.
    http://pollo.tostada.org/snipetsCP_100.mxp

    i fixed:
    copy to clipboard by only 1 click.
    fixed if use 2 byte font on list section
    more easy to edit snipets XML. (multiline,dont use like a escape code)

  61. MartinB
    October 29th, 2008 | 3:31 am

    Is it possible to configure so you can place the snippet.xml-file on a server so it can be used by multiple developers on a team??

  62. November 2nd, 2008 | 7:15 am

    [...] So of course, I find myself typing a whole lot of the same few lines of code over and over (and over). The obvious solution was to use a snippets panel. Lee Brimelow has a nice one. http://theflashblog.com/?p=336 [...]

  63. Vebguru
    November 9th, 2008 | 11:05 am

    This is very useful. thank you

  64. November 15th, 2008 | 6:01 am

    [...] flaws like no interface to interact with it, it is a very nice alternative to a previously created snippets panel created Lee [...]

  65. Marc
    November 29th, 2008 | 5:03 am

    Hello,
    how to make the panel available in Flash CS4 ? Afterimporting the mxp nothing is shown?!

  66. January 13th, 2009 | 12:51 pm

    Woot! With you creating JSFL panels, this means that the Flash team might actually fix some of the longstanding JSFL issues and maybe add some new functionality (like being able to edit scripts!).

  67. Tamer Ibrahim
    February 15th, 2009 | 1:54 am

    how to make the panel available in Flash CS4 ? Afterimporting the mxp nothing is shown?!

  68. Tamer Ibrahim
    February 15th, 2009 | 1:57 am

    how to make the panel available in Flash CS4 ?

  69. March 3rd, 2009 | 9:42 pm

    [...] you remember the snippet panel that Lee Brimelow built a while back? Lee has now rebuilt it from scratch using Flex and it has [...]

  70. Chris
    May 20th, 2009 | 3:43 am

    Any tips on how to get this installed in Flash CS3?
    It’s not showing up there for me.

    I have CS4 and CS3 installed (honestly I loathe Flash CS4) but I want to use this extension in *CS3* not CS4! Anyone?

  71. September 14th, 2009 | 11:15 pm

    Thanks for the snippets ext. I am currently digesting your scrollBar tutorials and noticed that you had this ext in your vid. It will come in handy. Love your work!

  72. junry
    December 2nd, 2009 | 2:27 am

    another awesome flash tool from the awesome guy Mr. Lee.

  73. michel
    January 26th, 2010 | 2:58 am

    Nice, what about some sort of panel a la php dev toolkit for flash?

  74. February 1st, 2010 | 8:10 am

    This is so cool. Nuff Said.

Leave a reply