Icon carousel with XML support version 2 now in AS3
I previously posted a icon carousel written in as2, but wanted to do the same for as3. Both the AS2 and the AS3 version loaded an XML-file that was parsed to retrieve the content/images that should be viewed. This article explains the files needed with code to get the final result visualized below.
First and foremost we have to create the XML-file that holds the data. We do not need a XSD for this and it´s just rock´n roll. Before creating the xml document though, download the icons for the icon carousel here
<icons> <icon image="images/icon1.png" tooltip="3D Studio Max"/> <icon image="images/icon2.png" tooltip="ACDSee Classic"/> <icon image="images/icon3.png" tooltip="ACDSee"/> <icon image="images/icon4.png" tooltip="Ad Aware SE"/> <icon image="images/icon5.png" tooltip="Adobe Acrobat 3D"/> <icon image="images/icon6.png" tooltip="Adobe Acrobat Destiller"/> <icon image="images/icon7.png" tooltip="Adobe Acrobat Professional"/> <icon image="images/icon8.png" tooltip="Adobe Acrobat Professional"/> <icon image="images/icon9.png" tooltip="Adobe Acrobat Reader"/> <icon image="images/icon10.png" tooltip="Adobe Acrobat Standard"/> <icon image="images/icon11.png" tooltip="3D Studio Max"/> <icon image="images/icon12.png" tooltip="ACDSee Classic"/> <icon image="images/icon13.png" tooltip="ACDSee"/> <icon image="images/icon14.png" tooltip="Ad Aware SE"/> <icon image="images/icon15.png" tooltip="Adobe Acrobat 3D"/> <icon image="images/icon16.png" tooltip="Adobe Acrobat Destiller"/> <icon image="images/icon17.png" tooltip="Adobe Acrobat Professional"/> <icon image="images/icon18.png" tooltip="Adobe Acrobat Professional"/> <icon image="images/icon19.png" tooltip="Adobe Acrobat Reader"/> <icon image="images/icon20.png" tooltip="Adobe Acrobat Standard"/> </icons>
Save this xml as icons.xml and save it in the root directory where your *.fla-file is.
Okey, lets start creating the stage and setting up the “Document class”. Set the width of the stage to 650 pixelsand the height to 350 pixels. When this is done set the document class to the same as your .fla-file is(mine is index). Remember to create a new class for the document class and save it to your root where the .fla-file is.

Now, open the document class and insert the code below.
package
{
import flash.display.MovieClip;
import flash.net.*;
import flash.events.Event;
import flash.xml.XMLDocument;
import flash.display.Loader;
import flash.errors.IOError;
import flash.events.IOErrorEvent;
import flash.geom.Point;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.DisplayObject;
public class index extends MovieClip
{
private var xml:XMLDocument;
private var loader:URLLoader = new URLLoader();
private var imgLoader:Loader = new Loader();
private var items:Array = new Array();
private var cItems:Array = new Array();
private var loaders:Array = new Array();
private var c:int = 0;
private var radius:Point;
private var center:Point;
private var speed:Number=0.01;
private var currentItem:CarouselItem;
private var backgroundMC:BackgroundMC;
private var container:Sprite;
private var tooltip:Tooltip;
public function index()
{
// create and add the background
backgroundMC = new BackgroundMC();
this.addChild(backgroundMC);
// create container holding icons
container = new Sprite;
addChild(container);
// create tooltip for hovering
tooltip = new Tooltip();
addChild(tooltip);
// for blogging purposes
//radius=new Point(275,40);
//center=new Point(325, 150);
// setting variables used for positioning
radius=new Point(stage.stageWidth/2-50,40);
center=new Point(stage.stageWidth/2, stage.stageHeight/2);
// download xml-file
getXML();
// mouse not hovering yet
tooltip.visible = false;
}
public function getXML():void
{
try
{
loader.addEventListener(Event.COMPLETE, onLoaderComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onLoadedError);
loader.load(new URLRequest("http://flash.lillegutt.com/wp-content/uploads/carousel_as3/icons.xml"));
}
catch(error:IOErrorEvent){
trace("ERROR" + error);
}
}
private function onLoadedError(e:IOErrorEvent){
var error:ErrorScreen = new ErrorScreen();
error.error.text = e.text;
addChild(error);
trace("ERROR" + e.text);
}
public function onLoaderComplete(e:Event):void
{
xml = new XMLDocument();
xml.ignoreWhite = true;
xml.parseXML(loader.data);
createItemsFromXML();
addEventListener(Event.ENTER_FRAME, mouseMover);
}
private function createItemsFromXML():void
{
var numIcons:int = xml.firstChild.childNodes.length;
for(var i:int = 0; i < numIcons; i++)
{
//adding the object(item) to the array
items.push(xml.firstChild.childNodes[i].attributes);
}
addItemsToScreen();
}
private function addItemsToScreen():void
{
for(var k:int = 0; k < items.length; k++)
{
loaders[k] = new Loader();
loaders[k].contentLoaderInfo.addEventListener(Event.COMPLETE, onItemImageLoaded);
loaders[k].load(new URLRequest("http://flash.lillegutt.com/wp-content/uploads/carousel_as3/"+items[k].image));
}
}
private function onItemImageLoaded(e:Event):void
{
var t:CarouselItem=new CarouselItem(loaders[c].content);
t.angle=(c*((Math.PI*2)/items.length));
t.addEventListener(Event.ENTER_FRAME,onEnter);
t._name = xml.firstChild.childNodes[c].attributes.tooltip;
cItems[c] = t;
cItems[c].addEventListener(MouseEvent.MOUSE_OVER, onOver);
cItems[c].addEventListener(MouseEvent.MOUSE_OUT, onOut);
cItems[c].addEventListener(MouseEvent.MOUSE_DOWN, onDown);
container.addChild(cItems[c]);
c++;
}
private function onOver(e:MouseEvent):void
{
var obj:CarouselItem = CarouselItem(e.currentTarget);
currentItem = obj;
tooltip.title.text = obj._name;
var tmp:String = obj._name;
tooltip.width = tmp.length*11;
tooltip.visible = true;
}
private function onOut(e:MouseEvent):void
{
tooltip.visible = false;
}
private function onDown(e:MouseEvent):void
{
var obj:CarouselItem = CarouselItem(e.currentTarget);
currentItem = obj;
trace("[CarouselItem] - " + obj._name + " pressed");
}
private function onEnter(evt:Event):void{
var obj:CarouselItem=CarouselItem(evt.currentTarget);
obj.x=Math.cos(obj.angle) *radius.x +center.x;
obj.y=Math.sin(obj.angle) *radius.y +center.y;
if(tooltip.visible){
tooltip.x = currentItem.x;
tooltip.y = currentItem.y-20;
}
var scale:Number=obj.y /(center.y+radius.y);
obj.scaleX=obj.scaleY=scale*1;
obj.angle=(obj.angle+speed);
arrange();
}
public function arrange():void
{
cItems.sortOn("y", Array.NUMERIC);
var i:int = cItems.length;
while(i--){
if (container.getChildAt(i) != cItems[i]) {
container.setChildIndex(cItems[i], i);
}
}
}
public function mouseMover(e:Event):void
{
speed = (mouseX - center.x) / 20000;
}
}
}
Okey, we are nearly there, but we have to create the CarouselItem that holds the image, reflection and title. So create a new as-file and save it as “CarouselItem.as” also to the root. Insert this code in:
package
{
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.display.Bitmap;
import flash.display.BitmapData;
public class CarouselItem extends Sprite
{
private var _angle:Number;
private var _image:DisplayObject;
private var _mirror:DisplayObject;
public var _name:String = "";
public function CarouselItem(original:DisplayObject){
// Create Container
var container:Sprite = new Sprite();
container.name = "copy";
// create bitmapdata
var data:BitmapData = new BitmapData(original.width, original.height, true, 0xFFFFFF);
data.draw(original);
// create bitmap
var bmp:Bitmap = new Bitmap(data.clone());
// add the bitmap to container
container.addChild(bmp);
_image = original;
image.scaleX = 0.3;
image.scaleY = 0.3;
image.x = -original.width/2;
image.y = -original.height/2;
bmp.scaleX = -0.3;
bmp.scaleY = -0.3;
bmp.x = original.width/2;
bmp.y = image.y+image.height*2;
// create the mask for reflection
var masker:maskMC = new maskMC();
masker.x = bmp.x;
masker.y = bmp.y;
masker.cacheAsBitmap = true;
bmp.cacheAsBitmap = true;
bmp.mask = masker;
// attaching the content
this.addChild(container);
this.addChild(masker);
this.addChild(original);
}
public function get image():DisplayObject{
return _image;
}
public function set image(val:DisplayObject):void{
_image=val;
}
public function get angle():Number{
return _angle;
}
public function set angle(val:Number):void{
_angle=val;
}
}
}
Thats it. Easy icon carousel that can have many areas of usage. You can also download the full example here and this includes all the files needed to complete this tutorial. Have fun!

Doesn’t seem to complie:
1046: Type was not found or was not a compile-time constant: maskMC.
1180: Call to a possibly undefined method maskMC.
Wouldn’t we need the maskMC MovieClip object in our fla for this to work?
If I attempt to create the mask or comment the mask code entirely, I get all sorts of compile errors:
1046: Type was not found or was not a compile-time constant: BackgroundMC.
1046: Type was not found or was not a compile-time constant: Tooltip.
1180: Call to a possibly undefined method BackgroundMC.
1180: Call to a possibly undefined method Tooltip.
1046: Type was not found or was not a compile-time constant: ErrorScreen.
1180: Call to a possibly undefined method ErrorScreen.
Not even sure where to start on those.
P.S. That’s a real email.
Hi guys,
Sorry for the hold up. I have now added the fla-file in the “download the full example here”-link so have fun and try to understand the things in the library. Those where the things that created the errors. If someone want to create code for the elements in the library, let me know, and I´ll put them in the post with your name on it
Later guys…
Nice! Works great now.
For those getting the “Cannot access property of null object” error; remember to change the two lines that say:
loader.load(new URLRequest(“http://flash.lillegutt.com/wp-content/uploads/carousel_as3/icons.xml”));
and
loaders[k].load(new URLRequest(“http://flash.lillegutt.com/wp-content/uploads/carousel_as3/”+items[k].image));
to point to your webserver or local directory. If bandwidth fluctuates on the URLRequest or lags even a little, it won’t load correctly and throw an error.
Hey thanks a lot. There’s a lot here that helps answer some questions a lot of questions.
Hey
Has anyone used this carousel on a website? Post some url’s here so we can se
Im getting mad 1046 1080 errors’ Something to do with CarouselItem was not found and a call to undefined method… Any idea’s? I have changed the paths to xml and items
Nevermind on my last comment the CarouselItem.as was missing from the “Full Package”
What do i do with this?
The image directory is local… how can i fix this to point locally??
loaders[k].load(new URLRequest(“images/”+items[k].image));
It´s good you found the problem and solved it
if you have the images in a folder named “images” locally where you have the swf, it should work
I have uploaded something very similar.
I am building up my website bit by bit so please dont laugh too much.
On the gallery page (where the carousel is) i am getting wording ‘undefined’ when i
expect to see a description.
Can anyone tell me what the problem may be.
Many thanks
Lee
Apologies,
please find link below
http://www.cadzine.co.uk/gallery.html
hi lelligut,
do you know how to implement imageSmoothing to your class?
its kinda important
hey reggy,
Does this link do the trick?
http://www.kaourantin.net/2005/12/dynamically-loading-bitmaps-with.html
Regards
lillegutt
Hi again,
its in as2… nevermind then, i;ll have to figure it out by myself
Great work on there. Thanks for putting it up.
I’m trying to pull the addresses out of the XML as well, then link to them when I click on the icon in the carousel. Any ideas how I can do this?
Thanks
Hi Richard,
You could add a variable in the CarouselItem class called url. When you then in the onDown function add a new line with navigateToURL(carouselItem.getUrl());
you will be navigating the users browser to the url you have set in the carouselItem.
Is this what you mean?
Regards
lillegutt
Hi lillegutt,
Thank you for the tutorial. It is very helpful for the starter like me. I have follow your instruction, by registering images folder, an icons.xml and carouselItem.as plus the index.as in the root where i save my index.fla file.
I have changed: loader.load(new URLRequest(”http://flash.lillegutt.com/wp-content/uploads/carousel_as3/icons.xml”));
to my local directory.
But It doesn’t work.
I still receive error messages below:
index.as ligne4 1046: This type is untraceable or is not a constant of compilation: SimpleButton.
Noted: ligne instruction: import flash.display.MovieClip;
Same error message for ligne6 where i have: import.events.Event
Others errors:
1046: This type is untraceable or is not a constant of compilation: CarouselItem.
1046: This type is untraceable or is not a constant of compilation: ErrorScreen.
1180: appeal to a method which does not seem defined, ErrorScreen.
1046: This type is untraceable or is not a constant of compilation: CarouselItem.
Could I send you my files and let you have a look.
Thank you in advance.
Hi lillegutt,
I sent you a zipped folder last saturday; I just would like to know if you got it.
Thank you in advance.
var numOfItems:Number = 4;
var radiusX:Number = 200;
var radiusY:Number = 50;
var centerX:Number = this.stage.stageWidth / 2;
var centerY:Number = this.stage.stageHeight / 2;
var speed:Number = 0.02;
var test:MovieClip = new MovieClip();
var navmc:Sprite = new Sprite();
var Nxml:XML;
var NxmlList:XMLList;
var NxmlLoader:URLLoader = new URLLoader();
var Ncontainer:MovieClip = new MovieClip();
var NimageLoader:Loader;
NxmlLoader.load(new URLRequest(“data/navigation.xml”));
NxmlLoader.addEventListener(Event.COMPLETE, iconsLoaded);
function iconsLoaded(e:Event):void
{
Nxml = XML(e.target.data);
NxmlList = Nxml.children();
for (var j = 0; j < NxmlList.length(); j++)
{
NimageLoader = new Loader();
NimageLoader.load(new URLRequest(NxmlList[j].attribute(“icons”)));
// I need to get all the images out of the loader on the stage seperate from each other when i do this ( test.addChild(NimageLoader)) all the images are on each other in one single object. Can anyone help me ?
test.addChild(NimageLoader)
test.name = “plaatje”+j
test.angle = j * ((Math.PI*2) / Nxml.length());
test.addEventListener(Event.ENTER_FRAME, mover);
test.buttonMode = true;
navmc.addChild(test);
addChild(navmc)
}
}
function mover(evt:Event):void
{
evt.currentTarget.x = Math.cos(evt.target.angle) * radiusX + centerX;
evt.currentTarget.y = Math.sin(evt.target.angle) * radiusY + centerY;
evt.target.angle += this.speed;
}
Oops, i forgot to post the thing i need help with:
In the code above this massage the loader gets the images out of my xml. But how can i get those images in seperate movieclips ? when i add them to one movieclip all the images lay on top off each other . I hope someone can help me
Tanks in Advance JJoosten
Sorry about my terrble english
Hi JJoosten,
Here is what you could do…
for (var j = 0; j < NxmlList.length(); j++)
{
NimageLoader = new Loader();
NimageLoader.load(new URLRequest(NxmlList[j].attribute(“icons”)));
//do this…
var s:Sprite = new Sprite();
s.addChild(NimageLoader);
s.name = “plaatje”+j;
s.angle = j * ((Math.PI*2) / Nxml.length());
s.addEventListener(Event.ENTER_FRAME, mover);
s.buttonMode = true;
navmc.addChild(s);
//move this out of your loop…
//addChild(navmc)
}
addChild(navmc);
What you should do is to download my LoadExternal class and use this as your “image downloader”. The code in that class wil clone the images downloaded and create new sprites every time it is being initialised. I would think that this can avoid giving you more problems with the images.
Did this help?
lillegutt
Hi lillegutt,
I know you are certainly buzy with your work. I would like to know if you received my latest email about Actionscript 3 Caroussel.
Your help will be very very appreciated.
Thank you in advance.
Aime.
Was wondering if you could help me… is there any easy way to modify this so that it loads MovieClips from the Library, instead of loading external images for the icons? Thank you! And great work!
Hi Mike,
What you could do is to check out this post : http://flash.lillegutt.com/?p=37
Then you could create an array of all your library images and use that array instead of the loading of external images from the xml-file. That should do the trick. Does this help you?
Hello,
Thanks for posting this wonderful tutorial. I have everything working, except the images are not being called properly by the XML. No matter what images I put in or take out of the the image folder or the icons.xml, the same 6 images appear on the stage. Can you tell me what I am missing?
Thanks so much.
how do you flip the reflection in the correct direction?
Hey this looks perfect
But when I change the image location from your URL to my images folder it crashes flash. I’m not sure why, any clues.
Has anyone figured out how to flip the reflection in the correct direction?
I think I figured out how to get the reflection to appear in the right direction. I changed the bmp.scaleX line “CarouselItem.as” from a negative value to a positive value and that seemed to work.
I have another question though. Is there a way to get it so that only the icon itself is clickable? The way it works now is that both the icon and its reflection are clickable.
Sorry for all the questions, but has any one figured out how to get this to load into another AS3 Flash movie. I am trying to load this carousel into my main Flash movie but I keep getting this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at index2_fla::MainTimeline/frame1()
I believe I have all of the files in the correct places. Any ideas?
Hi Matt, so sorry for not responding to your previous questions. I’ve been extreemly buzy with work.
Have you published the carousel swf file and put it somewhere inside your other folder structure?
Images you use in the carousel, are they accessable from your MAIN.swf(in the same folder structure)?
Try adding a breakpoint on the start of your application and press Ctrl + Shift + Enter to get Debug mode. Step by step/line by line check what element that does not get its content(=null) and generates the error.
I havent testet the swf in another swf so please write a new comment if you figure it out. If not, I will have a look at it and maybe fix it for future references
Referece to the reflection getting clickable status. The icon that is flipped is also masked and is in a MovieClip container(if I remember it correctly). Have you tried setting the mask movieclip.buttonMode=false and movieclip.mouseEnabled=false?
Thanx for commenting, Matt.
Thanks for responding.
I think what was giving me the TypeError: Error #1009 was the references to stage. I removed those and hard coded the X and Y positions and everything works OK. I am not exactly sure why the stage references were the problem, I just know that without them everything seems to work just fine. If any one can tell me why, it would be greatly appreciated. I would much rather position the carousel using the stage width and height.
I am still messing with the reflection clickable status. I will let you know what comes of that.
As a side note, have you ever tried to have more than one carousel in a Flash movie? I have just been playing around with the idea of having two carousels in my movie (not up at the same time, but on separate frames) but keep getting the following error:
TypeError: Error #1010: A term is undefined and has no properties.
at test_fla::MainTimeline/onItemImageLoaded()
It actually shows up 6 six times when I try to go to the other frame with the second carousel. I don’t know if that will help in answering, just a thought.
This is such a great idea. Thanks for all the help.
I have a functioning version of a main Flash version that loads another Flash movie that then contains two separate carousels. The idea is not all that complex, just too much to describe in detail here.
I am still trying to solve the issue with having the reflection not clickable. I will continue to plug away at this, but if any one could shed more light on this that would be great.
Hi! First of all nice to see the carousel made in AS3, good work! To say the least!
I got the same problem as Matt…
I need to load the SWF into timeline in 6 different places, like frame 10 and then another carousel to load on frame 20.
This is how I load the SWF:
On each frame I have placed an empty movieClip to load the Caroursel, inside this movieClip I use this code to call for the SWF file:
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, LoadComplete);
function LoadComplete(loadEvent:Event)
{
addChild(loadEvent.currentTarget.content);
setChildIndex(loadEvent.currentTarget.content, 0);
}
myLoader.load(new URLRequest(“newyork/newyork.swf”));
———————————————————————————-
As you can see I’m trying to load the SWF from a folder placed inside the root directory.
I’m pretty new to flash so I don’t know how Matt was able to “hardcode” the XY valuables, but I sure it has something to do with whats going on inside the Index.as file…
PLEASE, oh pretty please help me out ;(
Thanks in Advance.
Hi Brian,
I will have another look at it later today and see if I can find out the main issue on this matter. I believe the problem is the location of where the carousel want to put the icons. Since the flash player works om layers and where the root is also a layer, my carousel may not work as wanted when loading it through an empty movieclip. I’ll try creating a better carousel for you and Matt and maybe you’ll find this easier to use
I’ll get back to you
Best regards
lillegutt
Awsome!
I will be watching and waiting with great anticipation
Thanks again for your effort.
Awesome!
I will be watching and waiting with great anticipation
Thanks for you effort on this, it is really appreciated.
Regards
Brian
A couple of things I’m curious about with the reflection:
It isn’t reversed as it should be. Also, I’m having trouble with scaling the reflection to the same site as the original item image as well as the position of the reflection relative to the item.
Hi, thanks for the Corousel. Instead of bitmap images, I’d like to load .swf files as the icon images, but when I replace the .png s with same-named .swf vector art files, the first one loads then there are errors. I believe I have isolated the problem to the function “onProductItemImageLoaded(e:Event):void” in the first line “var t:CarouselItem=new CarouselItem(productLoaders[c].content);” because when I trace “productLoaders[c].content” it succeeds when it is a .png file but is null if it is a .swf file loaded.
Help?
loaders[k].load(new URLRequest(“http://flash.lillegutt.com/wp-content/uploads/carousel_as3/”+items[k].image));
what exactly goes in here. I put:
loaders[k].load(new URLRequest(“images/”+items[k].image));
because my images are local in a folder named images. And it still gets errors.
Nevermind my previous post, I figured that one out.
I customizied my carousel to be purely circular without the 3D appearance. I want to create the same effect/movement to the carousel that is seen in this link below.
http://www.flashcomponents.net/uploa…html?full=true
Notice when you move the mouse towards the center of the circle, the photos animate inwards then disperse back out and their scaling gets tweened a bit. I’m looking to add this effect to the carousel. Can anyone give me a breakdown of what code needs to be added in order to get this kinda effect.
My code is pretty much in the same state as the source files posted here except my I have no reflection and the radius to my CarouselItem has been altered to appear like a flat circle (just like the carousel in the link above).
I am fairly new to OOP development, so any help would be much appreciated.
Thanks
How do I animate the x and y position of the entire carousel? I’d like to move it around using something like tweener.
Thanks
Continuing to try and animate the x and y position of the carousel, and tried loading it as an external swf, but I get this error, the carousel is called “index.swf”:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at index$iinit()
Here is my loading code:
var swfContainer:MovieClip;
var swfLoader:Loader = new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
function loaderCompleteHandler(evt:Event):void
{
swfContainer = swfLoader.content as MovieClip;
addChild(swfContainer);
}
swfLoader.load(new URLRequest(“index.swf”));
Any help would hugely appreciated!
Thanks
Halo there,
thanx for the Tutorial. it’s was very helpfully for me. but I have some problem. I have 9 images in my images folder and I’ve changed the attribute name in the icons.xml. If I test the Movie I just can see 3 images. I don’t know why?
I’m very greateful for any help.
rgd
4hmad
When I write this line as:
loader.load(new URLRequest(“icons.xml”));
I get:
Error #2044: Unhandled IOErrorEvent:. Text=Error #2035: URL Not Found.
The icon.sml is in the root folder with the .as and .fla files
Any thougts?
halo,
I’ve try to do this tutorial but with my own images and I’ve this Output error:
Error #2006: The supplied index is out of bounds.
somebody know why?!
thanks 4 help
4hmad
Hi Bob, have you tried to debug you application? Ctrl + Shift + Enter and have breakpoint set. I think this would help you in finding your problem. Is the content attribute in your swfLoader not null?
Lillegutt
Hi Robin the first
Is your flash-application on your local system or on your webserver? I guess your xml-file is icon.xml and not icon.sml, but I guess it would work eventhough. try using the url “http://flash.lillegutt.com/wp-content/uploads/carousel_as3/icons.xml” and see if it works. If it does, there is some issues with where your file is or where your app is pointing to.
Lillegutt
Hi Ahmad,
The error: “Error #2006: The supplied index is out of bounds” states that the index or number you wish to do something with does not allow it or your trying to remove something that is not there. Try looking over your images names and icons.xml to see if you spot an error. If not, give me a bit more information on your problem!
Lillegutt
Halo Lillegutt,
thanks for your tips. every things ok right know. but I’ve some Q. I’ll try to do this: if I click on one of the images I’ll get a big image with more detail in the center of the stage. that’s means I need a new xml file with big images and I have to loaded right? any tips?
thanks for help.
4hmad
Hello Lillegut!
there’s a little issue on URLRequest . If bandwidth fluctuates on the URLRequest or lags even a little, it won’t load correctly and throw an error. what i want is that it skips it first then tries to load it again. is there a way to do that? also can we remove the error message that pop up?
Thanks for your help!
Jun
Hello Lillegut,
I get it. now I’ve a big image if I click on one of the object. I change the scale of the image.
–> currentItem.image.scaleX = 1; wow greate. now I try to get the big images in the mittle of the screen.
for any tips I will be always very thankful.
4hmd
Hola Lillegut,
sorry to bother you but I think the mask in your code don’t really work. I have an image with a hole in the right side. in the mask I see the hole in the left side which is wrong. I can’t fixed it, because I can’t get the bmp value. I have this error:
1119: Access of possibly undefined property bmp through a reference with static type CarouselItem.
can any body help?
thanks
4hmad
Hello,
How would you rotate this carousel around an object?
Thanks,
brysonks
Hi,
great tutorial but I’m really stuck at finding somewhere on the net that will let me do the movement of the carousel via a mouse drag!?!?
Do you have any ideas on how I could possibly so this?
Thanks
I’m guessing this is long since abandoned but, I have removed the mouse actions and instead want to have the carousel pause on each image for 10 seconds, and also the mask doesnt work. I changed the scale back up to 1.0 and put in my own images and now i get no reflection. Any ideas?!
When an icon is clicked i would like it to load an external .swf into an empty movieclip.
I am using the following code but nothing is happening? Am a bit new to as3 so any help will be appreciated.
private function onDown(e:MouseEvent):void
{
var obj:CarouselItem = CarouselItem(e.currentTarget);
currentItem = obj;
var myLoader = new Loader();
myLoader = new Loader ();
SWFLoader.addChild(myLoader);
var requestString:URLRequest = new URLRequest(obj.param);
loaders.load(requestString);
trace(“[CarouselItem] – ” + obj._name + ” pressed”);
}
I have an empty movieclip called ‘SWFLoader’ on my main stage.
Is it possible to have the carousel wait to show up until all the images have loaded? I see you have the same problem as I am experiencing, in that a carousel is generated to hold say 8 images, but it only manages to load the first two. Is there a way to pause to make sure all the image data is loaded, then display the full carousel?
Thanks