Paging through a book with Flash

This is perhaps one of the most sweet-looking uses of Flash I’ve seen in a while. This came across my RSS feed today, an author/artist who’s put together a book called “The Art of Wooing” — but what woo’d me most was his impressive flash preview of his book. (Hint: click and drag the corner of the pages)

Digg This
February 25, 2008, 11:41 am

Simply brilliant — Leo Burnett

This is probably one of the better portfolio’s I’ve seen in Flash >> http://www.leoburnett.ca/

Digg This
March 28, 2006, 5:58 pm

Executive Briefing Center

Well, I’ve just recently finished a really cool, new media piece for my employer’s Executive Briefing Center (a fancy name for meeting room). Since I don’t really want HTTP_REFER references coming from my blog, copy and paste this URL into your browser, download the referenced zip file, and run the presentation contained therein. It rocks — if I do say so myself.

Digg This
February 17, 2006, 5:00 pm

PHP/SWF Charts

In the quest for already-packaged dynamic charting flash files, I came across a pretty cool looking resource that combines PHP and Flash to create some pretty cool, dynamic charts. I haven’t actually tried it out yet, but it looks pretty flexible and robust. For more information, visit http://www.maani.us/charts/index.php

There is also an XML version here: http://www.maani.us/xml_charts/index.php

Digg This
July 11, 2005, 8:16 am

Moving Selected Item in UI List

So following up to my other follow-ups ;) on the UI list selection boxes, I’ve added functionality that can move a selection up or down in the list order. In this example, the UI list box instance name is selectedModulesBox.

Here’s the code that makes it move up in the sort order:

// ######## this example moves an item up in the sort order (example: from index 2 to index 1)
on (release) {
// the UI list instance name is "selectedModulesBox"
selectedIndexNumber = selectedModulesBox.selectedIndex; // get current selection index number
previousIndexNumber = selectedIndexNumber - 1; // get the destination index number
if (selectedIndexNumber > 0) {
// temporarily store the data we're going to be moving into some variables so we don't lose it
movingSelectedItem = selectedModulesBox.getItemAt(selectedIndexNumber);
movingPriorItem = selectedModulesBox.getItemAt(previousIndexNumber);
// replace the data in originating and destination indices
selectedModulesBox.replaceItemAt(previousIndexNumber, movingSelectedItem.label, movingSelectedItem.data);
selectedModulesBox.replaceItemAt(selectedIndexNumber, movingPriorItem.label, movingPriorItem.data);
// move the selection box up in the order
selectedModulesBox.selectedIndex = previousIndexNumber;
}
}

to move it down in the sort order, use this code:

on (release) {
selectedIndexNumber = selectedModulesBox.selectedIndex;
nextIndexNumber = selectedIndexNumber + 1;
if (nextIndexNumber < selectedModulesBox.length) {
movingSelectedItem = selectedModulesBox.getItemAt(selectedIndexNumber);
movingNextItem = selectedModulesBox.getItemAt(nextIndexNumber);
selectedModulesBox.replaceItemAt(nextIndexNumber, movingSelectedItem.label, movingSelectedItem.data);
selectedModulesBox.replaceItemAt(selectedIndexNumber, movingNextItem.label, movingNextItem.data);
selectedModulesBox.selectedIndex = nextIndexNumber;
}
}

What is actually forcing the selection highlight to move with the change in order is the line: selectedModulesBox.selectedIndex = nextIndexNumber;. What that’s doing is simply saying that the new selectedIndex value in the UI list is the destination index number.

Lose ya? Leave your questions and I might be able to answer them.

Digg This
June 23, 2005, 12:01 pm

Followup: adding & removing items to/from components

In a follow-up to my previous post, I mentioned that I had two UI components (selection lists) that I wanted to be able to add to list2 from list1 by selecting items in list1 and clicking a button. Likewise, I wanted to remove selected items from list2 by clicking another button.

Because I’m pretty new with Actionscript 2.0, I’ve had to hunt-n-peck through the help guide in Flash and try different things out. So here’s all you need to do to make it work.

First you need two instances of a UI list box. For this example, List1 has a list of items to choose from. List2 is the target list where we want to transfer our selection to with the click of a button. Give the first UI list box an instance name of List1 and the second List2.

You’ll need two buttons, one to transfer selected items from List1 to List2 and one to remove selected items from List2.

On the transfer button, use this actionscript:

on (release) {
tempArr = new Array();
tempArr = _root.List1.getSelectedItems();
for (i=0; i _root.List2.addItem(tempArr[i].label, tempArr[i].data);
}
_root.List2.dataProvider = tempArr;
}

What this code essentially does is goes through List1 and throws the selected items into an array (tempArr). We cycle through that array and add the label and data to List2.

On the remove selection button, use this actionscript:

on (release) {
myArr = new Array();
myArr = List2.selectedItems;
for (i = 0;
i < myArr.length;
i++) {
List2.removeItemAt(List2.selectedIndex);
}
}

This snippet makes an array of the selected items in List2 and simply removes them from the List2 UI list. Pretty straight forward stuff.

The most complicated part of getting to this was understanding what I could and couldn’t do with these lists. Hope you find this useful.

Digg This
June 23, 2005, 9:46 am

Yard Improvement

It seems that I’ve been spending less and less time on my PC at home these days now being a home-owner. Lately I’ve been focusing on getting the yard into shape, taking a bit of a break from finishing the bathroom. A lot of landscaping ahead of us—we wanna get the grass back into shape and get a flower garden going this year.

I’m doing some interesting Actionscript-related things at work these days. That module selection application that I eluded to in a prior entry is taking an interesting turn. I’m trying to do some moderately-complicated form work within Flash—form work that could be done in a heart-beat using JavaScript… but not so easy in Flash.

I’ve got two UI (User Interface) component objects and am trying to transfer selected data from comp1 to comp2 and remove data from comp2 based on which button you choose.

To transfer from one UI comp to another:

on (release) {
tempArr = new Array();
tempArr = _root.selectionBox.getSelectedItems();
for (i=0; i _root.targetBox.addItem(tempArr[i].label, tempArr[i].data);
}
_root.targetBox.dataProvider = tempArr;
}

Slap that code in a “transfer” button and it will copy the data from selectionBox over to targetBox. Now where I’m stuck is removing the selected data elements from targetBox. That’ll be todays’ project.

Digg This
June 23, 2005, 9:05 am

URL Strings Handled by JavaScript & Flash

One of the challenges that I face in my Flash development is the handling of dynamic choices in data selection in a not-so-dynamic environment. Because usage and access to databases and dynamic scripting requires an act of congress, I am left with the necessity of improvisation and taking advantage of as many client-side abilities as I can.

Challenge: I’ve got an XML file with an array of choices that the user can choose from. They’re basically flash-based marketing modules—animations with voice-overs about our various services and options. Each user, employee, or employer can choose which modules they want to view and that means that there could be hundreds of thousands of possible combinations of modules that people can view and in the order that they want.

Limitations: A static XML file containing data about the flash modules, HTML, JavaScript,

(more…)

Digg This
June 20, 2005, 9:46 am