jump to navigation

AS3 Code Snippets For the Flash CS3/CS4 IDE August 15, 2010

Posted by Tournas Dimitrios in Flash.

Snippets are a great way to save time and store valuable pieces of code that you often use. Not only are they great to grab just with copy/paste when needed, but there are a variety of panels out there for Flash that let you access these snippets of code directly from within Flash. I use Snippets Panel, which I found at Lee Brimlow’s TheFlashBlog.

Download Snippets Panel:
Snippets Panel

Install this .mpx component with the usual procedure (Double click the .mpx and the Extension Manager of your IDE will handel the installation)

Restart your Flash IDE and go to Window>Other panels>Snippets

Now the Snippets panel can be accessed .Select the code  snipped  of your choice and Copy-Paste it in your project.

The “Snippet” component will create a xml file on the following location of your hard disc “C:\Documents and Settings\yourComputerName\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\WindowSWF”.You can add code snippets trough directly editing this xml file or with the help of the Snippet panel inside of the Flash IDE

The syndax of the xml file is :

<?xml version="1.0" encoding="utf-8"?>

	<snippet label="Papervision3D Imports" ascript="import org.papervision3d.cameras.*;\nimport org.papervision3d.objects.*;\nimport org.papervision3d.materials.*;\nimport org.papervision3d.scenes.*;" />

	<snippet label="Papervision3D Scene3D Setup" ascript="import org.papervision3d.cameras.*;\nimport org.papervision3d.objects.*;\nimport org.papervision3d.materials.*;\nimport org.papervision3d.scenes.*;\n\nvar container:Sprite = new Sprite();\naddChild(container);\ncontainer.x = stage.stageWidth * 0.5;\ncontainer.y = stage.stageHeight * 0.5;\n\nvar scene:Scene3D = new Scene3D(container);\nvar camera:Camera3D = new Camera3D();\ncamera.zoom = 11;\n\naddEventListener(Event.ENTER_FRAME, loop);\n\nfunction loop(e:Event):void\n{\n\tscene.renderCamera(camera);\n}" />

	<snippet label="Tweener Random Loop" ascript="import caurina.transitions.*;\n\nfuncti</snippets>


1. anonym - June 19, 2011

i’m using cs4 flash but i cant acces to snippets. Is this just for cs3? What i must to do about it?

tournasdimitrios1 - June 19, 2011

For CS4 download the new release of the code snippets panel from here >>>>> .
This new release is simplified and some bugs are fixed .
Installation instructions :
Download the zip file on your computer , unzip the content ( snippets.swf and snippets.xml ) on the following location
C:\Documents and Settings\User-Name\Local Settings\Application Data\Adobe\Flash CS4\en\Configuration\WindowSWF
/[USER]/Library/Application Support/Adobe/Flash CS4/en/Configuration/WindowSWF
Now start Flash CS4 and access the snippets panel from Window -> Other Panels -> Snippets .
Enjoy !!!

On Windows the path may be slightly different based on your OS. I’m sure you can do some investigation and find the directory.

2. sandeep - September 7, 2011

the CS4 Link is Very very dreadlistssssssssl. dread dead dead. OK
Please send me snippet panel for cs4.

tournasdimitrios1 - September 7, 2011

The developer of this snippet is Lee Brimerlow . Try to get in contact with him .

3. Kanna - September 27, 2011

Thank you bro

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s