Code Snippets are pieces of predefined code that can be reused, saved in the "Code Snippets" panel. They are organized on cathegories and functions, such as: "Animation", "Timeline Navigation", and others.
You can open this panel from the Window -> Code Snippets menu, or the button "Code Snippets" found in the Actions panel (as you can see in the following image).

Code Snippets
Flash has a few functions /codes saved in "Code Snippets". For example, to make a button execute a jump to a certain frame, instead of writing the whole code (with the necessary event and function), you can add it directly from the "Code Snippets" panel, being saved in the "Timeline Navigation" catalogue, with the name "Click to Go to Frame and Play".
To add a code-snippet into your script, double-click on its name, select it and click the button "Add to current Frame".
• Flash has in "Code Snippets" some of the most used functions for working with ActionScript. To learn about them you must browse their list, the name with which they are saved also explains their role.

Besides these predefined functions included in Adobe Flash, you can also add your own pieces of code to be stored in "Code Snippets", useful when you usually use a same code expression, functions or any code.
• To add your own code in the "Code Snippets" panel, you must click on the panel's options menu (upper-right)and choose the option Create New Code Snippet, Flash will open a window as the one in the following image.
Create Code Snippets
- At Title you must write the name (as suggestive as possible) that will appear for that code added in "Code Snippets".
- The description that is writte at Tooltip will appear when the mouse is positioned over the name stored in the panel.
- You write the ActionScript code in the text area, Code. If a certain piece of the code is already selected in the "Actions panel", use Auto-fill button to add the selected code in the "Code" area.
- After pressing the OK button, the respective code is added with the name specified at "Title" in a folder named "Custom" (created automatically by Flash).

Predefined codes as well as those added in "Code Snippets" are stored in a XML file.
- To re-edit a Code Snippet, right-click on its name and choose Edit Code Snippets XML. This will open the XML file with all the predefined codes from the panel. Then, you must find the code in that file (with "Ctrl+F") and edit it. Then click File -> Save.
- The option "Copy to Clipboard" (which appers when you right-click on a code-snippet) copies the respective code in memory, and then it can be added (with Paste) in the "Actions panel".
- With "Delete Code Snippet" the respective code will be deleted from the panel.
- The XML file with all the codes stored in "Code Snippets" can be exported with the option "Export Code Snippets XML".
- With "Reset to Default XML" the "Code Snippets" panel is restored to it's initial predefined codes.

Daily Test with Code Example

Which tag adds a new line into a paragraph?
<b> <br> <p>
First line ...<br>
Other line...
Which CSS property can be used to add space between letters?
text-size word-spacing letter-spacing
#id {
  letter-spacing: 2px;
What JavaScript function can be used to get access to HTML element with a specified ID?
getElementById() getElementsByTagName() createElement()
var elm = document.getElementById("theID");
var content = elm.innerHTML;
Click on the "echo" correct instruction.
echo "" echo ""; echo """;
echo "Address URL:";
Code Snippets - Add and Create

Last accessed pages

  1. jQuery Drag and Drop Rows between two similar Tables (6395)
  2. Ajax-PHP Chat Script (35183)
  3. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (8982)
  4. PHP OOP - Final Classes and Methods (3622)
  5. Understanding OOP - Object Oriented Programming (3406)

Popular pages this month

  1. Qwop (4885)
  2. Get Attribute (ID, Class, Name, Title, Src) with jQuery (2980)
  3. Get the value of the selected /checked checkboxes in a form (2317)
  4. Drag Racer V3 (1932)
  5. Flash Games - Free online Games (1569)