Art and Development Blog
Posted by Markham at 1:39am, 7/18/2010 (CDT)

An issue many of us have as Flash animators and game developers is protecting our work from appearing on websites that for some reason or another we don't want it to show up on.

Site-locking is the method of locking your Flash file so that it works only on the website(s) you want it to. There are numerous methods for site-locking your project out there on the web, but many are simple and don't protect against more devious content-lifters.

Most site-locking scripts are designed with the following logic: you want it to only work on mywebsite.com, so you make it so that it only works when mywebsite.com is part of the URL. This is pretty effective until someone places your file in a certain folder such as www.badwebsite.net/mywebsite.com/, or plays around with their sub-domains so that they have it working on mywebsite.com.badwebsite.net.

So how do we go about coding a site-lock that takes these problems into consideration? The first thing we'll want to do is get the URL that the Flash document is being hosted on:

var siteURL:String = root.loaderInfo.url;

The URL will be build of three main sections. The first is the transfer protocol. This is the http:// part of the URL. We'll want to strip that off our URL, though there are a number of different protocols each with different acronyms. To get around this, we use the split function to split the URL where the "://" part is.

var httpBits:Array = siteURL.split("://");

We now have the variable httpBits, which is an array containing the split strings from siteURL. httpBits[0] will contain the "http" string and the second two parts of the URL after the "://" part is stored in httpBits[1].

So now that we've removed one part of the URL, we're left with the other two parts: the domain name and the folder(s) that contain your file. We only want the domain name, and we can get that by splitting our string with "/".

var urlBits:Array = httpBits[1].split("/");

Now we have the array urlBits containing the domain name and each folder along the directory tree to your file. The domain name is stored in urlBits[0], but there is still one more step to take before we can compare the URL's domain name with our preferred domain name.

The domain name can be as short as domain.com, but it can also be lengthened by sub-domains, which can be named in ways meant to trick your site-locking scripts as presented above. We will need to split the domain name with ".":

var domainBits:Array = urlBits[0].split(".");

Now that we have an array of domain parts, we can start comparing them. The real domain we want to check with will be stored in the last two entries in our domainBits array, so we can finally use them to check the website's domain name:

var i:int = domainBits.length;

if (domainBits[i-2].indexOf("mydomain") < 0 ||	domainBits[i-1].indexOf("com") < 0)
{
	/* If the domain isn't the right one, your script to handle that goes here.

		You could remove the display object containing your game or, if you're
	using the Flash IDE and programming straight into the time line, use gotoAndStop
	to send the player to a frame that loops back onto itself.  Whatever you do,
	you'll want to display some kind of message telling the user where they can
	legitimately play the game or animation. */
}

Here is the whole code built into a function that will return true if the website's domain name matches the one you specify or false if it doesn't match:

private function checkURL(URL:String):Boolean
{
	var siteURL:String	= root.loaderInfo.url;
	var httpBits:Array	= siteURL.split("://");
	var urlBits:Array	= httpBits[1].split("/");
	var domainBits:Array	= urlBits[0].split(".");
	var myDomainBits:Array	= URL.split(".");

	var i:int = domainBits.length;
	var j:int = myDomainBits.length;
	
	if (domainBits[i-2].indexOf(myDomainBits[j-2]) < 0 ||
		domainBits[i-1].indexOf(myDomainBits[j-1]) < 0)
		return false;
	return true;
}

This allows you to check multiple domains and handle them like this:

if (!checkURL(mywebsite.com) && !checkURL(somewhere-else.net))
{
	stop();
}

I hope this helps anyone with questions about site-locking.

Posted by Markham at 9:16pm, 6/21/2010 (CDT)
Flour Sack Pencil TestRun Time: 10 seconds
File Size: 2.3mb

Final project for the Intro. to Animation class I took last semester.

Posted by Markham at 12:58am, 5/25/2010 (CDT)
Pirate, Cowboy, and AstronautFile Size: 234.41kb

Last week's class sketching assignment was to create a pirate, a cowboy, and an astronaut, with one of them being female. So I drew a communist space pirate, a robot cowboy, and an astronaut taking her astrochihuahua for a spacewalk.

Posted by Markham at 2:07am, 4/17/2010 (CDT)

My post for the month. School's almost over, just one final left. I got a quick Flash job that should be done by the end of next week. In an effort to reduce redundancy, the "News" page now redirects to the Blog and the main page will eventually be updated to reflect that. The Portfolio page will be next on the list of site updates. You'll find that some things are already marked with portfolio tags.

Anyone actually reading the RSS feed through Google Reader will probably find that everything is marked new again because I changed how the site treats URLs (people who aren't computers can make sense of them now). It might be better to just unsubscribe and resubscribe off a site RSS link so that everything links up right, since I'll probably be deleting the News page entry altogether.

Posted by Markham at 2:11am, 3/30/2010 (CDT)

Okay, so this hectic month is almost over. The midterms round 2, and the history term paper rough, peer review and final draft three-week combo are over, and my application portfolio is due this Thursday. After that, I can get back to trying to get something finished. Again.

Posted by Markham at 3:00pm, 2/21/2010 (CST)

I'm still working on the games whenever I can. Here's a list of what's left to finish in 60 Seconds to Deliver:

  • Air attacks
  • Ground attacks
  • Enemies
  • Building variety
  • Game background
  • Introduction cutscene animation
  • End sequence and game over screen
  • Difficulty levels
  • Music
Posted by Markham at 1:31pm, 2/4/2010 (CST)
Sketches - Janurary to Feb. 3, 2010File Size: 384.57kb

A selection of gesture drawings from January and the beginning of February. I started with a micro-point Uniball and switched to a Pitt brush pen later on. Drawing time ranges from 30 seconds to 2 minutes.

Posted by Markham at 4:48am, 12/23/2009 (CST)

This is a demonstration of a flicker modification I made to Flixel. The direct link to the mod details and directions to apply the mod can be found here.

Posted by Markham at 6:32pm, 12/5/2009 (CST)
60 Seconds to Deliver

Happy Day of the Ninja! Today's announcement is the revelation of my latest project, "60 Seconds to Deliver!" I started this at the beginning of my Thanksgiving break, and made quite a bit of progress just over the last week-and-a-half!

This time I'm trying out the Flixel engine for Flash, which allows me to quickly get a functioning prototype and put more focus on the visual design earlier on in the development process. At the rate this is going, I actually hope to have this finished in two or three weeks.

Other projects, such as Bridges of the Mertynn, have not been abandoned, and will be returned to after this is finished.

Posted by Markham at 7:27pm, 11/11/2009 (CST)
Edge-Spanning Architecture of the Mertynn

The image of BoogaTech has always been lacking a certain edge, which is why there has been a corporate decision to improve on the edginess of this company and change our name to "EdgeTech." This edgy step in the realm of edginess symbolizes the new path of this company to create edgy titles, provide gamers with the edge they need, and someday become masters of this "edge."

Our second step is to rename the famous hit game that made us so awesome well-known and popular, "Bridges of the Mertynn," to "Edge-Spanning Architecture of the Mertynn."

Other changes will include minor things such as renaming the Sandwich Shop Ninja's workplace, "Monorail Sandwiches," to "Monorail SandwEdges."

That is all.
EdgeTech

Related publications.

Posted by Markham at 6:40pm, 11/5/2009 (CST)
Sketches - Summer and FallFile Size: 167.44kb

It's been a while since my last sketch book post, so here's a few sketches between August and now.

Posted by Markham at 5:11pm, 10/22/2009 (CDT)

So apparantly I had forgotten about the nasty message the last file version of The Sandwich Shop Ninja gives when it detects that it's not on the right server, and it had been giving that message ever since I merged the TSSN website with the main BoogaTech website. It should be playing correctly now.

Bridges of the Mertynn has been coming along gradually in the free time I've had alongside school. The List has been updating as I progress, and I'm getting closer to getting the game engine finished so that I can start getting levels and tile sets done.

I'll probably take a break from working on Bridges in November so that I can get something out for the International Day of the Ninja on December 5th.

Posted by Markham at 7:09pm, 10/21/2009 (CDT)
Character Concept ArtFile Size: 75.39kb

This is some concept art for a voluntary project some people in the BYU Animation Club are working on. We don't have much decided at the moment, but the plan is to make a collaborative comic where we switch off making pages for. The story is about a little girl who finds out she has powers or something, and these shadow monsters are after that power. She is protected by a guardian, a shape-shifting star whose planets' life was destroyed by the shadows.

Posted by Markham at 4:54pm, 9/10/2009 (CDT)
Band SpiritFile Size: 130.35kb

Tee shirt design for the Del Oro High School Marching Band. The theme for this year's field show was "The Congo," and I was shown various elements they wanted to incorporate in the design.

Statue "Freedom Spirit" by Stacey Kitchell (along with various band-related 'props') used as reference.

Posted by Markham at 2:20pm, 8/28/2009 (CDT)

I wanted to show this video a week and a half ago, but a few things came up, such as moving to a new apartment for school, working on other small projects that needed to be done, and dealing with video codec issues.

Posted by Markham at 1:06pm, 8/7/2009 (CDT)
Canyon BridgeFile Size: 332.18kb

Concept art for "Bridges of the Mertynn"

Watercolor on resume paper.

Posted by Markham at 8:54pm, 8/6/2009 (CDT)

I've been quiet since returning from Comic Con late July, but that doesn't mean I haven't been doing anything. The last two weeks were spent working over the database and admin panel for the backend systems of this website. I managed to cut out over 1200 lines of old, redundant code. I also made it so that some pages will display any tags a content item has if I want them to (see bottom right of this post).

Also dependent on the updates to the site is "Bridges of the Mertynn." CMExpress, the system that keeps this site running, will be used to develop the website and database that will store the user-made levels and high scores. There's still a lot of work to be done, but for your benefit and my own, I am working on a list of things to be done and will be posting that shortly.

Posted by Markham at 2:31am, 7/17/2009 (CDT)
Guess which one of these is a real sandwich shop!

So I found out why I get so many people coming here looking for sandwich shops. It turns out that The Sandwich Shop Ninja is currently the second result when you search for "sandwich shop" on Google. I guess Google thinks animated ninjas who happen to own sandwich shops are more relevant to people looking for sandwich shops, maybe to eat at, than Subway and a dozen more actual, real sandwich shops?

So if you came here looking for a place to eat, uh... sorry? I don't even have any ninja sandwich recipes or anything, but I guess I could list a few sandwiches I like at various places:

  • Quiznos - Baja Chicken
  • Togos - Chipotle Roast Beef
  • Subway's a little different. I don't get any particular sandwich. I get a ham and bacon with pepper-jack cheese and cucumber. Lettuce is pointless on any sandwich, as it's basically just a solid green form of water. Unless it's spring mix or Romain lettuce, then it actually tastes like something besides water.

Don't buy those sandwiches on the Amtrak trains. They're way overpriced, and taste disgusting.

Posted by Markham at 2:25am, 7/14/2009 (CDT)
Bridges of the Mertynn

Still making progress on my game project. The graphics are turning out nicely, though what you see is scaled down to about 75% so that it will fit in this little box thing. Drawing all those trees and grass is surprisingly time-consuming, though. It's definitely easier to draw them from a side-on perspective rather than a top-down.

Next week is the San Diego Comic-Con. This will be the second time I've gone. I leave early Thursday morning for an 11-hour drive, check in to the hotel, and hopefully get on the tram going towards the convention center and not the one that's going to the Mexico border.

Last month's search engine queries were unfortunately more of the same, for the most part. Just lost people looking for sandwitches, sandwishes, and a "ninjasandwich" stood out from the countless people on the search for sub shop designs.

Posted by Markham at 1:15pm, 7/1/2009 (CDT)
The Elementary School NinjaFile Size: 164.77kb

Could this be a start of a new spin-off series of the ninja in his younger years?

No.