| Package | lunas.containers |
| Class | public class AutoScrollContainer |
| Inheritance | AutoScrollContainer ScrollContainer ListContainer Container CoreComponent Background CoreSprite flash.display.Sprite |
Example :
import flash.display.StageScaleMode ;
import graphics.Direction;
import lunas.containers.AutoScrollContainer ;
import lunas.events.ComponentEvent ;
var onScroll:Function = function( e:ComponentEvent ):void
{
trace( container.scroll + " / " + container.maxscroll ) ;
}
var container:AutoScrollContainer = new AutoScrollContainer() ;
container.addEventListener( ComponentEvent.SCROLL , onScroll ) ;
container.direction = Direction.HORIZONTAL ;
container.x = 25 ;
container.y = 25 ;
container.space = 10 ;
container.childCount = 8 ;
//container.useScrollRect = true ;
addChild( container ) ;
var s:Sprite ;
for (var i:uint ; i < 20 ; i++ )
{
s = new Sprite() ;
s.graphics.beginFill( Math.random() * 0xFFFFFF ) ;
s.graphics.drawRect( 0, 0, 30, 30) ;
s.buttonMode = true ;
container.addChild( s ) ;
}
var keyDown:Function = function( e:KeyboardEvent ):void
{
var code:uint = e.keyCode ;
switch( code )
{
case Keyboard.LEFT :
{
container.scroll -- ;
break ;
}
case Keyboard.RIGHT :
{
container.scroll ++ ;
break ;
}
case Keyboard.SPACE :
{
container.direction = ( container.direction == Direction.HORIZONTAL ) ? Direction.VERTICAL : Direction.HORIZONTAL ;
break ;
}
case Keyboard.UP :
{
container.fixScroll = !container.fixScroll ;
break ;
}
case Keyboard.DOWN :
{
container.autoScroll = !container.autoScroll ;
break ;
}
}
}
stage.scaleMode = StageScaleMode.NO_SCALE ;
stage.addEventListener( KeyboardEvent.KEY_DOWN , keyDown ) ;
| Property | Defined By | ||
|---|---|---|---|
![]() | align : uint
The alignement of the background. | Background | |
![]() | area : Sprite [read-only]
Returns the area reference of this component. | ListContainer | |
![]() | areaPen : IPen [read-only]
Indicates the area Pen reference of this component. | ListContainer | |
| autoScroll : Boolean
Determinates the auto scroll activity. | AutoScrollContainer | ||
![]() | autoSize : Boolean
Indicates if the background is resizing when the stage resize event is invoked. | Background | |
![]() | background : Sprite [read-only]
Indicates the background reference of this component. | ListContainer | |
![]() | backgroundPen : IPen [read-only]
Indicates the background Pen reference of this component. | ListContainer | |
![]() | border : EdgeMetrics
Indicates the thickness, in pixels, of the four edge regions around a visual component. | CoreComponent | |
![]() | bottomLeftRadius : Number
The radius of the bottom-left corner, in pixels. | Background | |
![]() | bottomRightRadius : Number
The radius of the bottom-right corner, in pixels. | Background | |
![]() | bottomScroll : Number [read-only]
Determinates the bottom scroll value. | ScrollContainer | |
![]() | bubbles : Boolean = true
Indicates if the events use bubbling when are dispatched. | CoreComponent | |
![]() | builder : Builder
Indicates the Builder reference of this instance. | CoreComponent | |
![]() | childCount : int
Determinates the number of childs in this container. | ListContainer | |
![]() | componentInspectorSetting : Boolean
Initialize when the Flash component settings are initialized (only in Flash with a compiled component). | CoreComponent | |
![]() | direction : String
Indicates the direction value of the background when the display is in this "full" mode (default value is null). | Background | |
![]() | enabled : Boolean
Indicates the enabled state of the component. | CoreComponent | |
![]() | fill : IFillStyle
Determinates the IFillStyle reference of this display. | Background | |
![]() | fixScroll : Boolean
Indicates if the scroll is fixed. | ScrollContainer | |
![]() | gradientMatrix : Matrix
The matrix value to draw the gradient fill. | Background | |
![]() | gradientRotation : Number = 0
The rotation value to draw the gradient fill. | Background | |
![]() | gradientTranslation : Point
The translation vector to draw the gradient fill. | Background | |
![]() | group : Boolean
Indicates with a boolean if this object is grouped. | CoreComponent | |
![]() | groupName : String
Indicates the name of the group of this object. | CoreComponent | |
![]() | h : Number
Determinates the virtual height value of this component. | Background | |
![]() | invert : Boolean
Inverts the z-depth of the childs in the container. | Container | |
![]() | isFull : Boolean
Indicates if the background use full size (use Stage.stageWidth and Stage.stageHeight to resize the background). | Background | |
![]() | layout : Layout
Determinates the layout of this container. | CoreComponent | |
![]() | line : ILineStyle
Determinates the ILineStyle reference of this display. | Background | |
![]() | logger : Logger
Determinates the internal ILogger reference of this Logable object. | CoreSprite | |
![]() | maskIsActive : Boolean
Indicates if the mask is active or not over this container. | ListContainer | |
![]() | maskView : Sprite [read-only]
Determinates the mask reference of this container. | ListContainer | |
![]() | maxHeight : Number
This property defined the maximum height of this display. | Background | |
![]() | maxscroll : Number [read-only]
Returns the maxscroll value. | ScrollContainer | |
![]() | maxWidth : Number
Defines the maximum width of this display. | Background | |
![]() | minHeight : Number
This property defined the mimimun height of this display (This value is >= 0). | Background | |
![]() | minWidth : Number
This property defined the mimimun width of this display (This value is >= 0). | Background | |
![]() | noScrollEasing : Boolean
Indicates if the scroll use an easing effect. | ScrollContainer | |
![]() | numChildren : int [override] [read-only]
Determinates the number of children of this object. | Container | |
![]() | propHeight : String = height
The height property name use in the container to layout all items. | ListContainer | |
| propMouseX : String = mouseX
The mouse x property name. | AutoScrollContainer | ||
| propMouseY : String = mouseY
The mouse y property name. | AutoScrollContainer | ||
![]() | propWidth : String = width
The width property name use in the container to layout all items. | ListContainer | |
![]() | propX : String = x
The x property name use in the container to layout all items. | ListContainer | |
![]() | propY : String = y
The y property name use in the container to layout all items. | ListContainer | |
![]() | rectangle : Rectangle [read-only]
Returns the internal Rectangle object of this display. | ListContainer | |
![]() | scroll : Number
Returns the scroll value of this container. | ScrollContainer | |
| scrollAutoRatio : Number = 15
Defines a value between 0 and 50%. | AutoScrollContainer | ||
![]() | scrollDuration : Number = 12
Indicates the scroll duration. | ScrollContainer | |
![]() | scrollEasing : Function
Indicates the scroll easing method. | ScrollContainer | |
| scrollInterval : Number
Determinates the delay in ms to refresh the scroll value. | AutoScrollContainer | ||
![]() | space : Number
Indicates the space value (in pixel) between 2 childs in the list. | ListContainer | |
![]() | spaceH : Number
Indicates the space value (in pixel) between 2 childs in the list when the direction is horizontal. | ListContainer | |
![]() | spaceV : Number
Indicates the space value (in pixel) between 2 childs in the list when the direction is vertical. | ListContainer | |
![]() | style : Style
Returns the style of this component. | CoreComponent | |
![]() | topLeftRadius : Number
The radius of the upper-left corner, in pixels. | Background | |
![]() | topRightRadius : Number
The radius of the upper-right corner, in pixels. | Background | |
![]() | useCacheAsBitmap : Boolean
Indicates if the container use cacheAsBitmap flag when the scroll is in progress. | ScrollContainer | |
![]() | useGradientBox : Boolean
Indicates if the IFillStyle of this display use gradient box matrix (only if the IFillStyle is a FillGradientStyle). | Background | |
![]() | useScrollRect : Boolean
Indicates if this container use a scrollRect reference to mask the content. | ListContainer | |
![]() | w : Number
Determinates the virtual height value of this component. | Background | |
| Method | Defined By | ||
|---|---|---|---|
AutoScrollContainer(direction:String = vertical, id:* = null, isFull:Boolean = false, name:String = null)
Creates a new AutoScrollContainer instance. | AutoScrollContainer | ||
![]() | addChild(child:DisplayObject):DisplayObject [override]
Adds a child DisplayObject instance to this DisplayObjectContainer instance. | ScrollContainer | |
![]() | addChildAt(child:DisplayObject, index:int):DisplayObject [override]
Adds a child DisplayObject instance to this DisplayObjectContainer instance. | ScrollContainer | |
![]() | areInaccessibleObjectsUnderPoint(point:Point):Boolean [override]
Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point. | Container | |
![]() | changeChildsPosition():void
Refreshs and changes the child position of all childs in the container. | ListContainer | |
![]() | clear():void
Removes all childs in the container. | Container | |
![]() | contains(child:DisplayObject):Boolean [override]
Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. | Container | |
![]() | containsAt(index:int):Boolean
Returns true if a child exist in the display list at the specified index value. | Container | |
![]() | doLater():void
Launch an event with a delayed interval. | Background | |
draw(... arguments):void [override]
Draws the view of the component. | AutoScrollContainer | ||
![]() | getBuilderRenderer():Class
Returns the Builder constructor use to initialize this component. | CoreComponent | |
![]() | getChildAt(index:int):DisplayObject [override]
Returns the child display object instance that exists at the specified index. | Container | |
![]() | getChildByName(name:String):DisplayObject [override]
Returns the child display object that exists with the specified name. | Container | |
![]() | getChildIndex(child:DisplayObject):int [override]
Returns the index position of a child DisplayObject instance. | Container | |
![]() | getChildPositionAt(n:Number):Point
Returns the child position with the specified index and the current direction of this display. | ListContainer | |
![]() | getContainerPos():Number
Returns the current container position. | ScrollContainer | |
![]() | getCoordinateProperty():String
Returns the string representation of the coordinate attribute used in this display with the current direction value. | ListContainer | |
getMouseProperty():String
Returns the string representation of the coordinate attribute used in this display with the current direction value. | AutoScrollContainer | ||
![]() | getObjectsUnderPoint(point:Point):Array [override]
Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance. | Container | |
![]() | getSizeProperty():String
Returns the string representation of the size attribute with the current direction. | ListContainer | |
![]() | getStyleRenderer():Class
Returns the Style constructor use to initialize this component. | CoreComponent | |
![]() | groupPolicyChanged():void
Invoked when the group property or the groupName property changed. | CoreComponent | |
![]() | hide():void
Hides the component. | CoreComponent | |
![]() | initBackgroundPen(graphic:* = null):IPen
Init the pen to draw the background of this display. | Background | |
![]() | initialize():void
Initialize the component. | CoreComponent | |
![]() | isLocked():Boolean
Returns true if the object is locked. | CoreSprite | |
![]() | isVisible():Boolean
Returns true if the component is visible. | CoreComponent | |
![]() | lock():void [override]
Locks the object. | CoreComponent | |
![]() | lockMask():void
Use the mask protection. | ListContainer | |
![]() | move(x:Number, y:Number):void
Moves the component. | CoreComponent | |
![]() | notifyChanged():void
Notify a change in this component. | CoreComponent | |
![]() | notifyEnabled():void
Notify an event when the enabled property is changed. | CoreComponent | |
![]() | notifyFinish():void
Invoked when the scroll is finished. | ScrollContainer | |
![]() | notifyResized():void
Notify an event when you resize the component. | Background | |
![]() | notifyScroll():void
Notify a scroll ComponentEvent. | ScrollContainer | |
![]() | notifyStart():void
Invoked when the scroll is started. | ScrollContainer | |
![]() | refresh(init:*):void
Refresh and initialize the display with a generic object and invoke the "update" method. | Background | |
![]() | registerView(scope:DisplayObjectContainer = null):void
Registers the view of this component. | CoreComponent | |
![]() | removeChild(child:DisplayObject):DisplayObject [override]
Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance. | ScrollContainer | |
![]() | removeChildAt(index:int):DisplayObject [override]
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer. | ScrollContainer | |
![]() | removeChildsAt(index:int, size:Number):Array [override]
Removes all childs in the model defined for the first item by the specified index value,
this method remove the first and the size - 1 items. | ScrollContainer | |
![]() | removeRange(from:int, to:int):Array [override]
Removes a range of childs in the container. | ScrollContainer | |
![]() | resetLock():void
Reset the lock security of the display. | CoreSprite | |
![]() | resize(e:Event = null):void
Resize and update the background. | Background | |
![]() | scope():DisplayObject
Returns the real scope reference of this component. | CoreComponent | |
![]() | setChildIndex(child:DisplayObject, index:int):void [override]
Changes the position of an existing child in the display object container. | Container | |
![]() | setCornerRadius(n:Number):void
Defines all corner radius of the background (upper-left, upper-right, bottom-left and bottom-right). | Background | |
![]() | setScroll(value:Number, noEvent:Boolean = false):void
Sets the scroll value of the container. | ScrollContainer | |
![]() | setSize(w:Number, h:Number):void
Sets the virtual width (w) and height (h) values of the component. | Background | |
![]() | setStyle(... args):void
Sets the style property on the style declaration or object. | CoreComponent | |
![]() | show():void
Shows the component. | CoreComponent | |
![]() | speedScroll(n:Number):void
Scroll the container without scroll and without notify an event. | ScrollContainer | |
startMouseEvent():void
Start the mouse event activity. | AutoScrollContainer | ||
stopMouseEvent(noEvent:Boolean = false):void
Stops the mouse event activity. | AutoScrollContainer | ||
![]() | swapChildren(child1:DisplayObject, child2:DisplayObject):void [override]
Swaps the z-order (front-to-back order) of the two specified child objects. | Container | |
![]() | swapChildrenAt(index1:int, index2:int):void [override]
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list. | Container | |
![]() | toArray():Array
Returns the Array representation of all childs in this container. | Container | |
![]() | unlock():void [override]
Unlocks the display. | CoreComponent | |
![]() | unlockMask():void
Unlock the mask protect. | ListContainer | |
![]() | unregisterView():void
Unregisters the view of this component. | CoreComponent | |
![]() | update():void [override]
Updates the component. | CoreComponent | |
![]() | viewChanged():void
This method is invoked after the draw() method in the update() method. | Background | |
![]() | viewDestroyed(e:Event = null):void
Invoked when the component is removed. | CoreComponent | |
viewEnabled():void [override]
Invoked when the view enabled value change. | AutoScrollContainer | ||
![]() | viewResize():void
Invoked when the component is resized. | Background | |
![]() | viewStyleChanged(e:Event = null):void
Invoked when the component Style changed. | CoreComponent | |
| autoScroll | property |
autoScroll:BooleanDeterminates the auto scroll activity.
public function get autoScroll():Boolean public function set autoScroll(value:Boolean):void| propMouseX | property |
public var propMouseX:String = mouseXThe mouse x property name.
| propMouseY | property |
public var propMouseY:String = mouseYThe mouse y property name.
| scrollAutoRatio | property |
public var scrollAutoRatio:Number = 15Defines a value between 0 and 50%.
| scrollInterval | property |
scrollInterval:NumberDeterminates the delay in ms to refresh the scroll value.
public function get scrollInterval():Number public function set scrollInterval(value:Number):void| AutoScrollContainer | () | Constructor |
public function AutoScrollContainer(direction:String = vertical, id:* = null, isFull:Boolean = false, name:String = null)Creates a new AutoScrollContainer instance.
Parametersdirection:String (default = vertical) | |
id:* (default = null) | |
isFull:Boolean (default = false) | |
name:String (default = null) |
| draw | () | method |
override public function draw(... arguments):voidDraws the view of the component.
Parameters
... arguments |
| getMouseProperty | () | method |
public function getMouseProperty():StringReturns the string representation of the coordinate attribute used in this display with the current direction value.
ReturnsString — the string representation of the coordinate attribute used in this display with the current direction value.
|
| startMouseEvent | () | method |
public function startMouseEvent():voidStart the mouse event activity.
| stopMouseEvent | () | method |
public function stopMouseEvent(noEvent:Boolean = false):voidStops the mouse event activity.
Parameters
noEvent:Boolean (default = false) |
| viewEnabled | () | method |
override public function viewEnabled():voidInvoked when the view enabled value change.