3D Carousel (AS 3.0) V. 1.4 Documentation
Properties
| Name | Type | Description |
| animationStyle | Object | Defines how items should animate. Options
Example: myCarousel.animationStyle = {easing:"easeOut", enabled:true, duration:1500, type:"Strong"} |
| carouselStyle | Object | Property defines image size. Please note that width and height parameters override maintainAspectRatio and scaleContent properties. 1. direction:String 2. distance:Number 3. radius:Number 4. rotationX:Number 5. rotationZ:Number 6. type:String Example: myCarousel.carouselStyle = {direction:auto, distance:100, radius:100, rotationX:0, rotationZ:0, type:outside}; |
| content | Collection | Sets component's content. Options: 1. path:String – content path (external image, external swf, display object etc) 2. description:String 3. data:String – misc. data 4. type:String – similar to tooltip (image, instance, etc) Example: import fl.data.DataProvider; import com.afcomponents.events.CarouselEvent; function onCarouselInit(event:Event) { var dp:DataProvider = new DataProvider(); dp.addItem({path:"pic.jpg", type:"image", description:"text description", data:"http://www.url.com"}); myCarousel.content = dp; } myCarousel.addEventListener(CarouselEvent.INITIALIZE, onCarouselInit); |
| contentXML | String | Path to content XML file or RSS 2.0 image feed. XML Sample File http://www.afcomponents.com/components/3d_carousel_as3/content.xml RSS Feed Sample http://api.flickr.com/services/feeds/geo/?id=84716639@N00&lang=en-us&format=rss_200 XML File Format <content> myCarousel.contentXML = "file.xml"; |
| displayStyle | Object | Property defines display item scale parameters. Options 1. autoSize:Boolean 2. maintainAspectRatio:Boolean 3. scaleContent:Boolean Example myCarousel.displayStyle = {autoSize:false, maintainAspectRatio:true, scaleContent:true}; |
| slideShowStyle | Object | Defines slide show settings. Options 1. enabled:Boolean 2. loop:Boolean 3. time:Number Example: myCarousel.slideShowStyle = {enabled:true, loop:true, time:2000}; |
| itemDefaultStyle | Object | Defines the default container style for each item. Options 1. cornerRadius:Number 2. fill:Boolean 3. fillAlpha:Number 4. fillColor:Number 5. stroke:Boolean 6. strokeAlpha:Number 7. strokeColor:Number 8. strokeWidth:Number 9. horizontalPadding:Number 10. verticalPadding:Number Example myCarousel.itemDefaultStyle = {cornerRadius:10, fill:false, fillAlpha:1, fillColor:0x000000, stroke:false, strokeAlpha:1, strokeColor:0x000000, strokeWidth:1, horizontalPadding:0, verticalPadding:0}; |
| itemOverStyle | Object | Defines the over container style for each item. Options 1. cornerRadius:Number 2. fill:Boolean 3. fillAlpha:Number 4. fillColor:Number 5. stroke:Boolean 6. strokeAlpha:Number 7. strokeColor:Number 8. strokeWidth:Number 9. horizontalPadding:Number 10. verticalPadding:Number Example myCarousel.itemOverStyle = {cornerRadius:7, fill:false, fillAlpha:1, fillColor:0x000000,stroke:true,strokeAlpha:1, strokeColor:0xFF0000, strokeWidth:1, horizontalPadding:0, verticalPadding:0}; |
| itemSelectedStyle | Object | Defines the selected container style for each item. Note: itemOverStyle should be disabled for the selected item. Options 1. cornerRadius:Number 2. fill:Boolean 3. fillAlpha:Number 4. fillColor:Number 5. stroke:Boolean 6. strokeAlpha:Number 7. strokeColor:Number 8. strokeWidth:Number 9. horizontalPadding:Number 10. verticalPadding:Number Example myCarousel.itemSelectedStyle = {cornerRadius:7, fill:false, fillAlpha:1, fillColor:0x000000, stroke:false, strokeAlpha:1, strokeColor:0x000000, strokeWidth:1, horizontalPadding:0, verticalPadding:0}; |
| previewClip | Object | Property defines a movie clip which is displayed before items are loaded. Movie clip's class reference should be specified. Example myCarousel.previewClip = MyClip; |
| reflectionStyle | Object | Defines reflection settings. Options 1. enabled:Boolean 2. alpha:Number 3. clipAlpha:Number 4. distance:Number 5. matrixRatio:Number 6. matrixDropOff:Number Example myCarousel.reflectionStyle = {enabled:true, alpha:0.5, clipAlpha:0.5, distance:0, matrixRatio:1, matrixDropOff:1.2}; |
| Camera 3D | Object | See Papervision3D documentation. Example import org.papervision3d.objects.*; // position for the camera to look at var zero:DisplayObject3D = DisplayObject3D.ZERO; myCarousel.scene3D.addChild(zero); // camera settings myCarousel.camera3D.x = 125; myCarousel.camera3D.y = -110; myCarousel.camera3D.zoom = 3; // update view for user based on settings myCarousel.camera3D.lookAt(zero); |
Methods
| Name | Return Type | Description |
| getItemAt( item ) | Object | Returns content item object specified by Number attribute. Example myCarousel.getItemAt(3); |
| getSelectedItem( ) | Object | Returns selected item object. Example var item:Object = new Object(); item = myCarousel.getSelectedItem(); trace(item.description); trace(item.path); trace(item.data); } |
| getSelectedIndex( ) | Number | Returns selected item index Example myCarousel.getSelectedIndex(); |
| getItemIndex( item ) | Number | Returns static item index. Example myCarousel.getItemIndex(myCarousel.getSelectedItem()); |
| selectItem( item ) | Void | Selects the item. Example myCarousel.selectItem(myCarousel.getItemAt(3)); |
| selectItemAt( item ) | Void | Selects an item specified by a id attribute. Example myCarousel.selectItemAt(3); |
| selectNextItem( ) | Void | Selects next item. Example myCarousel.selectNextItem(); |
| selectPreviousItem( ) | Void | Selects previous item. Example myCarousel.selectPreviousItem(); |
| addItem( item ) | Void | Adds an item to component. Example myCarousel.addItem({description:"description", path:"pic.jpg", data:"url.html", type:"image"}); |
| addItemAt( item,index ) | Void | Adds an item to the indicated index. Example var itemToAdd:Object ={description:"description", path:"pic.jpg", data:"url.html", type:"image"}; myCarouseladdItemAt(itemToAdd,1); |
| removeItem( item ) | Void | Removes a item. Example myCarousel.removeItem(myCarousel.getItemAt(3)); |
| removeAll( ) | Void | Removes all items. Example myCarousel.removeAll(); |
| addItemEventListener( item,eventlistener ) | Void | Adds an event to the indicated item by index. Example import flash.events.MouseEvent; import com.afcomponents.events.CarouselEvent; function contentLoad (event:Event) { for (var i:Number = 0; i<=myCarousel.length-1; i++) { myCarousel.addItemEventListener (i, MouseEvent.CLICK, itemClick); } } myCarousel.addEventListener(CarouselEvent.CONTENT_LOAD_START, contentLoad); |
Events
| Name | Return Value | Description |
| INITIALIZE | target type |
Triggered after component initializes. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.INITIALIZE, eventHandler); |
| ERROR | target type message |
Triggered once error occurs. If there is an error loading an image this event fired. If a wrong parameter is passed to a function this event is fired. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); trace(event.message); } myCarousel.addEventListener(CarouselEvent.ERROR, eventHandler); |
| CHANGE | target type |
Triggered once any of the component properties is modified or component state changes. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.CHANGE, eventHandler); |
| XML_LOAD_START | target type |
Triggered when XML loading starts. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.XML_LOAD_START, eventHandler); |
| XML_LOAD_PROGRESS | type target bytesLoaded bytesTotal |
Triggered during XML loading to track progress. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.XML_LOAD_PROGRESS, eventHandler); |
| XML_LOAD_COMPLETE | target type |
Triggered when XML loading is finished. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.XML_LOAD_COMPLETE, eventHandler); |
| ITEM_LOAD_START | target type |
Triggered for each item when it starts loading. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.ITEM_LOAD_START, eventHandler); |
| ITEM_LOAD_PROGRESS | type target bytesLoaded bytesTotal |
Triggered for each item during loading to track progress. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.ITEM_LOAD_PROGRESS, eventHandler); |
| ITEM_LOAD_COMPLETE | target type |
Triggered for each item when loading is finished. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.ITEM_LOAD_COMPLETE, eventHandler); |
| CONTENT_LOAD_START | target type |
Triggered when content loading starts. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.CONTENT_LOAD_START, eventHandler); |
| CONTENT_LOAD_PROGRESS | type target itemsLoaded itemsTotal |
Triggered during content loading to track progress. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.CONTENT_LOAD_PROGRESS, eventHandler); |
| CONTENT_LOAD_COMPLETE | target type |
Triggered when content loading is finished. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); } myCarousel.addEventListener(CarouselEvent.CONTENT_LOAD_COMPLETE, eventHandler); |
| ITEM_SELECTED | target type |
Triggered once the item is selected. This event is triggered during the during the slide show mode. Example import com.afcomponents.events.CarouselEvent; function eventHandler(event:Event){ trace(event.type); trace(event.target); //selected item } myCarousel.addEventListener(CarouselEvent.ITEM_SELECTED, eventHandler); |
