Add a date to a date in Actionscript 2

I needed to work out a date range according to the date 3weeks away from the current date. After a bit of thinking, I found that it’s actually quite easy to achieve. 1 2 3 4 5 6 7 8 9 10 var theDate:Date = new Date(); dateDay = theDate.getDate(); dateMonth = theDate.getMonth(); dateYear = theDate.getFullYear(); var theDate2:Date = new Date(dateYear,dateMonth,dateDay); theDate2.setDate(theDate2.getDate() + 21); dateDay2 = theDate2.getDate(); dateMonth2 = theDate2.getMonth(); dateYear2 = theDate2.

Add a month to selectable date range – Date Chooser – Actionscript 2

I have been working on a project where I need to select a date range starting today and ending a month from now, so the user cannot select anything in the past or over a month from now. This is how I did it: There is an instance of DateChooser on the stage with Instance Name “calDate”. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 var todayDate:Date = new Date(); dateBeginDay = todayDate. and Google Desktop Search

Recently I checked my website stats and saw I had a few hits from “” and wondered to myself, what the heck is that? Am I looking at my own site from a localhost? Why am I getting backlinks from my local computer to my site. After searching around a bit I found out that port 4664 is used by Google Desktop Search and when I typed in certain queries into Google it also returned items from my desktop search.

Embed pound symbol (£) in flash textfield

If you use a dynamic textbox in Flash and you want to embed the British Pound symbol (£) then you will want to also embed the “Latin I” glyphs with your textfield.

Enable / Disable Cursor Hand in Actionscript 2

If you have a movieclip that by default has the hand cursor showing on RollOver and you don’t really want this, you can disable it by doing the following: 1 2 3 myMC.onRollOver = function() { this.useHandCursor=false; } So the main code here is: this.useHandCursor=false; False disables it and true shows it.

USB Device Not Recognized! in Windows

Believe it or not, this one is super easy to fix! It’s actually a temporary problem with your motherboard, all you need to do is: turn off your computer if it’s a desktop then unplug it from the wall/powersupply if it’s a laptop then remove the battery let it sit for a minute plug it all in again reboot VOILA! No need to uninstall/reinstall drivers or anything!

Calling event functions from movieclips in actionscript 2

In a flash movie I usually have a frame of actionscript that controls all elements in the file to keep everything in one place. Sometimes I have an onPress(etc) function that refers to something happening in the scene when something is pressed, but what happens if we want another element to refer to that event for some reason? Here’s an example of that code without anything “flashy”: 1 2 3 _root.

Sudo install OpenGL & SDL on Ubuntu

A quick and easy way would be to type the following in one line with single spaces in the Terminal. This way of installing OpenGL and SDL libraries only applies to Ubuntu. 1 2 3 4 5 6 7 sudo apt-get install nvidia-glx-new-dev libglew1.4-dev libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev

How To Modify Hosts File On Windows

The hosts file is located at the following address: C:\windows\system32\drivers\etc</span> or %systemroot%\system32\drivers\etc</span> But you will need to open Notepad with “Run as Administrator” first and then open it through there otherwise it will give a permissions problem

Get all directories in PHP

I think this may be the fastest way to get a list of all the directories in a given folder/directory using PHP. 1 $directories = array_filter(glob('*'), 'is_dir'); ..and of course, you can also add a path to it if you need to: 1 $directories = array_filter(glob($myPath.'*'), 'is_dir');

Security error: securitySandboxError with Flash

You have a flash uploader and you get this error: security error: securitySandboxError This means that the flash is not trusted by the domain and you have to place an xml file in the root of the domain. The file is called “crossdomain.xml” and this is what should be inside it: Solved! 😉

Component Inspector in Flash has ISSUES!

I discovered a very annoying bug in the Flash IDE a little while ago, and it has happened to me quite a few times. Today it happened again and so I write this post.. While in the Flash IDE you select a component on the stage, then you click “Component Inspector”. This opens up into a modal window which is nice and everything BUT…. …..if you then give focus to another program and then try click back into flash, it hides the “Component Inspector” modal window but still keeps focus on it, so basically, you can’t use the program(Flash IDE) / save your file / or even close the program!

Close/Delete Google Checkout Account

I have used Google Checkout to receive payments in the past and have had problems with some clients not paying and blaming it on Google Checkout that the money did not go through (like the guys over at Peartree DMS). I decided that this account was not worth the trouble anymore and wanted to close my account. I looked online everywhere and couldn’t find where to close the account – after quite a while I found how to do it, so here is how to close/delete/remove your Google Checkout account:

Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource

Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource You have just gotten a warning when trying to check if an inserted row was successful but when calling mysql_affected_rows(mysql_query(“INSERT INTO……”)) you get a warning telling you that the supplied argument is not a valid MySQL-Link resource. This is because mysql_query INSERT actually returns true or false and not a resource id. So rather do this: if (mysql_query(“INSERT INTO…”))

Capitalize First Letter in Word – Actionscript 2

You have a string and you want to capitalize the first character but have the rest of the word in lowercase. DO THIS! 1 myStringVar = myStringVar.substring(0, 1).toUpperCase()+myStringVar.substring(1);

HP Pavilion Laptop Madness

I have got an HP laptop and have started experiencing problems with it starting up for the past few months, it is only about 1.5years old and is supposed to be a decent one. It is an HP Pavilion dv9700 by the way.. Today the damn thing just didnt want to startup and eventually after trying every trick in the book I got it to boot into Degugging Mode in Windows Vista.

Why you should use OpenGL and not DirectX

Below is a very interesting article I found that proves all the myths about DirectX being better than OpenGL, a very well written paper describing it best. Thanks for that guys at!