USawIt

Helping your business one line of code at a time...

Profile

USawIt's Profile

Name Michael Givens
IM AOL: webcfmlGoogle: flexinationMS: owner@u-saw-it.comSkype: usawitenterprisesYahoo!: Other:
Twitter http://twitter.com/Flexination
Website http://www.u-saw-it.com
Blog http://www.flexination.info
Portfolio http://www.flexination.info
About Me I am the CTO of U Saw It Enterprises, a Web-technology consulting firm based in Spring, TX. As a multi-years experienced web-technology specialist, I am willing to shift gears at a moment's notice to the Client's technology of choice. I am both an Adobe Community Professional and an Adobe Corporate Champion known to share my experience and evangelism of all things Adobe. I am certified both in ColdFusion 5 and as an advanced CFMX developer, I have written Adobe Apollo in Flight (Digital Short Cut), co-written Adobe AIR Programming Unleashed, written Sams Teach Yourself AIR Programming in 24 Hours, numerous articles, and blog regularly at www.flexination.info.
Company U Saw It Enterprises
Position CTO
Company Site http://www.u-saw-it.com
Adobe Expertise I know a lot
Interests I simply enjoy working with web technologies and AIR. To me it's not just a job, it's a hobby that I get tons of satisfaction from.
Recent Work  
Recent Code Main Code:<?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" title="AIR - Encrypted SQL Local Database" layout="absolute" width="353" height="334" backgroundColor="#3E058B" viewSourceURL="srcview/index.html"> <mx:Script> <![CDATA[ import flash.net.Responder; import mx.collections.ICollectionView; import flash.data.* import flash.filesystem.File; import flash.net.Responder; import mx.managers.PopUpManager; private var dbConn:SQLConnection = new SQLConnection(); private var dbStatement:SQLStatement = new SQLStatement(); private var employeeResponder:Responder = new Responder(employeeResult); private var aryLOTRData:Array = [{name:"Frodo Baggins", description:"Lord of the Ring", imgurl:"assets/images/Frodo.jpg"}, {name:"Bilbo Baggins", description:"Uncle of Frodo", imgurl:"assets/images/Bilbo.jpg"}, {name:"Gandolf the Grey", description:"Wizard", imgurl:"assets/images/Gandalf.jpg"}, {name:"Meriadoc Brandybuck", description:"Friend of Frodo", imgurl:"assets/images/Meriadoc.jpg"}, {name:"Peregrin Took", description:"Friend of Frodo", imgurl:"assets/images/Pippin.jpg"}, {name:"Aragorn", description:"The King", imgurl:"assets/images/Aragorn.jpg"}, {name:"Arwen", description:"Wife of Aragorn", imgurl:"assets/images/Arwen.jpg"}, {name:"Samwise Gamgee", description:"Friend of Frodo", imgurl:"assets/images/Sam.jpg"}, {name:"Boromir", description:"Steward of Gondor", imgurl:"assets/images/Boromir.jpg"}, {name:"Legolas", description:"Elf of Sindar", imgurl:"assets/images/Legolas.jpg"}, {name:"Gimli", description:"Dwarf friend of Legolas", imgurl:"assets/images/Gimli.jpg"}]; private var counter:int; [Bindable] private var employeeCollection:Array; private function init(): void { //Alert.show(ObjectUtil.toString(aryLOTRData)); // prepare a bytearray for encryption key var mySeed:String = "AIR15IsAGreatProduct"; var myKey:ByteArray = new ByteArray(); var i:int = 0; for (var j:int=0; j<16; j++) { i = (hexToInt(mySeed.charCodeAt(j))*15) + hexToInt(mySeed.charCodeAt(j+1)); myKey.writeByte(i&0x00FF); } var dbFile:File = File.desktopDirectory.resolvePath("Encryptedemployees.db"); dbConn.addEventListener(SQLEvent.OPEN, connOpenHandler); dbConn.addEventListener(SQLErrorEvent.ERROR, errorHandler); dbStatement.sqlConnection = dbConn; dbConn.open(dbFile, SQLMode.CREATE, false, 2048, myKey); } private function hexToInt(hex:Number):int { return parseInt("0x" + hex); } private function connOpenHandler(event:SQLEvent): void { getEmployees(); if (employeeCollection==null) { initTable(); } } private function initTable(): void { dbStatement.text = "CREATE TABLE IF NOT EXISTS employees ( id INTEGER PRIMARY KEY, name TEXT, description TEXT, imgurl TEXT ); "; dbStatement.execute(); for (counter=0; counter<aryLOTRData.length; counter++) { insertEmployees(); } getEmployees(); } private function insertEmployees(): void { dbStatement.text = "INSERT INTO employees (name, description, imgurl) VALUES ('" + aryLOTRData[counter].name + "', '" + aryLOTRData[counter].description + "', '" + aryLOTRData[counter].imgurl + "');"; dbStatement.execute(); } private function getEmployees(): void { dbStatement.text = "SELECT * FROM employees;" dbStatement.execute(-1, employeeResponder); } private function employeeResult(result:SQLResult): void { employeeCollection = result.data; } private function errorHandler(error:SQLError): void { trace("Failure."); trace("code: " + error.errorID); trace("operation:" + error.operation); trace("details:" + error.message); } private function clickHandler(): void { this.status = dgLOTR.selectedItem.name + ': ' + dgLOTR.selectedItem.description; } private function getImage(): void { if (dgLOTR.selectedItem.name!="") { var tw:CharacterImage=CharacterImage(PopUpManager.createPopUp(this, CharacterImage , false)); tw.charactername = dgLOTR.selectedItem.name; tw.description = dgLOTR.selectedItem.description; tw.imgurl = dgLOTR.selectedItem.imgurl; tw.x = 100; tw.y = 47; dgLOTR.visible = false; } else { this.status = "Character image unavailable..."; } } ]]> </mx:Script> <mx:DataGrid id="dgLOTR" dataProvider="{employeeCollection}" creationComplete="init()" itemClick="clickHandler()" itemDoubleClick="getImage()" doubleClickEnabled="true" toolTip="Double-click an employee to see their photo..." verticalCenter="1" horizontalCenter="0" width="298" height="282"> <mx:columns> <mx:DataGridColumn dataField="name" headerText="Name"/> <mx:DataGridColumn dataField="description" headerText="Descriptiom"/> <mx:DataGridColumn dataField="imgurl" headerText="Photo" width="0"/> </mx:columns> </mx:DataGrid></mx:WindowedApplication>TitleWindow:<?xml version="1.0" encoding="utf-8"?><mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" title="{charactername}" showCloseButton="true" close="closeDialog()" layout="vertical" width="100%" height="100%"> <mx:Script> <![CDATA[ import mx.events.FlexEvent; import mx.managers.PopUpManager; import mx.core.Application; [Bindable] public var imgurl:String; [Bindable] public var charactername:String; [Bindable] public var description:String; // The event handler for the TitleWindow close button. public function closeDialog(): void { PopUpManager.removePopUp(this); Application.application.dgLOTR.visible = true; } ]]> </mx:Script> <mx:Image id="imgViewer" source="{imgurl}" toolTip="{charactername + ': ' + description}" horizontalAlign="center" verticalAlign="middle" width="100%" height="100%"/></mx:TitleWindow>

Stats

Last online 03/24/13

Groups

USawIt is a member of the following Groups:

Adobe Community Professionals


Private Group 434 Members
 

Austin Flex User Group


Group - North America 29 Members
 

Community Managers


Private Group 1146 Members
 

Houston Adobe Users Group


Group - North America 116 Members
 

Houston ColdFusion Users Group


Group - North America 25 Members
 

Las Vegas Adobe Web & Mobile User Group


Group - North America 80 Members
 

Online ColdFusion Meetup


Group - Virtual 294 Members
 

SilvaFUG


Group - North America 74 Members