Been a while since i posted anything about flash ( lazy cow moo) heh !
Ever wanted to keep/save information about your site visitors ? I think its important to keep an eye on visitors resolutions , so when you get to design a website , you’ll know what dimensions you’re going to use . ( including Operating system and IP ).
now lets start with MySQL DataBase , We’ve got several ways to operate & manipulate Mysql DB , either using shell/Command line or simply use PhpMyAdmin …
Lets start with creating a database :
CREATE DATABASE `information` ;
Now lets build the table & fields :
CREATE TABLE `resolution` ( `ID` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `X` INT(10) NOT NULL , `Y` INT( 10 ) NOT NULL , `OS` VARCHAR( 40 ) NOT NULL ) ENGINE = innodb;
Okay enough with mysql , now lets jump to flash & create 2 loadvars() , one to send and one to recieve , then we’ll use System.capabilities object to get the X & Y Resolution and the Operating system running on the visitor machine. After collecting the information we’ll need to send it to the database using PHP , i’ll show you how ,later in this tutorial .
loadObject = new LoadVars(); rcvObject = new LoadVars(); loadObject.Width = System.capabilities.screenResolutionX;; loadObject.Height = System.capabilities.screenResolutionY; loadObject.OS = System.capabilities.os; trace(System.capabilities.os); //send it loadObject.sendAndLoad(‘http://www.YourWebSite.com/send.php’,rcvObject);