Rotating Flash Header??
I want to design a rotating flash header on top of a html website I'm designing in Dreamweaver. Anyone know of any good tutorials on how to do this??
I'm looking for something that's similar to whats on top of hulu.com.
I have built a demo for you. You can download it here and examine the frame 1 code: http://www.grumblebee.com/stuff/cow/slideShow.zip
It's fed from an xml file (included) that looks like this:
If you want to change, add or remove images, just edit the xml.
The code first loads in the xml file, grabbing all those image nodes and parsing them into an array* of urls: "bat.jpg", "cat.jpg", ...
Then it creates a Loader for each url. A Loader is an AS3 object that can load in and display an external image, such as cat.jpg.
In a loop, the code then loads each image into its loader and keeps track of how many have loaded so far. Once all images are loaded, the program is ready to move on.
It displays the first image and then sits there, doing nothing, until a user presses one of the nav buttons.
When the user presses a nav button, the program changes a counter variable that keeps track of which image is currently showing. The counter starts at zero. If the user presses the right-nav button, the counter increments to one. If he presses it a second time, the counter increments to two and so on. If the counter increments to a number higher than than the total number of images, the counter resets to zero.
The left-nav button works the same way, only in reverse. It decrements the counter, but if the counter dips below zero, it resets at totalImages - 1.
After the counter gets incremented or decremented, the program calls a function called displayLoader, which hides the previously-shown loader and shows the one corresponding with the current counter number.
I hope that makes some sort of sense. For reference, here's the code on frame 1:
* Instead of Arrays, I have used Vectors, which are just like Arrays, but more optimized for Flash Player 10. If you're prepping this for Flash Player 9 (or an earlier version), you'll have to change my Vectors to Arrays. For instance, you'd change this...
var loaders : Vector.<Loader> = new Vector.<Loader>;
var loaders : Array = new Array();
Author "After Effects Expressions"
Co-author "After Effects For Flash, Flash For After Effects"
Artistic Director, Folding Chair Classical Theatre, Inc
Senior Flash Developer, Zeitbyte.com