Link to home
Start Free TrialLog in
Avatar of ametrade
ametrade

asked on

ActionScript code to create a carousel menu

hello I have the following AS code, the current animation is a carousel, in the center there is a globe but I need the items to orbit this globe. I have no idea how to do it, thanks.
/**
*	this example includes an extended asset in the library - which includes a 
	movieclip in the carouselItem asset named "imgLoader". you can load an swf or 
	a jpeg to it using the good old loadMovie method as shown below.
	
	This example must not be put in the main movie's onSelfEvent(load) Event because 
	It takes a few frames until the items are being generated to the stage (that's why i used
	onFrame(10).
	
	Made By:
	http://www.orizens.com
*
*/
onSelfEvent(load){
	// in order to prevent a flickering effect when the images is being loaded only in 
	// the 5th frame - it is good only if it is tested localy so you might want the use
	// a static preloader for the carouselItem like i used
	carousel._visible = false;
}
onFrame(5){
	var imagesArray:Array = new Array("iconos.png","iconos2.png","iconos3.png","iconos4.png","iconos5.png","iconos6.png","iconos7.png","iconos8.png");
	var IMAGES_DIR:String = "images/";
	for (i=0; i < imagesArray.length; i++){
		myItem = eval("carousel.cItem" + i);
		myItem.imgLoader.loadMovie(IMAGES_DIR + imagesArray[i]);
		// Overiding the button's click event of onPress
		// Alternativley - you can assign a function on the parameters panel
		myItem.onPress = function(){
			trace("you clicked " + this._name);
		}
		//resizing the loaded images - not required...
		myItem.imgLoader._xscale = 100
		myItem.imgLoader._yscale = 100;
		trace(myItem._name);
	}
	carousel._visible = true;
	stop();
}

Open in new window

screen.jpg
ASKER CERTIFIED SOLUTION
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ametrade
ametrade

ASKER