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


Commentary

  1. Genaro Rocha says:

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

    thanks!

  2. allen says:

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

  3. Ben says:

    This is really cool!

  4. Rafael Lima says:

    Great Lee. :D

  5. lee says:

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

  6. simurai says:

    Very useful.. thanks!

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

  7. Peter Witham says:

    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. Robert says:

    Thank you! <3

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

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

    hehehe Thanks, for sharing!

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

  11. David says:

    Merci beaucoup !

  12. Niklas says:

    Oh my!
    This is GREAT!!!

    Niklas

  13. Sjors says:

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

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

  15. Mike says:

    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

  16. Bobby says:

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

  17. Siemer says:

    Lol! I was looking for this last week!

  18. Siemer says:

    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

  19. dizy says:

    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

  20. Johan says:

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

  21. corbanb says:

    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?

  22. lee says:

    @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?

  23. moringo says:

    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

  24. pf says:

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

  25. pf says:

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

  26. timk says:

    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.

  27. Craig says:

    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.

  28. Rafeo says:

    Downloading! … Thanks!

  29. Craig says:

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

  30. Craig says:

    Sorry … the snippet didn’t post.

  31. Daniel says:

    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.

  32. Freddy says:

    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!

  33. Mike says:

    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.

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

  35. corbanb says:

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

  36. milkmidi says:

    Why not use CDATA?

  37. Rob says:

    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

  38. Mike says:

    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)

  39. Andrew says:

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

  40. Justin says:

    Thanks Lee. This saves a ton of time.

  41. Jer says:

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

  42. Reini says:

    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 ;-)

  43. Chris says:

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

  44. Mutek says:

    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!

  45. Chris says:

    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

  46. Paul says:

    This is perfect! Thank you very much

  47. Wassim says:

    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

  48. dave says:

    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?

  49. Byron says:

    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.

  50. ??? says:

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

  51. anton says:

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

  52. benway says:

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

  53. nick says:

    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?

  54. Spider says:

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

  55. kaa says:

    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)

  56. MartinB says:

    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??

  57. Vebguru says:

    This is very useful. thank you

  58. Marc says:

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

  59. Steven Sacks says:

    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!).

  60. Tamer Ibrahim says:

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

  61. Tamer Ibrahim says:

    how to make the panel available in Flash CS4 ?

  62. Chris says:

    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?

  63. Adam says:

    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!

  64. junry says:

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

  65. michel says:

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

  66. Steve says:

    This is so cool. Nuff Said.

  67. Gerry Levens says:

    Firstly thanks for this. I’ve been using it for a few weeks now.

    The only issue I find with it is when using \if (i<j){//do something}" the xml code doesn't like greater than or less than notation. Obviously this is because these characters are reserved in the xml notation. Do you have any suggestions for a work around? I've got away with it so far by changing what I test but this won't be possible in all circumstances.

  1. [... 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 ...]

  2. [... 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 ...]

  3. [... 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 ...]

  4. [... 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 ...]

  5. [... 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 ...]

  6. [... 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 ...]

  7. [... 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 ...]

Leave a Comment