# Viewing Code

**URL:** <https://forum.kirupa.com/t/viewing-code/20502>\
**Category:** flash\
**Created:** [May 9, 2003, 9:23am UTC](https://forum.kirupa.com/t/viewing-code/20502 "2003-05-09T09:23:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![soulty](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/soulty/32/105_2.png) [@soulty](https://forum.kirupa.com/u/soulty)\
**Post date:** [May 9, 2003, 9:23am UTC](https://forum.kirupa.com/t/viewing-code/20502/1 "2003-05-09T09:23:29Z")

</div>

Hey all , ive been working with alot of code lately and i like to have variations of code, but to view different code to compare, i would have to save the document as movie2 , and movie3 , so on…

Is there any app or method that i could view Actionscript with all the colour reference, in a totally different window, almost like a duplicate of the actions palette.

:: so i could have 2-3 or more code reference at one time?

thanks  
::soulty:😏:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 12:53pm UTC](https://forum.kirupa.com/t/viewing-code/20502/2 "2003-05-09T12:53:23Z")

</div>

bump;)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 12:55pm UTC](https://forum.kirupa.com/t/viewing-code/20502/3 "2003-05-09T12:55:02Z")

</div>

using external .as files, include them in the fla with #include and use a editor to edit that code seperately (allowing you to have multiple windows open at once, of the same code and of different code chunks)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 12:56pm UTC](https://forum.kirupa.com/t/viewing-code/20502/4 "2003-05-09T12:56:09Z")

</div>

could you give me a example?  
thanks sen 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 1:01pm UTC](https://forum.kirupa.com/t/viewing-code/20502/5 "2003-05-09T13:01:46Z")

</div>

how would you get external action script files? . Sorry dude don’t really understand what you mean. :-\

::are you saying just copy and past your code into text editor and editing it there?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 1:15pm UTC](https://forum.kirupa.com/t/viewing-code/20502/6 "2003-05-09T13:15:32Z")

</div>

yeah. You can “replace” script in your fla with something like

[color=blue]#include[/color] “myScriptFile.txt”

where all the script that would normally be there in Flash is in that text file (located in the same directory as the fla). Then, when you publish your swf, Flash will read that line of code (the #include) open up the specified file and replace that #include line with the contents of that file and include it in the final swf. You can either do this by cutting and pasting the fla script into a new file or start that way to begin with - with the intention of having the script in a seperate file and begin your code in a seperate script file.

This lets you easily edit actionscript outside of Flash and have other windows open etc like you explained. Its also an easy way to share code, not only with other people but between your different projects.

Now, I mentioned before that the script file (they’re commonly named .as or .mx instead of .txt btw) should be located in the directory of the fla. This is really one of two places Flash looks for .as or any other include files though. If you have script specific to that one movie, then you might want to keep it in with that fla whereever it is. However, in terms of sharing as I mentioned before, youd want it easily accessible to any fla that you make. For that you would make a folder in  
**Macromedia\Flash MX\Configuration**  
called Include so you have  
**Macromedia\Flash MX\Configuration\Include**  
^this is the other place Flash looks for #include files. Throw any .as files you make which you want available to all movies in there so you can easily include them in any movie with

[color=blue]#include[/color] “filename.as”

Just like common libraries only this is common actionscripts.  
Note is that there is NO semicolon (;\*\*) after a #include. Doing so will result in an error. However, be sure to have an ending semicolon (or extra line break) in your .as file as when Flash reads #include statements like so:

```auto
#include "myFile1.as"
#include "myFile2.as"
#include "myFile3.as"

```

it ignores that newline character and appends the code in those files directly on the backend of the previous; as if you have written them like:

```auto
#include "myFile1.as"#include "myFile2.as"#include "myFile3.as"

```

Having an ending semicolon or line break in your as files will prevent an error resulting from that.

For a good actionscript editor I suggest SciTE|Flash. You can download it here:  
[http://www.bomberstudios.com/sciteflash/dl.php](http://www.bomberstudios.com/sciteflash/dl.php)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 1:19pm UTC](https://forum.kirupa.com/t/viewing-code/20502/7 "2003-05-09T13:19:10Z")

</div>

kool , thanks mate. How about the colour reference that actionscipt gives out? is there a way to have that in your external .as?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 1:30pm UTC](https://forum.kirupa.com/t/viewing-code/20502/8 "2003-05-09T13:30:48Z")

</div>

Never mind i installed that Sciteflash app , its awesome , exactly what i was looking for 🙂 thanks for the link.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 9, 2003, 1:31pm UTC](https://forum.kirupa.com/t/viewing-code/20502/9 "2003-05-09T13:31:03Z")

</div>

> \*Originally posted by Soulty \*  
> \*\*kool , thanks mate. How about the colour reference that actionscipt gives out? is there a way to have that in your external .as? \*\*

see the as editor I suggested 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 9, 2003, 8:06pm UTC](https://forum.kirupa.com/t/viewing-code/20502/10 "2003-07-09T20:06:47Z")

</div>

Just thought I’d mention this since it caused me a bit of head-scratching. On my PC the folders **Macromedia\Flash MX\Configuration** can be found in two places:

\*_C:\WINDOWS\Application Data\*_  
and  
\*_C:\Program Files\*_

For me the Include folder needed to be here:  
**C:\Program Files\Macromedia\Flash MX\Configuration\Include**

The **C:\WINDOWS\Application Data\Macromedia\Flash MX\Configuration** folder is used for things like installed components but didn’t seem to work for custom #include files.

Hope it helps,

-PiXELWiT  
[http://www.pixelwit.com](http://www.pixelwit.com)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 9, 2003, 8:41pm UTC](https://forum.kirupa.com/t/viewing-code/20502/11 "2003-07-09T20:41:48Z")

</div>

yeah, in components a $flash token is used to specify the Flash configuration folder. For most all things (components and panels etc) this refers to the Application Data directory. #include files, however, are always in the actual Macromedia program files directory.

Application Data, for multi-user systems, will be in each users profile and unique for each. Other settings such as panel layouts are also kept there.

ex:

Win2K:  
C:\WINNT\Profiles[User]\Application Data\Macromedia\Flash MX\Configuration

WinXP:  
C:\Documents and Settings[User]\Application Data\Macromedia\Flash MX\Configuration

OSX:  
[User]/Library/Application Support/Macromedia/FlashMX/Configuration/

However, note that those files placed in the FirstRun (config) directory of the Flash program directory will be copied into the user application data directory on … well first run of Flash 😉
