Apple AS2 XML Slideshow

Some few tricks on simple flash xml slideshow on Action Script 2.

1. The Slideshow


function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
desc_txt2.text = description2[0];
btnLinks(0);
slideshow();
}
}

function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
desc_txt2.text = description2[p];
btnLinks(p);
slideshow();
}
}
}

function prevImage() {
if (p>0) {
p–;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
desc_txt2.text = description2[0];
btnLinks(p);
slideshow();
}
}

function slideshow() {
if (stopit) {
myInterval = setInterval(pause_slideshow, delay);
} else {
clearInterval(myInterval);
}

function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}

function pause_slideshow() {
stopit = false;
clearInterval(myInterval);
}

function btnLinks(p) {
btnlink.onRelease = function() {
getURL(link[p]);
trace(link[p]);
}
}

2. The Load XML

function loadXML(loaded) {
if (loaded) {
trace("file loaded!");
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
for (i=0; i
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description2[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
link[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
}
firstImage();
} else {
trace("file not loaded!");
}
}

var stopit = true;
var myInterval;
var delay = 5000;
var p = 0;
var total;
var image = new Array();
var description = new Array();
var description2 = new Array();
var link = new Array();

var xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“sample.xml”);

3. The Retrival

this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 4;
}
}
};

Source :
FLA File
XML Sample
AS2

Version2:
FLA File
XML Sample

Learn Basic Flash From Apple

Yeah! Applebyte is now conducting a free Flash 101 Tutorial at NCF, from May 15 to June 5, 2010. Four Saturday(s) at 1pm, I will be teaching basic of Flash which includes Basic Tweening, Effects, Video and Sound, PSD to Flash and more…

First day of class was yesterday and it was amazing. We have tackled the Flash Basic Tweening and I really enjoyed the session. To those who want to join us… you must attend the Flash Basic Tweening  (pre-requisite of the succeeding lessons) this coming Saturday May 22, 2010 at NCF Zabarte Ave, Novaliches, Quezon City.

You can also download the Flash for Beginner here.

Jonel Rubio is also conducting Adobe Photoshop for Beginners… Lets bring back to God his given talent. Horay!

Comelec show unstable, unreadiness!

Philippine Election 2010, the first automation election. So sad, last week the Compact Flash of PCOS machine failed on testing. The new Compact Flash was delivered throughout the nations still not yet completed this Monday morning.

While the suppose online voters list that provided by Comelec cannot be access due of Comelec bandwidth limitation. Ooops, the website down already.

The list of voters of Metro Manila which can be downloaded as a PDF file and contains information such as precinct number, VRR, registration date and polling place.  It shows your full name (including the middle name!), complete address and birth date…. Ooopsss… They post it online without any security measure.

The computer experts and watchdog groups warned on the eve of the balloting that the haphazard preparations of the Commission on Elections (Comelec) would produce an avalanche of technical problems. Comelec have unstable, unreadiness automation election!

Applebyte touched iPad

Last Friday, Perry brought Tiger’s iPad on my desk… My first impression… HUGE! The bulk of its surface is taken up by a 9.7-inch, 1024 x 768, capacitive, multi-touch LED-backlit display surrounded by a glossy black bezel that some will say is too wide. Well for me, If I decided to have the medium-sized everyday purse and I cannot safely fit an iPad in it. It was fit on my lap, but it will restrain my wrist, Why they didn’t design an iPad stand? Apple byte iPad was not meant to be!

The aluminium back feels great under the finger and nothing feels cheap. There is an audio jack connector for headphones, and a microphone for apps that need it. The speaker is on the bottom of the device where the “Home” button is. The typing was wonderful, unlike the  iTouch with smaller screen.

Surfing and reading is great. Have a great potential if you are using stanza or other ebook reader it was fun. The iPad can be cranked up to an almost painful brightness, but also handles lower settings well — that’s especially important for readers (they even include a brightness control inside of iBooks).

For me, it just like having a big iTouch, women are obviously not the demographic for the iPad, but it will be interesting to see how or if Apple tries to find some niche use for us, I really love my iTouch, thanks to Gerry.  I hope iPad user out there get their money’s worth… Thank Kristel for the Photo!

Design for your delight in Grid Based

Web designers found their salvation in Grid System to create appealing and web standard compliance website. The growing influence of traditional print design techniques on the Web makes gives more freedom and artistic flow. The CSS based grid frameworks (like 960 Grid System and Blueprint) have emerged and gained popularity. Yes, you can now design for your delight.

You can now create layout that are resemble of print magazines or posters, striking headlines, multi-column text, highlighted quotations, indented text, supporting imagery, side notes and footnotes. The Grid Based designs usually adhere to grids and have strong, vivid typography.

Bold, strong, heavy headlines can effectively convey the purpose of an e-commerce website or portfolio, while subtler headings help structure content and improve legibility.

Grid-based Web design as a whole encompasses the entire workflow (design comp, coding, future updates) we can now create a flexible framework share between our graphic assets and code files that rationalizes many things about our designs.