Skip to content

Toga Games

                               Game on!

Archive

Category: Flash AS2 Tutorials

I did a code for someone that needed a simple mouse avoider code.

Here it is: AS2 FLA

Get Adobe Flash player

This method requires Flash and JavaScript to work.

FLASH: Inside Flash you will create a form to enter the desired text.
Inside flash all you will need to send your text to the JS function are these lines:

var chatType=”whatever you typed in the chat box”;

getURL(“javascript:writeToFile(‘”+chatType+”‘)”);

JAVASCRIPT: Inside the html page which your Flash movie resides.
This requires your browser to have low security settings. I use IE to do this. Inside Internet Options >> Security >> Custom Settings
make sure scripting is enabled.

We will call this from inside of Flash. Put the following code into your HTML page:

/* WRITE THE FILE */
function writeToFile(arg)
{
var fso = new ActiveXObject(“Scripting.FileSystemObject”);
var s = fso.CreateTextFile(“C:\\Logs\\settings.txt”, true);
s.WriteLine(arg);
s.Close();
}

Get Adobe Flash player

Middle MouseWheel to zoom

[source: flash 8 (as2)]

If you found this app helpful, please feel free to donate to our site.

Get Adobe Flash player

[source: flash 8 (as2)]

If you found this app helpful, please feel free to donate to our site.

Get Adobe Flash player

[source: flash 8 (AS2)]

If you found this app helpful, please feel free to donate to our site.

Get Adobe Flash player

[source: Flash 8 (AS2)]

If you found this app helpful, please feel free to donate to our site.