AS3 API Diagram

Flash Development, Web Development 1 Comment »

I came accross this API diagramĀ  showing all the intrinsic classes, methods and properties available in AS3. It could be of some use to some of us flash dev’s. Enjoy.

AS3 API Diagram

Also some others I found…

PHP Cheetsheet

mySQL Cheetsheet

CSS Cheetsheet

1 Million All-Time Visitors to Coupon Sherpa

Web Development No Comments »

Today was a milestone for Coupon Sherpa. We hit over 1 million visitors to the website. That is quite significant for us considering the website was launched in August of last year. So after about 7 months we finally reached the 1 million visitor mark. We are looking forward to what the future holds for couponsherpa.com and have some big plans for making it more useful for our visitors.

coupon sherpa all time visitors

PHP Nested Functions using global variables

Web Development 4 Comments »

Today I figured out the hard way some intricacies of using the global setting within nested functions. In PHP, if you want to load a variable from outside of your function, you first have to declare it as global before you use it inside your function. So Something like this.

$a = 1;
function test() {
    global $a;
    echo $a; // will output '1'
}

I assumed it worked similar to actionscript where anywhere you use a global variable it can find it. That isn’t always the case in PHP as I just found out. The global setting is merely a reference to the top level code, so issues can come up when you are using nested functions. So I had a function that did an include or two and had a function within that at some point and realized any variable that was within that first function was not accessible even if I globalized the variable. So here is what I was trying.

function simpleFunction() {
    $a = 1;
 
    function test() {
        global $a;
        echo $a; // will output nothing
    }
 
}

Nothing would output in this senario because my test function is looking on the top level code for that variable. Since my variable isn’t in the top level, there is an issue. So my solution was simple. Just declare the variable global in the top level and then use it wherever I want. Something like this.

global $a
 
function simpleFunction() {
    global $a;
    $a = 1;
 
    function test() {
        global $a;
        echo $a; // will output '1'
    }
 
}

So now the variable is declared in the top level even though I’m using it within a function and a nested function. It took me a bit of time to figure this out so hopefully someone else can learn from it. Enjoy!

My new mac-mini server

Misc, Web Development 1 Comment »

Recently I had been toying with the idea of getting my own server because I hate being limited to whatever my shared host allows. I wanted to be able to load whatever software I wanted on it, load up as many websites/domains as I wanted, handle as many ftp accounts as I wanted and install any media streaming software I wanted. Email wasn’t really an issue since I think it makes more sense to route it all through a google apps account. I had a bit of experience (just a bit) working with servers since I have a mac-mini setup in my living room running MAMP that has all my movies on it and actually has a domain pointed to it (via zoneedit.com) to present client work.

After a bit of research I came accross macminicolo.net. They simply allow you to send them your mini, or you can buy one off them, and they hook it up to their network allowing you to access it through vpn, vnc, ssh or however else you choose. One might question its speed but I have already put a couple database heavy sites on it, including this website, and they load immediately.

I ended up buying a mini locally here and installing a faster, larger hard drive and loaded up the ram in it, installed all the necessary software and sent it off to them. They are in Las Vegas and there seems to be a fairly good pipeline to the internet down there. I’m very pleased with the server and the speed of my sites, I feel sort of free now because I am not under the yoke of being on the same server as a dozen or so other people; *barf*. So I can do whatever I want with it without having to ask if a specific port is open, or if php has a specific setting activated. I even ended up buying OSX Server. It has a bit of a learning curve for a server newbie like me but I feel pretty comfortable using it now. I didn’t have to worry about setting up a mail server or dns info which kept things simple. Setting up an ftp server on it was a bit tricky but I managed to get that working with pureFTPD and I even managed to get a few cron-jobs running on one of my sites.

Anyways, my hat is off to the fella’s at macminicolo.net for making my life a bit more easy.

Online Coupon Codes – My latest creation

Web Development No Comments »

Coupon Sherpa - Online Coupon Codes

I am now officially in the affiliate marketing world. After developing the Coupon Sherpa iPhone application with my brother Luke we decided we would also build a full fledged website offering every kind of coupon imaginable. So now our iPhone application is one aspect of what Coupon Sherpa is, with its most important being the website where you can find online coupons, printable coupons, grocery coupons and even coupon friendly blog postings. We just recently finished it and I would say it is some of the best PHP mySQL work that I’ve done. I built a brand new content management system (CMS) for it that allows for multiple users with different types of user accounts with the ability for them to manage all our stores, coupons, categories, banners, links, comments, etc. Both the back-end and front-end of the website utilize a large amount of the latest ajax technology to help keep the user experience seamless for doing such things as submitting contact forms, adding coupon or blog posting comments, or even suggestion hints when a person is using the search tool. PHP and mySQL were used for the framework and I also implored some new techniques I’ve learned recenbtly with CSS to display the content.

Something kind of exciting about the site is that I was actually able to get all our coupons to load dynamically from affiliate networks. Each network that we work with has a different type of api that we use to grab the latest coupons. This forced me to have to create a parser file for each network to work with their xml,csv, or even rest data. We then load any coupons we haven’t seen into our database using a cron job and then either remove the ones we don’t want or enable the ones we want to show up on the website. Seems straight forward enough but it actually took a fair bit of thought to make it all work. We also decided to ask for people’s twitter info on comments in the blog and I was able to access Twitter’s api and load in the person’s twitter image and user account info to display for each comment.

Anyways, a lot of work went into making it happen but it’s finally up and running and we’re excited to see how it works. We’re hopeful that a lot of people can save some money using it.

Some links…
American Eagle Coupon Codes
Kohl’s Coupons
Gap Coupon Codes
Target Coupons

Visit CouponSherpa.com

New Site Launch – Ray Caesar Portfolio

Web Development 1 Comment »

So, over the winter I had been working on a portfolio website redesign for a 3D artist in Toronto. The project was mostly php/mysql based which was a welcome change from all the flash work I had been doing earlier that year. The website includes an inline CMS (meaning that after you login, you just navigate around and edit whatever items you want to). It turned out a lot better than I thought it would and uses a lot of ajax for a lot of the cms updates. My buddy Ian McFadyen did all the design work and did an amazing job to boot. I handled all of the development work.

View Ray Caesar’s website.

After learning about the project I realized I should probably get my hands on a PHP based framework to base everything off of. I found out that so many frameworks are way too convoluted with things I would never use. Along my google journey I ran accross something called Simple PHP Framework. I downloaded it and ran some tests with it. It comes with some very nice utility functions and classes including user authorization classes and database access classes. It had pretty much everything I was looking for.

Anyways, I’m just sending out much love to the guys involved with the framework for saving me many hours of tearing my hair out figuring a lot of this stuff out myself. I’ve also since implemented it on http://www.freeshipping.org and the admin for my first iPhone app’s webservice at http://www.couponsherpa.com.

Autoblur Javascript Object

Web Development 1 Comment »

I hate coding things twice and every once in a while I seem to need something that automatically clears the default value in an input text field for a form. So I decided to write a javascript object that would make life incredibly easy for me. And now its all yours if you have a need for something like this. Here is an example of what I’m talking about. You will notice that when you click in the text field it clears the default text, and if you click away from the text field it will return the default text only if you haven’t entered anything. it’s pretty basic but annoying to always have to code again and again so I have added it to my utils.js file that I use throughout my projects. Here’s the code…
Read the rest of this entry »

Tiling Movieclips with Modulo

Flash Development, Web Development 2 Comments »

I’ve always had to come up with hacked math using additional variables in order to tile movieclips properly. By tiling I mean, positioning movieclips so their are a certain number in each line with each additional line being placed below the previous one, etc. So I finally decided to spend the time to figure out how to do it properly. Read the rest of this entry »

Is Sepy the Best Actionscript Editor?

Flash Development, Web Development 15 Comments »

I don’t know if I even need to explain why I don’t use the Flash IDE but I will for reasons I don’t know. I think Macromedia/Adobe had just given up on improving the Flash Actionscript Panel because there were so many AS editors out there that most people were using that they just figured people would use them instead. These AS editors that are out their are basically their to just make our lives a little easier. And they do it well. I’m sure when Flash CS3 comes out they will likely combine some of the new dreamweaver coding stuff but thats about it. Not enough to lure back most of us F9 haters.

What's your favorite editor?
  • Add an Answer
View Results

Read the rest of this entry »

Design is Important Too

Flash Development, Web Development 1 Comment »

What? Is he crazy, you ask. How can a developer say such a thing. Their are umpteen reasons why I think design is important. Here are a few… Do you know any top agencies that have bad design? Do you want ugly work in your portfolio? Would apple be as successful as it is if it weren’t for those crafty designers they hire? Am I getting my point accross yet? Read the rest of this entry »

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in