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

Click on the tag that creates an ordered list
<ul> <tr> <ol>
Which selector represents the ID of an element in CSS
.name #name name
#id {
  color: #0110fb;
What statement creates an object in JavaScript?
{} [] new Date()
var obj = {"site": "", "pr": 5};
Indicate the instruction used to evaluate if a condiition is True or False
else if() switch()
$var = 8;
if($var == 8) echo $var;
Code Snippets - Add and Create

Last accessed pages

  1. Drag Racer V3 (948)
  2. The Number and Math Objects (344)
  3. Download JavaScript resources (2345)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (33344)
  5. Recursive function to create Multi-Level Menu in PHP (4811)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (49682)
  2. Read Excel file data in PHP - PhpExcelReader (38072)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (37003)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (33344)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (30742)