Grid 3D > API
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| xmlPath | String | "" (Empty String) | The location of the XML file. Example: myGrid3D.xmlPath = "files/xml/images.xml"; |
| items | Array | [] | An array of objects, each object containing the source of the content and other additional data. Example: myGrid3D.items = [{source:"images/img0.jpg"}, {source:"images/img1.jpg"}, {source:"images/img2.jpg"}]; |
| itemsArray | Array | [] | An array of strings, each string containing the source of the content. Example: myGrid3D.itemsArray = ["images/img0.jpg", "files/img1.jpg", "images/img2.jpg"]; |
| itemWidth | Number | 150 | The maximum width of each item. Example: myGrid3D.itemWidth = 200; |
| itemHeight | Number | 100 | The maximum height of each item. Example: myGrid3D.itemHeight = 70; |
| scaleMode | String | "exactFit" | The scaling of each item. "exactFit" will resize all items to the maximum width and height. "maintainAspectRatio" will resize the items to the maximum width or height, maintaining the aspect ratio. Example: myGrid3D.scaleMode = "maintainAspectRatio"; |
| currentPosition | Number | 0 | A number between 0 and 1 representing the current position of the grid. Example: myGrid3D.currentPosition = 0.5; |
| currentPositionStrength | Number | 50 | Indicates the strength of the easing when the position of the grid is set using the currentPosition property. Example: myGrid3D.currentPositionStrength = 50; |
| direction | String | "horizontal" | The direction of the grid. Example: myGrid3D.direction = "vertical"; |
| cornerRoundness | Number | 0 | The amount by which the corners of the items will be rounded.
Example: myGrid3D.cornerRoundness = 50; |
| overSkinReference | String | "" | The name of a Class associated to a library symbol that will be displayed on top of each item. This property can be used to create a gloss effect or to add a watermark.
Example: myGrid3D.overSkinReference = "GlossEffect"; |
| layers | uint | 1 | The number of layers represents the number of rows when direction is set to "horizontal" or the number of columns when direction is set to "vertical".
Example: myGrid3D.layers = 4; |
| verticalAlign | String | "middle" | The vertical alignment of each item when the direction is set to "horizontal".
Example: myGrid3D.verticalAlign = "bottom"; |
| horizontalAlign | String | "center" | The horizontal alignment of each item when the direction is set to "vertical".
Example: myGrid3D.horizontalAlign = "left"; |
| horizontalDistance | Number | 10 | The horizontal distance between items.
Example: myGrid3D.horizontalDistance = 25; |
| verticalDistance | Number | 10 | The vertical distance between items.
Example: myGrid3D.verticalDistance = 25; |
| handCursor | Boolean | false | Indicates whether a hand cursor will be displayed when the mouse rolls over an item.
Example: myGrid3D.handCursor = true; |
| smoothing | Boolean | true | Indicates whether the images will be smoothened.
Example: myGrid3D.smoothing = false; |
| interactiveItems | Boolean | false | Indicates whether the items will be interactive. Set this property to true if the items contain objects that need to respond to mouse interaction.
Example: myGrid3D.interactiveItems = true; |
| border | Boolean | false | Indicates whether a border will be added for each item. Example: myGrid3D.border = true; |
| borderColor | uint | 0xFFFFFF | The color of the border.
Example: myGrid3D.borderColor = 0xFF00FF; |
| borderAlpha | Number | 1.0 | The alpha of the border.
Example: myGrid3D.borderAlpha = 0.5; |
| borderThickness | Number | 5 | The thickness of the border.
Example: myGrid3D.borderThickness = 0xFF00FF; |
| preloaderType | String | "bar" | The type of preloader. Values: "bar", "pie", "circular1", "circular2", "circular3" and "none". Example: myGrid3D.preloaderType = "circular2"; |
| preloaderSize | Number | 100 | The width of the preloader if preloaderType is set to "bar" and the radius of the preloader if preloaderType is set to "pie", "circular1", "circular2" or "circular3".
Example: myGrid3D.preloaderSize =15; |
| preloaderFillAlpha | Number | 0.5 | The alpha of the preloader's fill portion.
Example: myGrid3D.preloaderFillAlpha = 0.7; |
| preloaderLineAlpha | Number | 1.0 | The alpha of the preloader's line portion.
Example: myGrid3D.preloaderLineAlpha = 0.2; |
| preloaderFillColor | uint | 0xFFFFFF | The color of the preloader's fill portion.
Example: myGrid3D.preloaderFillColor = 0x0000FF; |
| preloaderLineColor | uint | 0xFFFFFF | The color of the preloader's line portion.
Example: myGrid3D.preloaderLineColor = 0xFF0000; |
| zoomItemPreloaderType | String | "circular1" | The type of preloader. Values:"circular1", "circular2", "circular3" and "none". Example: myGrid3D.zoomItemPreloaderType = "circular2"; |
| zoomItemPreloaderSize | Number | 200 | The radius of the preloader.
Example: myGrid3D.zoomItemPreloaderSize =15; |
| zoomItemPreloaderColor | uint | 0xFFFFFF | The color of the preloader.
Example: myGrid3D.zoomItemPreloaderColor = 0x000000; |
| reflection | Boolean | false | Indicates whether a reflection will be added for the scroller.
Example: myGrid3D.reflection = true; |
| reflectionDistance | Number | 0 | The distance of the reflection from the bottom edge of the item.
Example: myGrid3D.reflectionDistance = 5; |
| reflectionAlpha | Array | [0.7, 0] | An array of two numbers representing the alpha values at the beginning and at the end of the reflection.
Example: myGrid3D.reflectionAlpha = [1.0, 0.0]; |
| reflectionRatio | Array | [0, 127] | An array of two numbers containing the ratio values of the reflection.
Example: myGrid3D.reflectionRatio = [0, 255]; |
| quality | uint | 2 | A number representing the quality of the perspective view for the items. Setting this property to higher values will decrease the performance.
Example: myGrid3D.quality = 1; |
| cameraZoom | Number | 70 | A number representing the zoom value of the 3D Camera.
Example: myGrid3D.cameraZoom = 35; |
| cameraFocus | Number | 10 | A number representing the focus value of the 3D Camera.
Example: myGrid3D.cameraFocus = 15; |
| cameraDepth | Number | -700 | A number representing the position, on the Z axis, of the 3D Camera.
Example: myGrid3D.cameraDepth = -800; |
| cameraAcceleration | Number | 2 | A number representing the acceleration of the 3D Camera when the grid is moving.
Example: myGrid3D.cameraAcceleration = 3; |
| temporaryClipReference | Object | null | The name of a Class associated to a library symbol that will be displayed for each item until the content of the item is loaded. If no value is specified, automatically a rectangle will be used with a specified alpha and color. If you don't want a temporary clip to be displayed at all, simply set the temporaryClipAlpha property to 0.
Example: myGrid3D.temporaryClipReference = "TempClip"; |
| temporaryClipAlpha | Number | 0.5 | The alpha of the temporary clip. This property will be ignored if a reference to a temporary clip is set.
Example: myGrid3D.temporaryClipAlpha = 1.0; |
| temporaryClipColor | uint | 0xCCCCCC | The color of the temporary clip. This property will be ignored if a reference to a temporary clip is set.
Example: myGrid3D.temporaryClipColor = 0x000000; |
| skipBrokenPath | Boolean | false | Indicates whether the component will ignore invalid sources when external content is loaded.
Example: myGrid3D.skipBrokenPath = true; |
| dragScroll | Boolean | false | Indicates whether scrolling the component's items by mouse dragging is activated.
Example: myGrid3D.dragScroll = true; |
| dragScrollSpeed | Number | 30 | The speed of the scrolling when dragScroll is set to true. A higher value indicates a higher speed.
Example: myGrid3D.dragScrollSpeed = 70; |
| dragScrollEasingStrength | Number | 30 | The strength of the easing when dragScroll is set to true. A lower value indicates a stronger easing.
Example: myGrid3D.dragScrollEasingStrength = 70; |
| dragScrollReversed | Boolean | false | Indicates whether the items are scrolling in reversed direction relative to the mouse movement.
Example: myGrid3D.dragScrollReversed = true; |
| selectedItemDepth | Number | 100 | Represents the position, on the Z axis, to which the item will move when it is selected.
Example: myGrid3D.selectedItemDepth = 200; |
| selectedItemDepth | Number | 100 | Represents the position, on the Z axis, to which the item will move when it is selected.
Example: myGrid3D.selectedItemDepth = 200; |
| selectedItemMoveDuration | Number | 1 | Represents the duration of the movement when an item is selected.
Example: myGrid3D.selectedItemMoveDuration = 0.4; |
| selectedItemMoveEasing | String | "exponentialOut" | Represents the easing of the movement when an item is selected.
Example: myGrid3D.selectedItemMoveEasing = "linear"; |
| selectedEasingStrength | Number | 10 | Represents the strength of the easing when an item is selected.
Example: myGrid3D.selectEasingStrength = 20; |
| scrollDuration | Number | 1 | The scroll duration in seconds.
Example: myGrid3D.scrollDuration = 3; |
| scrollAmount | Number | 200 | The amount to scroll when using scrollLeft(), scrollRight(), scrollUp() and scrollDown().
Example: myGrid3D.scrollAmount = 100; |
| scrollEasing | String | "exponentialOut" | The scroll easing.
Example: myGrid3D.scrollEasing = "backOut"; |
| zoomDuration | Number | 1 | The zoom duration in seconds.
Example: myGrid3D.zoomDuration = 3; |
| zoomEasing | String | "exponentialOut" | The zoom easing.
Example: myGrid3D.zoomEasing = "backOut"; |
| autoScroll | Boolean | false | Indicates whether the component's items will be scrolled automatically.
Example: myGrid3D.autoScroll = true; |
| autoScrollDelay | Number | 3 | Indicates the delay of the auto scroll, in seconds.
Example: myGrid3D.autoScrollDelay = 4; |
| autoScrollDirection | String | "next" | Indicates the direction in which the items will be scrolled.
Example: myGrid3D.autoScrollDirection = "previous"; |
| zoomAutoScroll | Boolean | false | Indicates whether the component's items will be zoomed automatically.
Example: myGrid3D.autoZoom = true; |
| zoomAutoScrollDelay | Number | 3 | Indicates the delay of the auto zoom, in seconds.
Example: myGrid3D.autoZoomDelay = 4; |
| zoomAutoScrollDirection | String | "next" | Indicates whether the next item or the previous item will be zoomed.
Example: myGrid3D.autoZoomDirection = "previous"; |
| zoomItemScale | Number | 3 | Indicates how much the items will be scaled when zooming is used.
Example: myGrid3D.zoomItemScale = 2; |
| useSmoothing | Boolean | false | Indicates whether the images will be smoothened during the scrolling process. Leave this property to false for a smoother scrolling. When scrolling is complete, the images will automatically be smoothened.
Example: myGrid3D.useSmoothing = true; |
| usePrecision | Boolean | true | Indicates whether the 3D perspective of the images will be precise during the scrolling process. Set this property to false for a smoother scrolling. If set to false, the images will look a little distorted. When the scrolling is complete, the 3D perspective will automatically become precise.
Example: myGrid3D.usePrecision = false; |
| selectOver | uint | 1 | Indicates over how many items the scrolling will be executed when selectNext() and selectPrevious() methods are used.
Example: myGrid3D.selectOver = 3; |
| zoomOver | uint | 1 | Indicates over how many items the zooming will be executed when zoomNext() and zoomPrevious() methods are used.
Example: myGrid3D.zoomOver = 2; |
| effect | Object | null | An instance of an Effect component.
Example: var greyEffect:GreyEffect = new GreyEffect(); myGrid3D.effect = greyEffect; or myGrid3D.effect = "greyEffect"; |
| videoPlayer | Object | null | An instance of a Grid3D Video Player component.
Example: var vp:Grid3DVideoPlayer = new Grid3DVideoPlayer (); myGrid3D.videoPlayer = vp; |
| livePreviewItems | uint | 10 | The number of items used for the live preview. |
Read-only Properties
| Property | Type | Description |
|---|---|---|
| numItems | uint | Returns the total number of items. Example: trace(myGrid3D.numItems); |
| selectedIndex | int | Returns the index of the selected item. Example: trace(myGrid3D.selectedIndex); |
| zoomIndex | int | Returns the index of the zoomed item. Example: trace(myGrid3D.zoomIndex); |
| zoomState | String | Returns "in" if the items are zoomed in. Else it returns "out". Example: trace(myGrid3D.zoomState); |
| isScrolling | Boolean | Indicates whether the component is currently scrolling. Example: trace(myGrid3D.isScrolling); |
| camera | Camera3D | A reference to the instance of the Camera3D class. Using this reference to the Camera3D instance you can manipulate the position of the camera, zoom, focus and other properties. Example: myGrid3D.camera.zoom = 100; myGrid3D.camera.focus = 30; |
Methods
| Method | Implementation | Description |
|---|---|---|
| addItem() | addItem(data:Object):void | Adds a new item at the end of the component. Example: myGrid3D.addItem({source:"images/image1.jpg", title:"Flower", description:"Image description"}); |
| addItemAt() | addItemAt(data:Object, index:uint):void | Adds a new item at the specified index. Example: myGrid3D.addItemAt({source:"images/image1.jpg", title:"Flower", description:"Image description"}, 3); |
| addItems() | addItems(items:Array):void | Adds an array of items to the end of the component. Example: var myItems:Array = [{source:"images/image0.jpg"}, {source:"images/image1.jpg",title:"Bird"}, {source:"images/image2.jpg",title:"Sky"}, {source:"images/image3.jpg"}]; myGrid3D.addItems(myItems); |
| addItemsAt() | addItems(items:Array, index:uint):void | Adds an array of items at the specified index. Example: var myItems:Array = [{source:"images/image0.jpg"}, {source:"images/image1.jpg",title:"Bird"}, {source:"images/image2.jpg",title:"Sky"}, {source:"images/image3.jpg"}]; myGrid3D.addItems(myItems, 5); |
| removeItem() | removeItem(item:IDisplayItem):void | Removes the specified item. Example: myGrid3D.removeItem(myGrid3D.getItemAt(4)); |
| removeItemAt() | removeItemAt(index:uint):void | Removes the item at the specified index. Example: myGrid3D.removeItemAt(1); |
| removeItemsAt() | removeItemsAt(startIndex:uint, removeCount:uint) | Removes a specified number of items starting at a specified index. Example: myGrid3D.removeItemsAt(0, 3); |
| removeAllItems() | removeAllItems():void | Removes all items. Example: myGrid3D.removeAllItems(); |
| replaceItem() | replaceItem(data:Object, item:IDisplayItem) | Replace an existing item with a new item. Example: var data:Object = {source:"images/image1.jpg", desc:"Bird"}; myGrid3D.replaceItem(data, myGrid3D.getItemAt(5)); |
| replaceItemAt() | replaceItemAt(data:Object, index:uint) | Replace an existing item at a specified index with a new item. Example: var data:Object = {source:"images/image1.jpg", desc:"Bird"}; myGrid3D.replaceItem(data, 2); |
| spliceItems() | spliceItems(startIndex:uint, removeCount:uint, items:Array = null):void | Removes a specified number of items, starting at a specified index and adds an array of items at the specified index. Example: var newItems:Array = [{source:"images/image0.jpg"}, {source:"images/image1.jpg",title:"Bird"}, {source:"images/image2.jpg",title:"Sky"}, {source:"images/image3.jpg"}]; myGrid3D.spliceItems(0, 3, newItems); |
| getItemAt() | getItemAt(index:uint):IDisplayItem | Returns the item at the specified index. Example: trace(myGrid3D.getItemAt(2).index);// output 2 |
| getItemIndex() | getItemIndex(item:IDisplayItem):int | Returns the index of the specified item. Example: var nr:int = myGrid3D.getItemIndex(myGrid3D.getItemAt(7)); trace(nr); // output 7 |
| select() | select(index:uint):void | Selects the item at the specified index. Example: myGrid3D.select(5); |
| deselect() | deselect(index:uint):void | Deselects the item at the specified index. Example: myGrid3D.deselect(myGrid3D.selectedIndex); |
| selectNext() | selectNext():void | Selects the next item. Example: myGrid3D.selectNext(); |
| selectPrevious() | selectPrevious():void | Selects the previous item. Example: myGrid3D.selectPrevious(); |
| scrollRight() | scrollRight():void | Scrolls the component to the right by a certain amount, given by the scrollAmount property. Example: myGrid3D.scrollRight(); |
| scrollLeft() | scrollLeft():void | Scrolls the component to the left by a certain amount, given by the scrollAmount property. Example: myGrid3D.scrollLeft(); |
| scrollUp() | scrollUp():void | Scrolls the component to the top by a certain amount, given by the scrollAmount property. Example: myGrid3D.scrollUp(); |
| scrollDown() | scrollDown():void | Scrolls the component to the bottom by a certain amount, given by the scrollAmount property. Example: myGrid3D.scrollDown(); |
| zoom() | zoom(index:uint):void | Zooms to the item at the specified index. Example: myGrid3D.zoom(5); |
| zoomOut() | zoomOut():void | Zooms out the grid. Example: myGrid3D.zoomOut(); |
| zoomNext() | zoomNext():void | Zooms to the next item. Example: myGrid3D.zoomNext(); |
| zoomPrevious() | zoomPrevious():void | Zooms to the previous item. Example: myGrid3D.zoomPrevious(); |
| setSize() | setSize(width:Number, height:Number):void | Sets the component's size at the specified width and height. Example: myGrid3D.setSize(700, 500); |
| move() | move(x:Number, y:Number):void | Moves the component at the specified position. Example: myGrid3D.move(100, 100); |
Events
| Event type | Description |
|---|---|
| ITEMS_LOAD_START | Dispatched when the loading of a group of items begins.
Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEMS_LOAD_START, eventHandler) function eventHandler(event:Grid3DEvent):void { trace("loading begins"); } |
| ITEMS_LOAD_PROGRESS | Dispatched every time an items was loaded, during the loading of a group of items. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEMS_LOAD_PROGRESS,eventHandler) function eventHandler(event:Grid3DEvent):void { trace("Loaded " + event.itemsLoaded + " out of " + event.itemsTotal); } |
| ITEMS_LOAD_COMPLETE | Dispatched when the loading of a group of items is complete. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEMS_LOAD_COMPLETE,eventHandler) function eventHandler(event:Grid3DEvent):void { trace("loading complete"); } |
| XML_LOAD_START | Dispatched when the loading of the XML file begins. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.XML_LOAD_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("XML loading begins"); } |
| XML_LOAD_PROGRESS | Dispatched during the loading of the XML file. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.XML_LOAD_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Loaded " + event.bytesLoaded + " out of " + event.bytesTotal); } |
| XML_LOAD_COMPLETE | Dispatched when the loading of an XML file is complete. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.XML_LOAD_COMPLETE,eventHandler) function eventHandler(event:Grid3DEvent):void { trace("XML file loaded"); } |
| ITEM_ADD | Dispatched when a new item was added. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_ADD, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); // output 3 trace(event.data); // output ,source:"images/image1.jpg", title:"Flower", desc:"Sun flower" trace(event.data.title); // output "Flower" } myGrid3D.addItemAt({source:"images/image1.jpg", title:"Flower", desc:"Sun flower"}, 3); |
| ITEM_REMOVE | Dispatched when an item was removed. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_REMOVE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); // output 1 } myGrid3D.removeItemAt(1); |
| ITEM_CLICK | Dispatched when an item was clicked. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ITEM_DOUBLE_CLICK | Dispatched when an item was double-clicked. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_DOUBLE_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.data); } |
| ITEM_MOUSE_UP | Dispatched when the mouse is released over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_MOUSE_UP, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ITEM_MOUSE_DOWN | Dispatched when the mouse is pressed over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_MOUSE_DOWN, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ITEM_MOUSE_OVER | Dispatched when the mouse pointer is moved over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_MOUSE_OVER, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ITEM_MOUSE_OUT | Dispatched when the mouse pointer is moved away from an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_MOUSE_OUT, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ITEM_START | Dispatched when the content of an item begins to load. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " has started loading"); } |
| ITEM_PROGRESS | Dispatched during the loading of an item's content. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Loaded " + event.bytesLoaded + " out of " +event.bytesTotal); } |
| ITEM_COMPLETE | Dispatched when the content of an item is completely loaded. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_COMPLETE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " has finished loading"); } |
| ITEM_ERROR | Dispatched when an error has occurred during the loading process. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_ERROR, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " could not be loaded"); } |
| ITEM_SELECTED | Dispatched when an item was selected. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_SELECTED, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Index of the selected item: " + event.index); } |
| ITEM_DESELECTED | Dispatched when an item was deselected. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ITEM_DESELECTED, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Index of the deselected item: " + event.index); } |
| ZOOM_ITEM_CLICK | Dispatched when an item was clicked. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ZOOM_ITEM_DOUBLE_CLICK | Dispatched when an item was double-clicked. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_DOUBLE_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.data); } |
| ZOOM_ITEM_MOUSE_UP | Dispatched when the mouse is released over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_MOUSE_UP, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ZOOM_ITEM_MOUSE_DOWN | Dispatched when the mouse is pressed over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_MOUSE_DOWN, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ZOOM_ITEM_MOUSE_OVER | Dispatched when the mouse pointer is moved over an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_MOUSE_OVER, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ZOOM_ITEM_MOUSE_OUT | Dispatched when the mouse pointer is moved away from an item. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_MOUSE_OUT, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| ZOOM_ITEM_START | Dispatched when the content of an item begins to load. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " has started loading"); } |
| ZOOM_ITEM_PROGRESS | Dispatched during the loading of an item's content. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Loaded " + event.bytesLoaded + " out of " +event.bytesTotal); } |
| ZOOM_ITEM_COMPLETE | Dispatched when the content of an item is completely loaded. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_COMPLETE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " has finished loading"); } |
| ZOOM_ITEM_ERROR | Dispatched when an error has occurred during the loading process. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_ITEM_ERROR, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Item at index: " + event.index + " could not be loaded"); } |
| UPDATE | Dispatched after the component was updated because a property changed or an item was added or removed. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.UPDATE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("Something changed!"); } |
| SCROLL_START | Dispatched when the scrolling starts. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.SCROLL_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("scroll started"); } |
| SCROLL_PROGRESS | Dispatched during the scrolling process. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.SCROLL_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("is scrolling"); } |
| SCROLL_COMPLETE | Dispatched when the scrolling is finished. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.SCROLL_COMPLETE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("scroll complete"); } |
| ZOOM_START | Dispatched when the zooming starts. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("zoom started"); } |
| ZOOM_PROGRESS | Dispatched during the zooming process. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("is zooming"); } |
| ZOOM_COMPLETE | Dispatched when the zooming is finished. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_COMPLETE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("zoom complete"); } |
| ZOOM_OUT_START | Dispatched when the zooming out starts. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_OUT_START, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("zoom out started"); } |
| ZOOM_OUT_PROGRESS | Dispatched during the zooming out process. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_OUT_PROGRESS, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("is zooming out"); } |
| ZOOM_OUT_COMPLETE | Dispatched when the zooming out is finished. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.ZOOM_OUT_COMPLETE, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("zoom out complete"); } |
| DISPLAY_ZOOM_ITEM | Dispatched when the zoomed item is displayed. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.DISPLAY_ZOOM_ITEM, eventHandler); function eventHandler(event:Grid3DEvent):void { trace(event.index); } |
| OUTSIDE_CLICK | Dispatched when the user clicks outside the component's items. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.OUTSIDE_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("outside click"); } |
| OUTSIDE_DOUBLE_CLICK | Dispatched when the user double-clicks outside the component's items. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.OUTSIDE_DOUBLE_CLICK, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("outside double click"); } |
| OUTSIDE_MOUSE_DOWN | Dispatched when the mouse is released outside the component's items. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.OUTSIDE_MOUSE_DOWN, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("outside mouse down"); } |
| OUTSIDE_MOUSE_UP | Dispatched when the mouse is pressed outside the component's items. Example: import com.flashotaku.events.Grid3DEvent; myGrid3D.addEventListener(Grid3DEvent.OUTSIDE_MOUSE_UP, eventHandler); function eventHandler(event:Grid3DEvent):void { trace("outside mouse up"); } |
Grid3D Video Player
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| scaleMode | String | "exactFit" | The scaling of the video. "exactFit" will resize the video to the maximum width and height. "maintainAspectRatio" will resize the video to the maximum width or height, maintaining the aspect ratio. "noScale" will ignore the maximum width and height, maintaining the video at the original dimensions. Example: myGrid3DVideoPlayer.scaleMode = "maintainAspectRatio"; |
| autoPlay | Boolean | false | Indicates whether the video will play imediatelly after the transition of the slide is complete. Example: myGrid3DVideoPlayer.autoPlay = true; |
| autoReplay | Boolean | false | Indicates whether the video will be replayed after reaching the end. Example: myGrid3DVideoPlayer.autoReplay = true; |
| fadeControls | Boolean | true | Indicates whether the player controls will fade out. Example: myGrid3DVideoPlayer.fadeControls = true; |
| fadeInDuration | Number | 0.5 | The duration of the fade in. Example: myGrid3DVideoPlayer.fadeInDuration = 1; |
| fadeOutDuration | Number | 1 | The duration of the fade out. Example: myGrid3DVideoPlayer.fadeOutDuration = 2; |
| fadeOutDelay | Number | 1 | The delay of the fade out. Example: myGrid3DVideoPlayer.fadeOutDelay = 2; |
| initialFadeOutDelay | Number | 3 | The delay of the initial fade out. Example: myGrid3DVideoPlayer.initialFadeOutDelay = 2; |
| playButtonAlpha | Number | 0.8 | The alpha of the initial play button. Example: myGrid3DVideoPlayer.playButtonAlpha = 0.3; |
| smoothing | Boolean | false | Indicates whether the videos will be smoothened. Example: myGrid3DVideoPlayer.smoothing = true; |
| marginBottom | Number | 10 | The bottom margin of the player controls. Example: myGrid3DVideoPlayer.marginBottom = 20; |
| marginLeft | Number | 10 | The left margin of the player controls. Example: myGrid3DVideoPlayer.marginLeft = 20; |
| marginBottom | Number | 10 | The right margin of the player controls. Example: myGrid3DVideoPlayer.marginRight = 20; |
| reflection | Boolean | false | Indicates whether video reflection will be displayed. Example: myGrid3DVideoPlayer.reflection = true; |
| reflectionAlpha | Array | [0.7, 0] | An array indicating the transparency of the reflection at its top and at its bottom. Example: myGrid3DVideoPlayer.reflectionAlpha = [1, 0]; |
| reflectionRatio | Array | [0, 127] | An array indicating the ratio of the reflection. Example: myGrid3DVideoPlayer.reflectionRatio = [0, 255]; |
| volume | Number | 0.5 | A number between 0 and 1 representing the volume of the video. Example: myGrid3DVideoPlayer.volume = 0.4; |
Read-only Properties
| Property | Type | Description |
|---|---|---|
| duration | Number | Returns the duration of the video, in seconds. Example: trace(myGrid3DVideoPlayer.duration); |
| time | Number | Returns the current time of the video, in seconds. Example: trace(myGrid3DVideoPlayer.time); |
Methods
| Method | Implementation | Description |
|---|---|---|
| resume() | resume():void | Resumes the currently playing video. Example: myGrid3DVideoPlayer.resume(); |
| stop() | stop():void | Stops the currently playing video. Example: myGrid3DVideoPlayer.stop(); |
| pause() | pause():void | Pauses the currently playing video. Example: myGrid3DVideoPlayer.pause(); |
| seek() | seek(value:Number):void | Seeks the currently playing video to the specified time value. Example: myGrid3DVideoPlayer.seek(100); |
| close() | close():void | Closes the currently playing video. Example: myGrid3DVideoPlayer.close(); |
Events
| Event type | Description |
|---|---|
| VIDEO_CLICK | Dispatched when a video was clicked.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_CLICK, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_DOUBLE_CLICK | Dispatched when a video was double-clicked.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_DOUBLE_CLICK, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_MOUSE_UP | Dispatched when the mouse is released over a video.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_MOUSE_UP, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_MOUSE_DOWN | Dispatched when the mouse is pressed over a video.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_MOUSE_DOWN, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_MOUSE_UP | Dispatched when the mouse is released over a video.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_MOUSE_DOWN, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_MOUSE_OVER | Dispatched when the mouse pointer is moved over a video.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_MOUSE_OVER, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| VIDEO_MOUSE_OUT | Dispatched when the mouse pointer is moved away from a video.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.VIDEO_MOUSE_OUT, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| BEGIN | Dispatched when the initial play button was clicked.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.BEGIN, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| CLOSE | Dispatched when the video player is closed, after the user moved to a new slide or after the close() method was called.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.CLOSE, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| START | Dispatched when the playback initially starts to play.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.START, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| STOP | Dispatched when the stop button is pressed or when the playback is complete.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.STOP, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| PAUSE | Dispatched when the video is paused.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.PAUSE, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| RESUME | Dispatched when the playback is resumed.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.RESUME, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |
| COMPLETE | Dispatched when the playback is complete.
Example: import com.flashotaku.events.Grid3DVideoPlayerEvent; myGrid3DVideoPlayer.addEventListener(Grid3DVideoPlayerEvent.COMPLETE, eventHandler); function eventHandler(event:Grid3DVideoPlayerEvent):void { trace(event.type); } |






