Archive for the ‘php’ Category

Google map flash api guestbook

Thursday, March 18th, 2010

A few months back I had a play around with the Google map flash api and built this guestbook, another example of it can been seen here.
Well I’ve not had a chance to go back and tie of some loss ends on the guestbook map though it works perfectly well.
There is 3 things that would make this complete
1. Marker clustering
2. Geocoder, some kind of quick find me button
3. Update marker position with the edit feature.

I think if you are proficient in flash AS3 you should be able to get these done in no time.
With so many other things to get on with I’ve decided to make the source available for download :) .

Included are:

  • Flash 9 Flash File
  • Caurina tweener classes
  • kharon4a_mini font
  • index.html
  • guestbook.swf
  • AC_RunActiveContent.js
  • map.php
  • common.php
  • but.as
  • gMapEntry.as
  • gMapForm.as
  • guestbook.sql
  • help.html

Font(s) used:

  • kharon4a_mini

http://www.orgdot.com/aliasfonts/

Features include:

  1. Email notification upon someone signing the guestbook
  2. http check for urls in comments and web address fields
  3. badword filter check. Replaces bad word if found in an array of word to filter to ****
    $changeto = ‘****’;
    $message = str_replace ($badwords, $changeto, $message);
    return $message;
  4. CMS Feature that allows you to edit/delete any of the submissions
  5. Map will stretch to fit available screen size

All the information to get you setup and running can be found in the help file included.
The guestbook requires a server running php+mysql

DOPE Awards html site goes live

Friday, November 20th, 2009

logoFor the past couple of months I’ve been working very hard converting the current DOPE Awards.com flash site over to HTML. That’s not to say the Flash site is going to disappear this is more to improve SEO with the site. The main aspect of this project was to have the html version of the site as near identical of the flash site.  Looking at the DOPE Awards html version of the site i think it’s pretty close and I hope you think so to.

Coming from a flash background of 8+ years this certainly was going to be a challenge. Well a few months later and it is finished. The site fully conforms to W3C and is also cross browser compatible on most popular browsers and even IE8.

Dope Flash website awards

Dope Flash website awards

Be sure to check out DOPE Awards.com as there is some great new features coming it’s way soon.  Also if you think you have a site Dope Awards worthy then why not get it posted.

3 Contact forms, 3 Sizes AS2/AS3

Wednesday, July 8th, 2009

With the Simple flash AS3 contact form recently seeing over 5000 downloads I’ve decided to add a new one.

Bit better looking than the last with help file and all code commented :)

Get Adobe Flash player

Included are:

  • contactForm.fla (Flash 8 )/contactForm.fla (Flash 9 )
  • caurina tweener classes AS2/caurina tweener classes AS3
  • contact.php
  • kharon4a_mini font
  • index.html
  • contactForm.swf
  • AC_RunActiveContent.js

Features:

  • Three different sized forms
  • All fields validation
  • Email validation
  • No reference to root. Simply drag the required form on to your project from the library
  • Courtesy thank you email sent to the form submitter, can be turned off
  • IP address capture and display link to ip look up tools in sent email
  • Nicely formatted html email. Can be set to send html or none html formatted email
  • Only 3 variables to be set in the php script and your good to go

Font(s) used:

  • kharon4a_mini

http://www.orgdot.com/aliasfonts/

How to modify the file:

Instruction 1: Open the contact.php script and go to line 11 and add your email, sitename and your name
php vars to change in php script

Once that is done you can upload the script to your server

Instruction 2: There are 3 other options found between line 16-21. $sendHtml, $sendCourtesy and $fColour

Additional php vars option that can be changed

These option can be left as they are.

Instruction 3: Simply drag ‘n’ drop the required form mc from the library onto your project. Also make sure to copy over the caurina tweener classes to your project folder and the contact.php script.

Movieclips that should be dragged onto your projects

The php script has been tested on a linux based server and windows dedicated server with php support.

Good practices for server folder structure

Tuesday, April 21st, 2009

So your pulling your swf from a sub-directory and displaying it in a page on your main directory. Flash will still see as being in the sub-directory even though it’s being viewed in a page on your main directory(root).
This has had many people wondering why there scripts don’t work.
Usually what i do with my swf’s is to have them all in my root directory and then there assets in sub directories of the main.
Example:

httdocs/root/
-index.html
-someswf1.swf
-someswf2.swf
-images/
-images/image1.jpg
-images/image2.jpg
-xml/
-xml/somexml.xml
-php/
-php/some.php

As you can see i store my swf assets and site assets in sub-directories of the root folder.

if you don’t want to go that route then you can just direct link to the php/xml/image in the swf.
Example:
URLRequest(“http://www.somedomain.com/php/contact.php”);

Though with some servers this can also throw up issues.
With some server set-ups if your domain is accessible via http://www.somedomain.com/ and http://somedomain.com/
This can throw a crossdomain issue with your flash app so it is best to lin to the local file
Example:
var req:URLRequest = new URLRequest(”php/contact.php”);

Flash random()

Wednesday, March 4th, 2009

From time to time i come across post’s on the Flash Developer forums asking about how to attach or load a random image/object on to the flash stage. If you check the flash doc’s you will see that there is already a neat little function there already for use.  For those that have no idea what a flash manual is or how to find the flash doc’s(F1) here are a couple of examples.

This example loads a random image into flash:

  1. function randRange(min:Number, max:Number):Number {
  2.     // Generate a number between and including 1 – 5
  3.     var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
  4.     return randomNum;
  5. }
  6. // Get random number created
  7. var n:Number = randRange(1, 5);
  8. // Load image into holder on the stage. images should be numbered sequentially
  9. holder.loadMovie("image"+n+".jpg");
Download random load image flash Version 0.1

This example go’s to a random frame on the timeline

  1. function randRange(min:Number, max:Number):Number {
  2.  // Generate a number between and including min – max
  3.  var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
  4.  return randomNum;
  5. }
  6. //build array to hold frame lable names
  7. var frameArray:Array = new Array();
  8. frameArray[0] = "animate1";
  9. frameArray[1] = "animate2";
  10. frameArray[2] = "animate3";
  11. frameArray[3] = "animate4";
  12. frameArray[4] = "animate5";
  13. // Get random number created
  14. var n:Number = randRange(0, frameArray.length);
  15. // gotoAndStop Frame lable name
  16. gotoAndStop(frameArray[n]);
Download Goto random frame Version 0.1

This example will attach a random link movieClip from the library onto the stage.

  1. function randRange(min:Number, max:Number):Number {
  2.  // Generate a number between and including 1 – 5
  3.  var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
  4.  return randomNum;
  5. }
  6. // Get random number created
  7. var n:Number = randRange(1, 5);
  8. // Load movieClip into holder on the stage
  9. holder.attachMovie("img"+n,"img"+n,holder.getNextHighestDepth());