1 0 Tag Archives: actionscript
post icon

A Flash Game

I just finished a small project for a friend of mine. I made a sweet flash game, where you try and shoot down helmets while being timed. After you shoot all the helmets you enter your initials and email address for a chance to win a free Darren Berrecloth signed, signature Deviant Helmet from Specialzied! Well you have to have the low score but it’s a fun time anyway!

I used Flash and Php together for one of the first times and had some fun. Actually the game was just a modified version of a project I did in school earlier this year. It didn’t have the php/mysql funtionality to log scores, but meow it does!

Leave a Comment
post icon

Creating a email form using actionscript and php

I just finished an email form that I put up on my contact page. It was an assignment for my Actionscript class. I used Actionscript to import and place the components, validate, and send data using a LoadVars function to a php script, which then sends off an email to myself. This was the first time I used Actionscript and PHP together and I’m stoked on what you can do with it. My minds really starting to buzz and I can’t wait to learn more.

Leave a Comment
post icon

Flash Application Security Tips

Here is some scripts that can be useful to mess with that evil person that decompiles your .swf’s and tries to copy your Flash applications. Although these won’t completly stop your enemy from getting your .fla file and using it in there own project, it can help the frustration process for them, which would lead them to just trashing your files and moving on.

First way:
use a this._url and != to your own swf file.

myURL = this._url;
if (myURL != "http://yourdomain.com/your.swf") {
 do {
  //give em an infinite loop!
 } while (true);
}

Second way:
using a infinite loop would only tell the evil doer that there is something screwy with you file (would only take about 15 seconds before displaying a message) and with any skills would probably go searching through your scripts right away. So throw them off with an interval that slows there player down like crazy.

myURL = this._url;
setInterval(slowFlashPlayer, 1);
function slowFlashPlayer() {
 for (i = 0; i < 15000; i++) {
  x = Math.random();
 }
}

Third way:
if your application uses multiple swf’s loaded into different levels, why not hide the security script in one of those levels to make the process of finding the code a little harder.

function mess() {
 clearInterval(m);
 var myURL:String = _level0._url;
 if (myURL != "http://yourdomain.com/your.swf") {
  do {
   //do the infinite loop every 3 seconds
  } while (true);
 }
 var m:Number = setInterval(mess, 3000)

}
Fourth way:
give that evil customer a real test. Create some random variables that mean nothing and hide them in different parts of your application. Then use a getDate(); and only run the statement on certain days! You could point there application to a bad site ie: porn or something similar. If they used your file for a client job they would not likely see this problem. But you can be sure the client will see it. If your not the badass type you could just point them back to your site making them scratch there head, while giving your site some publicity.

var u:String = this._url;
var s:String = "http://yourdomain.com/your.swf";
var d:Date = new Date();
var z:Number = 4;
if (d.getDate() == z) {
 if (u != s) {
  getURL("http://sendthemsomewheresweet.com"); //this could be getURL(s); for your domain
 }
}
Leave a Comment
post icon

Basic Flash Drawing Application

This is a quick Flash App that I did yesterday for my actionscript class. It’s fairly basic and looks cool! This is all done with 3 layers and 1 keyframe in each layer. I did do the pencil with Maya but you could use anything. It’s just a .png file for the transparency. I turned it into a Movie Clip named pencil_mc. Put it on the stage and then just added the script. See the rest of this post for the code.

Just insert this code into your first frame keyframe, create a new empty movie clip named empty_mc, and create a pencil or something called pencil_mc, and done!

// the pencil starts to drag. the regular mouse cursor is also hidden for better effect!
startDrag(pencil_mc, true);
Mouse.hide();
// create a variable and assign it a boolean
var drawing:Boolean = false;
//created key listener to listen for SPACE press then clear canvas
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
 if (Key.isDown(32)) {
  empty_mc.clear();
 }
};
//created mouse listener to listen for mouse down then draw
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
 empty_mc.lineStyle(3, 0x999999, 50); //line(width, color, opacity)
 empty_mc.moveTo(_xmouse, _ymouse);
 drawing = true;
};
mouseListener.onMouseMove = function() {
 if (drawing) {
  empty_mc.lineTo(_xmouse, _ymouse);
  updateAfterEvent();
 }
};
mouseListener.onMouseUp = function() {
 drawing = false;
};
Mouse.addListener(mouseListener);
Key.addListener(keyListener);

Download the zip file here

Leave a Comment