I don't know if this is really the place to post this topic, but I have created something thats not a game, but can be useful to games and websites. It is the actionscript 3 version of the 3d carousel based on Lee Brimelow's three part tutorials. I decided to create this for people who want a 3d carousel in their Flash CS3 projects.
Please note that this is my first completed AS3 class and was created within the first few weeks of playing around with Flash CS3, so the code might not be efficient and optimized.
Wow, looks pretty! Would be a great way for me to select ships in my current game, but I would have to reskin it since the slick iphone look would clash heavily with my game.
definately going to bookmark this for when I am doing cleanup and final interface.
Okay, I finally finished a new version of this class [v1.1]
This version contain extra functions to manipulate the icons. The demo is also updated demonstrating how to remove individual items from the carousel.
New Functions:
setIcon(index:Number, itemIcon:String):void
- change the image/swf of an existing item, or convert external image/swf to
MovieClip item or the opposite.
- index: index of item to change
- itemIcon: name of external image/swf or movieclip setFunction(index:Number, itemFunction:String):void
- replace existing mouse down function of an item
- index: index of item to change
- itemFunction: name of new function setTooltip(index:Number, itemTip:String):void
- replace the tooltip of an item
- index: index of item to change
- itemTip: new tooltip
I noticed some errors and I think most of them are fixed.
Hope you enjoy using this class.
PS: Umm, how can I edit my first post?
Last edited by Gamerflash; 08-30-2007 at 01:22 AM.
Reason: Changed the ps.
Checkout my site: Click HERE
Checkout my games:
Oops! No game for now!
Ahoy! Another version of this class with two more useful functions:
addItem(itemName:String, tooltip:String, functions:String):void
- add a new item on the last index
- itemName: the filename or the name of the movieclip (using '.mc' at the end)
- tooltip: tooltip for this item
- functions: mouse down function swapItem(index1:int, index2:int):void
- switch the item with index1 with the item with index2
- index1: item to be switched with
- index2: item to be switched with getSource(index:int):String
- return the source of image/movieclip
- index: index of the item
Once again, the demo is updated to demonstrate two of the three functions.
I want to thank you for the download.
It has been very helpful.
I was trying to convert the code from Lee to AS3 but was bogged
down when it came to switching the depths.
As you know handling depths in AS3 is different than in AS2.
In many ways it's easier, but in others (like in this case) it's
more difficult at least for me.
I'm sure it's because I probably haven't fully grasped the concept
of the best way to use it.
I would like to request if you could place this last download
in the same place you did the original download.
I'm at work and Websense is blocking that last link you gave us.
Ok here's a better link: http://shipwar.freepgs.com/carousel/
Hope nothing block the link above. I can't edit the first post, so the above link will always be updated. I'll also post update in this topic so subscribe if you want to.
Checkout my site: Click HERE
Checkout my games:
Oops! No game for now!
thanks for the reply. That damn tutorial at that site, he names the instance for the reflection wrong. calls for it's name in the AS later on by a different name. I was like WTF!. but finally got it good.
Thank you for your carrousel, it seems very powerfull and usefull !!
However, I have a problem to customize it, if I change the picture size, the icons doesn't appears anymore... I need to put smaller picture of 64x64 instead of 128x128 and it doesn't work.
Thank you Gamerflash for a such great script. I just have a couple of questions tho:
1.- How do I add a URL to the icons?
2.- How could I modify the script to have the carousel turn right or left and stop at the next icon, thus by hitting an arrow key from the keyboard?
Changes:
1.3 - October 15
- changed Carousel function: added container & objectResize
- added getTitle
- ability to auto resize to specific size or image size
- improved depth sorting [thanks Alexander]
- minor optimization
- updated demo to show image resize and minor tune up
- xml format update: added 'title' attribute to help classify the item
Originally Posted by zmove
However, I have a problem to customize it, if I change the picture size, the icons doesn't appears anymore... I need to put smaller picture of 64x64 instead of 128x128 and it doesn't work.
The new version allows you to resize item to either a specified size or its original size:
var c:Carousel = new Carousel(0, 0, 256, 75, this, "items.xml", {resize: true}); // resize items to image size
or
var c:Carousel = new Carousel(0, 0, 256, 75, this, "items.xml", {resize: true, 128, 128}); //resize items to 128x128 pixel EXCEPT movieclip items
Do you mean in the editor or in the carousel tooltips? If its on the tooltip, you need to go to the tooltip movieclip, and select the text object, and click Embed. Then choose Latin1, or you can unselect all to not embed the text.
Originally Posted by razorholt
1.- How do I add a URL to the icons?
2.- How could I modify the script to have the carousel turn right or left and stop at the next icon, thus by hitting an arrow key from the keyboard?
Update to the newest version and...
1. You will need to create another function and assign it...
ie:
function gotoURL(e:MouseEvent):void {
var i = e.currentTarget.parent.parent.title;
navigateToURL("http://domain.com/"+i+".html");
}
and in your xml, make the function attribute to 'gotoURL'
2. I'll include an example later.
Hope I helped some of you. Enjoy!
Checkout my site: Click HERE
Checkout my games:
Oops! No game for now!
To bring more precision on my accent problem, it's in the XML files, character with accent are not showed, I tried to save the file in utf-8 or others, nothing worked.
Edit : I don't know if it's possible because I need to download the new demo of flash CS3 (because I have the CS2 one), but it is possible to always display tooltip, not only on rollover ?
Hey, thanks for sharing and supporting this little widget. I will most definately be using it in early 2008 when I start on my next AS3 project. I am sure I will mod the heck out of it and extend the classes. When I do, I will post the modded version back in this thread for everyone.
I also program Virtools 3D middleware and have a similar interface. What I will do is compare the two and see what features I have and can be brought over into yours. I should be able to look at both and implement new features you may not have thought of.
Thanks again for sharing!
TJ
The Early Bird may get the worm, but the second mouse to the trap gets the cheese...
is there anyone that can share the last version of the carousel_v1.3.zip,
Gamerflash, it seems that you've made an excellent update of the as2 script to as3, but the downloads links are all dead...
I've tried myself to convert to as3, but I'm having a lot of difficulties to do so....