Archive for the 'Flash' Category

Natural Docs with Flash

Jeff July 10th, 2008

There isnt actually anything that is ‘installed’, you just need to put the files in directories and point them to each other.

  1. Download Natural Docs from here
  2. Unzip the directory to a folder on your C drive (i.e.:_NaturalDocs)
  3. Download ActiveState - ActivePerl from here  (Click ‘Get ActivePerl’ on right side of screen, then ‘Download’)
  4. Running the install (I chose the .msi) will create a ‘Perl’ directory on your C drive
  5. Modify the NaturalDocs.bat file in your _NaturalDocs folder to point to your Perl directory. (this is line 15 of the file, replace ‘perl‘ with:
        C:\Perl\bin\wperl.exe NaturalDocs %NaturalDocsParams%
  6. In your project folder where your code is, create the following folders:
    1. as (this is where your actionscript files will be)
    2. MyDocumentation (this is where your documentation will be generated)
    3. NaturalDocsProjectFolder (this is your Natural Docs ‘project directory’)
  7. Create a bat file (text file ending in .bat) in your Natural Docs directory called ‘GenDocsMyProject.bat’ (The following three lines all need to be on separate lines of your .bat file and the folders listed need to match those created in step 6).
  8. Syntax:

    @echo off
    "C:\_NaturalDocs\NaturalDocs.bat" -i C:\Project\MyProject\as -o html C:\Projects\MyProject\MyDocumentation -p C:\Projects\
    MyProject\NaturalDocsProjectFolder
    pause

  9. (This last step is optional) Create a shortcut to your .bat file in your project directory so that when you change your comments you can re-generate the documentation without needing to go to your Natural Docs directory and double clicking the .bat file.

You need to document your code in a specific way for Natural Docs to be able to generate documents from it.  See hereTo generate your documentation, doubleclick the .bat file (or shortcut) each time you change your code comments.  There is a way to have the documentation run as a part of the build process but I have not figured that out yet.

Full Browser Flash Website

Jeff August 30th, 2007

I was looking through my Flash files the other day and found this. It is a full page flash website, meaning that the flash fills the entire page regardless of the size of the user’s browser. It is written in AS2 and isnt coded the best as I wrote it awhile ago but is a great introduction to using tween classes. (This one uses MC Tween).

Demo

Full Browser Code

MovieClipLoaderClass - AS2

Jeff August 21st, 2007

I have been reading a lot of questions about how to properly load movies in projects using actionscript2. This is how I do it:

var my_mcl:MovieClipLoader = new MovieClipLoader(); //Used to load the image

button1_mc.onPress = function() {
my_mcl.loadClip(movie1.swf, container_mc); //loading a movie into a container movie clip (just an empty mc on the stage)
};

button2_mc.onPress = function() {
my_mcl.loadClip(movie2.swf, container_mc); //loading a movie into a container movie clip (just an empty mc on the stage)
};

var mclListener:Object = new Object();
my_mcl.addListener(mclListener);

//the three listeners below are optional
mclListener.onLoadStart = function(container_mc:MovieClip) {
//The listener tells this function that downloading the image has begun and to perform whatever code you put here
};
mclListener.onLoadError = function(container_mc:MovieClip, errorCode:String, httpStatus:Number) {
// this function fires if there is an error in loading the movie
trace(”loadListener.onLoadError()”);
trace(”==========================”);
trace(”errorCode: ” + errorCode);
trace(”httpStatus: ” + httpStatus);
}
mclListener.onLoadComplete = function(container_mc:MovieClip) {
//The listener tells this function that downloading the image has completed and to play whatever code is here
}

If I lived in Springfield I would look like:

Fun Flash Game - Protect Your Desktop!!!

Jeff June 26th, 2007

http://www.handdrawngames.com/DesktopTD/Default.asp?cc=1