Interactive Image Viewer v1 @ FlashDen

I’ve re-purposed an old project of mine, the interactive pog portfolio viewer, to activeden. I call it the pog portfolio because each work is represented by a circle, or pog, and you play ith it in the “bay” with different interactive physics configurations. When you click a pog you can view a close up image of that item and more details. The whole file has been cleaned up (code and graphics) and documented for easy customizations.It is a small file size as well, under 36kb swf!

This is mainly an image viewer, stay tuned for any updates, like video support etc.

INTERACTIVE IMAGE VIEWER WITH PHYSICS AND ANIMATION EXAMPLE!

pog portfolio image

View Details here at activeden

Works and configuration loaded in through a single xml file. Select works from the bay to view title, description image and a link (if applicable). Organize works with the tags or select all and choose the physics of the bay for interactivity control (gravity, spring, grid and friction).

It is fully customizable and fully driven by xml. The xml file contains values for configuring the swf, and also all the information about each work to be included in the portfolio.

Each work is loaded into the ‘bay’ as a round thumbnail or ‘pog’. These pogs are animated with the interaction options (gravity, friction, spring and grid). The pogs are sortable by tags (parsed in from the xml).

The whole color scheme of the image viewer is configurable, or can even be set to random! Have a different color scheme every time your image viewer loads!

Clicking a pog in the interactive bay sends that thumb to the holding area and loads the close up into the focus window for that work. It also loads the details about that work into the detail box (to the right of the focus box). Each works needs a 50×50 thumbnail and a close up (max 375px x 270px) image. Focus images are all loaded in with an informative preloader and fade is once loaded.

Site easily integrates with Google Analytics to track user interactions within this flash portfolio!

All works in the portfolio are passed in through an external xml file, here is a sample work node from xml:
[cc lang=”xml” tab_size=”2″ lines=”40″]


Random Gear

Random gear photograph from activeden assets.

random_gear.jpg


random_gear.jpg

http://activeden.net


Photo|Industrial

[/cc]

Download source at activeden

Enjoy, and let me know what you think!

Circlecube Flash Items on activeden

21075 24687 45713 45893 22018

APB Website | Before and After

APB are the guys who organize public speakers, whoever you saw speaking at the last graduation or other ceremony was probably done through the American Program Bureau. They have connections! Many many people, from movie stars, to famous writers, to nobel peace prize winers! So for your next party, give them a try. They had a really old website from about 1999 or so. I was involved with rebuilding it! I did most of the html/css design and flash/actionscript. They just launched the site this week, so I’m just celebrating with this post!

See before and after images below:

Old:

old apb thumb
The original site was hard to navigate and horrible to look at…

Vs

New:

speaker_pages_w_player1
These are the mock ups, all html/css and the we pushed it into drupal for content management.
apb-relaunchAPB had the final say on the finishing touches. It came together, although I was suprised that they opted to put so much movement on the page. We set it all up so all speakers have images and videos on their page all in the custom player we built for them… but then they go and embed a youtube video on their homepage… go figure. It came a long way though. Go Web 2.0! Visit American Program Bureau.

Actionscript Key Listener Tutorial AS3

Overview

Allowing users to use the keyboard as well as the mouse is a great way to incite interaction with your flash. This tutorial will show how to code it and what you can do with some keyboard events. This changed with actionscript 3, note this tutorial is AS3.
altKeY (Boolean) Indicates whether the Alt key is active (true) or inactive (false).
charCode (uint) Contains the character code value of the key pressed or released.
ctrlKey (Boolean) Indicates whether the Control key is active (true) or inactive (false).
keyCode (uint) The key code value of the key pressed or released. KeyboardEvent
keyLocation (uint) Indicates the location of the key on the keyboard. KeyboardEvent
shiftKey (Boolean) Indicates whether the Shift key modifier is active (true) or inactive (false).

Steps

  1. import KeyboardEvent,
    import flash.events.KeyboardEvent;
  2. assign any keycodes
    //keycodes
    var left:uint = 37;
    var up:uint = 38;
    var right:uint = 39;
    var down:uint = 40;
  3. add event listener KeyboardEvent.KEY_DOWN
    stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownListener);
  4. respond to keys
    function keyDownListener(e:KeyboardEvent) {
            trace(e.keyCode.toString());
    }

    or

    function keyDownListener(e:KeyboardEvent) {
            if (e.keyCode==left){
    		ship.x-=10;
    		ship.rotation = 90;
    	}
    	if (e.keyCode==up){
    		ship.y-=10;
    		ship.rotation = 180;
    	}
    	if (e.keyCode==right){
    		ship.x+=10;
    		ship.rotation = 270;
    	}
    	if (e.keyCode==down){
    		ship.y+=10;
    		ship.rotation = 0;
    	}
    }

Example

Here we have a swf with the keyboard event listener on the stage, and feedback boxes to give us all we can know about the event. It will tell us about certain keys (alt, ctrl (cmd), and shift) with a Boolean, it will tell us the keyCode and the charCode. The keyCode is the number that is tied to the actual button pressed or key, and the charCode relates to the character represented by the button(s) pressed. So hitting ‘s’ and then hitting ‘shift + s’ will tell you different charCodes, ‘s’ and ‘S’. but you’ll see that the s key has the same keyCode (you’ll also see the ‘shift’ keyCode as well). If needed you can use the String.fromCharCode function to determine what the charCode for something is. The location on the keyboard is even reported, this helps distinguish between the left shift and the right shift and even the numbers across the qwerty and the numpad on the right of the screen.
[kml_flashembed fversion=”9.0.0″ movie=”https://circlecube.com/circlecube/wp-content/uploads/sites/10/2008/07/key-listener.swf” targetclass=”flashmovie” publishmethod=”dynamic” width=”500″ height=”500″]

Get Adobe Flash player

[/kml_flashembed]

Actionscript

[cc lang=”actionscript” tab_size=”2″ lines=”40″]

import flash.events.KeyboardEvent;

//keycodes
var left:uint = 37;
var up:uint = 38;
var right:uint = 39;
var down:uint = 40;

stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownListener);

function keyDownListener(e:KeyboardEvent) {

feedbackAlt.text = e.altKey.toString();
feedbackCharCode.text = e.charCode.toString();
feedbackChar.text = String.fromCharCode(feedbackCharCode.text);
feedbackCtrl.text = e.ctrlKey.toString();
feedbackKey.text = e.keyCode.toString();
feedbackLoc.text = e.keyLocation.toString();
feedbackShift.text = e.shiftKey.toString();

if (e.keyCode == left){
ship.x-=10;
ship.rotation = 90;
}
if (e.keyCode == up){
ship.y-=10;
ship.rotation = 180;
}
if (e.keyCode == right){
ship.x+=10;
ship.rotation = 270;
}
if (e.keyCode == down){
ship.y+=10;
ship.rotation = 0;
}
}

[/cc]

Download

source file download: key-listener.fla

SuperBookMarker Web App Design

sbm_1sbm_2sbm_3
Social Bookmarking master site built for StomerNet SMARTS (Social Marketing Traffic Secrets) members for easy social bookmarking. Minimalist design for clear presentation of organized sortable data. Implemented javascript (jquery) libraries for sorting and paging tables, javascript used to control visibility of elements on the page. Very simple and organized design, but still contain loads of information.sbm_4

StomperNet's Stomper Universe | Interactive Flash Site Map

StomperNet now has a site map. Only it’s much bigger than just a site map, we’re calling it Stomper Universe! It contains all the pieces parts that make up StomperNet. It links to different sites, video series, tools, and more by giving a 3D interactive space to inspect the thumbnails and click through to the sites! It will help visitors navigate easily to all areas of StomperNet, whether they are new to them or old favorites.

So go check out the StomperNet Universe now!

Stompernet universe thumbnail

StomperNet Going Natural 3 Web Design

gn3_1Site built for Going Natural 3, free series of videos to promote the re-opening of StomperNet. Includes flash video and html template design in drupal all styled with custom made themes and css. Users were prompted to subscribe with email address and then allowed to view the premium video content and comment. Site discontinued, but video content still available at stomperblog.gn3_2

iKill Flash Game Art

iKill_1

iKill: Pick Fruit, Be Happy, Keep Killing

iKill_5I developed this game for my Digital Media Thesis. I wanted to do a project that was interactive, and enjoying flash I decided to create it in the form of a game. The project called “iKill’ is Installation Game Art, and is also available online. It explores multiple these, such as man in nature, globalization, fast food, economics, etc. The game was part of an installation for the Digital Media Exit show of Spring 2007. I kept progress of the game online at my digmeexit blog with incremental demo versions of the project. The installation had a fully interactive game and used game controller to play. In the game you play the generic man and work through the work week. Your job is to pick fruit as it grows on the trees. You receive your wages according to your harvest and at the end of the day you “cash out” and earn your happiness (how else but with Happy Meals). You do encounter obstacles and must kill the bugs before they deprive you of your happy harvest! It is pretty simple critique on a culture that equates unhealthy food to happiness without regard to the environment, and equates a mindless 40 hour work week and competitive salary to a full life. For more details visit the development blog (digmeexit.blogspot)
iKill_6
iKill_4iKill_3iKill_2

Play Online Version of iKill

Use the arrows to move, space bar to pause, ‘z’ to jump and ‘x’ to swat.

Shared Object – utilizing the Flash cookie

Overview

The Shared Object is like a cookie for flash. It lets flash store some data on the local machine, so between sessions it can remember things. Learn more from wikipedia.
Shared Objects are used to store data on the client machine in much the same way that data is stored in a cookie created through a web browser. The data can only be read by movies originating from the same domain that created the Shared Object. This is the only way Macromedia Flash Player can write data to a user’s machine. Shared Objects can not remember a user’s e-mail address or other personal information unless they willingly provide such information.

I’ve seen many Local Shared Object tutorials and examples, which have users input their name and/or hometown and other filler data. But I wanted to show how to creatively incorporate shared objects into interactions. So I’ve thrown in many simultaneous examples including the uber-simple ‘input your name and I’ll remember it’ approach. I hope I didn’t throw in so much that it got confusing… just let me know if you have any questions or anything is unclear. Keeping it simply and broad there’s only a few things to know about Shared Objects.

Steps

    Simply put there are only a couple things to worry about with Local Shared Objects

  • Create them.
    • As in create the shared object
  • Write them.
    • As is write to the shared object
  • Set them.
    • As in setting variables in the shared object
  • Get them.
    • As in getting variables back out of the shared object
  • Clear them.
    • As in clearing the shared objec

Actionscript

here’s samples on how to do each of those
[cc lang=”actionscript” tab_size=”2″ lines=”40″]
/* Create them. */
//make Local Shared Object named myLocalSO(in as) called “myflashcookie” on disk
var myLocalSO:SharedObject = SharedObject.getLocal(“myflashcookie”);

/* Write them. */
//flush the SO, write the SO to disk
myLocalSO.flush();

/* Set them. */
//set key’s value to specified value in SO
//key is the name of the data
//val is key’s value
function setVal(key, val) {
myLocalSO.data[key] = val;
trace(key +” set to “+val);
/* including writing to Shared Object in the setter function */
//flush the SO, write the SO to disk
myLocalSO.flush();
}
/* Get them. */
//get key’s value from SO
function getVal(key) {
return myLocalSO.data[key];
trace(myLocalSO.data[key] +” received from “+key);
}
/* Clear them. */
myLocalSO.clear();
[/cc]

Example

here’s my colorful example.
The purple/yellow circle is draggable, so place it where you want it. Enter your name and age in the input boxes. Press the center red ‘Set cookie’ button to copy those values to the shared object that is on your computer now. The red transparent circle represents the cookie positions. You can position the purple/yellow circle from the cookie contents with the dark green ‘Position from cookie’ button, or position it randomly with the blue ‘Position randomly’ button. Erase the cookie with the orange ‘Erase cookie’ button. Toggle easing (animation) with the Bright green button (which changes to dark red when off), it tells the current mode of ease. I have the cookie coordinates displayed and the current coordinates of the purple/yellow circle also displayed.
The cookie includes a date object, which is used to calculate the age of the cookie (watch it reset when you erase the cookie (orange button)).
The ‘All Time Visit’ stat is the only thing that does not get reset when you erase the cookie,
[kml_flashembed fversion=”9.0.0″ movie=”https://circlecube.com/circlecube/wp-content/uploads/sites/10/2008/04/sharedObject.swf” targetclass=”flashmovie” publishmethod=”dynamic” width=”300″ height=”400″]

Get Adobe Flash player

[/kml_flashembed]

and source code:
[cc lang=”actionscript” tab_size=”2″ lines=”40″]
//////////////////////// Initialize variables ///////////////////////

//make Local Shared Object named myLocalSO(in as) called “myflashcookie” on disk
var myLocalSO:SharedObject = SharedObject.getLocal(“myflashcookie”);
//speed var for easing
var speed = 3;
var w = myCircle._width/2;
//toggle var for easing
var ease = true;
//as var to store alltime cookie
var allTimeVisitCount=0;
countVisit();
cookieFeedback();
//line style for tracing movement
lineStyle(1, 0, 50);

//////////////////////// Functions ///////////////////////

//set key’s value to specified value in SO
//key is the name of the data
//val is key’s value
function setVal(key, val) {
myLocalSO.data[key] = val;
trace(key +” set to “+val);
//flush the SO, write the SO to disk
myLocalSO.flush();
}
//get key’s value from SO
function getVal(key) {
return myLocalSO.data[key];
trace(myLocalSO.data[key] +” received from “+key);
}

function countVisit() {
//if first visit
if (getVal(‘visitCount’) == undefined) {
//create date for now and store in cookie
var todayDate:Date = new Date();
setVal(‘date’, todayDate);
trace(“creating date”);
//start/reset counting visits
var visitCount = 0;
//notice allTimeVisitCount is not reset, but stored still as a var in actionscript
}

//not first visit
else {
visitCount = getVal(‘visitCount’);
allTimeVisitCount = getVal(‘allTimeVisitCount’);
}
//increment visit counter
setVal(‘visitCount’, visitCount+1);
setVal(‘allTimeVisitCount’, allTimeVisitCount+1);
//feedback of visit counting
visitsFeedback.text = getVal(‘visitCount’);
allTimeVisitsFeedback.text = getVal(‘allTimeVisitCount’);
}
//feedback of cookie contents
function cookieFeedback() {
//in defined print coordinate contents
cookiex.text = getVal(‘circleX’) == undefined ? “no cookie” : getVal(‘circleX’);
cookiey.text = getVal(‘circleY’) == undefined ? “no cookie” : getVal(‘circleY’);

//if not easing assign coordinates from cookie
if (!ease) {
myCookie._x = getVal(‘circleX’);
myCookie._y = getVal(‘circleY’);
}
//set target to cookie coordinates
else {
ctargetx = getVal(‘circleX’);
ctargety = getVal(‘circleY’);
}
//if name then trace cookie contents
if (getVal(‘name’) != undefined) {
visitorFeedback.text = “Returning Visitor”;
nameInput.text = getVal(‘name’);
ageInput.text = getVal(‘age’);
}
//no name then a new visitor
else {
visitorFeedback.text = “First Time Visitor”;
nameInput.text = “”;
ageInput.text = “”;
}
calculateCookieAge();
}
function calculateCookieAge() {
//make a date now
todayDate = new Date();
//get the cookie’s stored date
cookieDate = getVal(‘date’);
//difference between two dates
cookieDateAge = Math.floor(todayDate – cookieDate);
//convert miliseconds to a timecode
cookieAge.text = msToTimeCode(cookieDateAge);cookieDateAge;
}

//convert miliseconds to a hh:mm:ss
function msToTimeCode(ms) {
//make sure value is within bounds. if a number grater than zero and less than the duration of video
if (isNaN(ms) || ms< 0) { ms = 0; } //find seconds var sec = ms/1000; //find minutes var min = Math.floor(sec/60); //adjust seconds sec = sec - min*60; //find hours var hour = Math.floor(min/60); //adjust minutes min = min - hour*60; //floor seconds down to whole number sec = Math.floor(sec); //make time code with hours if (hour == 0) { if (sec < 10) { sec = "0"+sec; } if (min < 10) { min = "0"+min; } var tc = min+":"+sec; } //make time code without hours else { if (sec < 10) { sec = "0"+sec; } if (min < 10) { min = "0"+min; } var tc = hour+":"+min+":"+sec; } return tc; }////// Actionscript attached to Objects/handlers ////////////place data on stage into cookie (circle coordinates and input text) setCookieButton.onRelease = function() { setVal('circleX', myCircle._x); setVal('circleY', myCircle._y); setVal('name', nameInput.text); setVal('age', ageInput.text); //update the display on stage cookieFeedback(); } //make random coordinates on stage randomButton.onRelease = function() { //if not easing assign coordinates to myCircle if (!ease) { myCircle._x = Math.random() * (Stage.width - w); myCircle._y = Math.random() * (Stage.height - w); } //if easing assign coordinates to myCircle's target coords else { targetx = Math.random() * (Stage.width - w); targety = Math.random() * (Stage.height - w); } }myCircle.onPress = function() { this.startDrag(); dragging = true; lineStyle(1, 200, 30); }myCircle.onRelease = myCircle.onReleaseOutside = function() { targetx = this._x; targety = this._y;lineStyle(1, 0, 50);dragging = false; this.stopDrag(); }myCircle.onEnterFrame = function() { //print position feedback currentx.text = this._x; currenty.text = this._y; //if eas move to target if (ease) { if (!dragging) { moveTo(this._x+w, this._y+w); this._x+=(targetx-this._x)/speed; this._y+=(targety-this._y)/speed; } //draw line lineTo(this._x+w, this._y+w); } }myCookie.onEnterFrame = function() { //if ease move cookie to target if (ease) { this._x+=(ctargetx-this._x)/speed; this._y+=(ctargety-this._y)/speed; } calculateCookieAge(); }//Position from Cookie cookieButton.onRelease = function() { //if not easing set coordinates from cookie if (!ease) { myCircle._x = getVal('circleX'); myCircle._y = getVal('circleY'); } //if easing set target coordinates from cookie else { targetx = getVal('circleX'); targety = getVal('circleY'); } } easeBtn.onRelease = function () { //toggle easing ease = !ease; //advance the frame of this button... this.play(); } clearCookieBtn.onRelease = function() { //clear the cookie (swipe all data) myLocalSO.clear(); //restart visit count countVisit(); //read cookie and give feedback cookieFeedback(); } [/cc]

Source

download the source for this example: sharedObject.fla

Stomper Scrutinizer Browser AIR App

scrut_4
Software for viewing websites through a simulated fovea vision. Since not everyone could set-up, let alone afford a real eye-tracker. This software uses the mouse pointer as the user’s focal point, or foveal view. It blurs everything except where your focal point (the mouse) is. It is helpful because it forces you to re-think web design from an extreme usability standpoint. This browser software was built using AIR and Flex. Using this software as an eye-tracking simulation, you can get a better idea of how users interact with your site design.
scrut_2scrut_1scrut_3

I was responsible for programming and designing some key functionality of the app: the menu bar logic, bookmarking engine, capturing and saving of screenshots, and the loading bar which shows page load progress, and the overall browser chrome/skin.