AdenForshaw.com Behind the curtain of Affiliate Marketing

7Jul/091

BristolFUG Talk

Been a while since i've had a chance to post i know, now i'm back fulltime freelance i can add some more tutorials, free code and tips and tricks and reply to comments a little bit more often.

Tomorrow i'm giving a talk to the Bristol Flash user group on 3d in flash. We'll be going through the whole process, from building and texturing a model in blender, exporting it into flash, and then using Away3d engine to load in the model and manipulate it with code. The aim is to give a medium level overview of the process, and provide the source code to work from.

If we get time or in future talks, we'll look at integrating open source physics engines into a 3d application.

Filed under: Actionscript 3 1 Comment
5May/094

Problem with Flash Player 9.0.28 or below?

Try adding this little line in your document class constructor to create the ADDED_TO_STAGE constant as this was not present in players 9.0.28 or below.

Bit of a hair puller this one.

if (Event.ADDED_TO_STAGE == null)
{
Event["ADDED_TO_STAGE"] = "addedToStage";
}

Tagged as: 4 Comments
8Feb/098

Google spreadsheet and flash part 2 – A Read/Write example

I've iterated up the previous example showing how to save data from a Google Spreadsheet, to add in the ability to load the data from the spreadsheet as well. Googles service in impressively fast, and works well with concurrent users. This is however no substitute for a proper database, and shouldn't be used as such.

Personally i've got loads of great ideas on how to use this, things like adding feedback/bug reporting functionality into projects. Clients love the transparency and easy of use of the Google Spreadsheets.

Get Adobe Flash player

All you need to do is have a php server, download the source code, create a google spreadsheet with form functionality, be sure to publish it as well with the auto republish flag set as well, change to source code with the key from your spreadsheet and do a simple request to find the id of the worksheet.

Here's the spreadsheet being edited. - http://spreadsheets.google.com/ccc?key=pyxyLmVwUP3OtKbRWR-x3LA&hl=en

2Feb/099

AS3 Youtube player 0.2

Get Adobe Flash player

I've had a little time to iterate upon my previous demo using Youtube player in AS3.  It's still not as clean as i'd like, and i haven't done the Documentation yet, but it's pretty solid and provides a good example of the methodology invloved.

I've only added Play/Pause btn, a clickable Progress bar, and mute button. The AS3 player loads in a AS2 flash movie which wraps the Youtube player and provides an actionable API. The AS@ communicates back to the AS3 player via a call to a pre named function passing all the current properties of the Youtube Player, currentTime, duration, state etc.

Once i get some more time, and i've tested it in a couple of applications i'll finish it off and provide Documentation.

Click to download free source code
28Jan/0944

AS3 TextField buttonMode or useHandCursor?

Unfortunatly, no method exits on the TextField class in AS3 as it does not extend the Sprite class, which contains the buttonMode property.

This is most apparent with the annoying problem of having a TextField inside your Sprite/MovieClip you;re trying to use as a button, where even after setting buttonMode = true on the button, rolling over the textfield inside the button will revert the Cursor back to default.

To get round this simply use the mouseChildren = false property on your Sprite/Movieclip button.

i.e.

myTextFieldContainingSprite.buttonMode = true;

myTextFieldContainingSprite.mouseChildren = false;

myTextFieldContainingSprite.addEventListener(MouseEvent.MOUSE_DOWN ...... etc

12Jan/094

Using Amazon Products API and Flash

Update: - Due to the Amazon API changes requiring Signature and Timestamps which breaks this post, i have created a new post which updates this process here....

EDIT:There was a bug with the demo when showing a product with no customer review as i'm using that as the flavour text in this demo. Fixed in demo and source code.

Continuing the theme of Affiliate marketing, here's a free source code demo of how to use Amazon products in flash. It uses similar process's I've demoed before, signing up for the API, creating a php page to receive the keywords then search the Amazon API, and then return the data in XML format to the Flash front end.

To get started yourself, register for Amazon associates account - http://aws.amazon.com/associates/, then download the example code, change my code for yours so you receive the percentage, and play away.


Here I've just parsed the response xml for the products into instances of my AmazonProductData.as Class. This makes it easy to code against, and be confident in the ability to retrieve basic data about each product without spelling or case mistakes. As long as you're using FlashDevelop, FDT or FlexBuilder that is.

I will make a full scale tutorial on how to use the API, parse the data and create a simple front end like this when i get a chance and finish creating LearnToFlash.com .

Tagged as: , 4 Comments