ActionScript code to create a carousel menu

Posted on 2009-02-20
Last Modified: 2013-11-11
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



	Made By:




	// 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;



	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;



	carousel._visible = true;



Open in new window

Question by:ametrade
    LVL 11

    Accepted Solution

    going to this link and checking out the Creating 3D Carousels lesson.


    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    The goal of the tutorial is to teach the user how to how to record live broadcast.
    The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now