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 create a highlighted bolded text?
<q> <strong> <em>
<p>Address: <strong></strong> - Tutorials.</p>
Which of these CSS codes displays the text bolded?
text-size: 18px; font-style: italic; font-weight: 800;
#id {
  font-weight: 800;
What JavaScript function can be used to call another function multiple times, to a specified time interval?
setInterval() setTimeout() push()
function someFunction() { alert(""); }
setInterval("someFunction()", 2000);
Click on the correctly defined variable in PHP.
var vname = 8; $vname = 8; $vname == 8;
$vname = 8;
echo $vname;
Code Snippets - Add and Create

Last accessed pages

  1. Create simple Website with PHP (15880)
  2. The Fifth Agreement (13659)
  3. Bubble Hit (2313)
  4. Bubbles3 (46362)
  5. Clusterz (268)

Popular pages this month

  1. Qwop (7625)
  2. Drag Racer V3 (4432)
  3. Bubbles3 (1775)
  4. Flash Games - Free online Games (1614)
  5. Butterfly Kyodai (1286)