Packagelunas.containers
Classpublic class AutoScrollContainer
InheritanceAutoScrollContainer Inheritance ScrollContainer Inheritance ListContainer Inheritance Container Inheritance CoreComponent Inheritance Background Inheritance CoreSprite Inheritance flash.display.Sprite

This auto scrollable container use an auto scroll effect.

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 ) ;
     



Public Properties
 PropertyDefined By
 Inheritedalign : uint
The alignement of the background.
Background
 Inheritedarea : Sprite
[read-only] Returns the area reference of this component.
ListContainer
 InheritedareaPen : IPen
[read-only] Indicates the area Pen reference of this component.
ListContainer
  autoScroll : Boolean
Determinates the auto scroll activity.
AutoScrollContainer
 InheritedautoSize : Boolean
Indicates if the background is resizing when the stage resize event is invoked.
Background
 Inheritedbackground : Sprite
[read-only] Indicates the background reference of this component.
ListContainer
 InheritedbackgroundPen : IPen
[read-only] Indicates the background Pen reference of this component.
ListContainer
 Inheritedborder : EdgeMetrics
Indicates the thickness, in pixels, of the four edge regions around a visual component.
CoreComponent
 InheritedbottomLeftRadius : Number
The radius of the bottom-left corner, in pixels.
Background
 InheritedbottomRightRadius : Number
The radius of the bottom-right corner, in pixels.
Background
 InheritedbottomScroll : Number
[read-only] Determinates the bottom scroll value.
ScrollContainer
 Inheritedbubbles : Boolean = true
Indicates if the events use bubbling when are dispatched.
CoreComponent
 Inheritedbuilder : Builder
Indicates the Builder reference of this instance.
CoreComponent
 InheritedchildCount : int
Determinates the number of childs in this container.
ListContainer
 InheritedcomponentInspectorSetting : Boolean
Initialize when the Flash component settings are initialized (only in Flash with a compiled component).
CoreComponent
 Inheriteddirection : String
Indicates the direction value of the background when the display is in this "full" mode (default value is null).
Background
 Inheritedenabled : Boolean
Indicates the enabled state of the component.
CoreComponent
 Inheritedfill : IFillStyle
Determinates the IFillStyle reference of this display.
Background
 InheritedfixScroll : Boolean
Indicates if the scroll is fixed.
ScrollContainer
 InheritedgradientMatrix : Matrix
The matrix value to draw the gradient fill.
Background
 InheritedgradientRotation : Number = 0
The rotation value to draw the gradient fill.
Background
 InheritedgradientTranslation : Point
The translation vector to draw the gradient fill.
Background
 Inheritedgroup : Boolean
Indicates with a boolean if this object is grouped.
CoreComponent
 InheritedgroupName : String
Indicates the name of the group of this object.
CoreComponent
 Inheritedh : Number
Determinates the virtual height value of this component.
Background
 Inheritedinvert : Boolean
Inverts the z-depth of the childs in the container.
Container
 InheritedisFull : Boolean
Indicates if the background use full size (use Stage.stageWidth and Stage.stageHeight to resize the background).
Background
 Inheritedlayout : Layout
Determinates the layout of this container.
CoreComponent
 Inheritedline : ILineStyle
Determinates the ILineStyle reference of this display.
Background
 Inheritedlogger : Logger
Determinates the internal ILogger reference of this Logable object.
CoreSprite
 InheritedmaskIsActive : Boolean
Indicates if the mask is active or not over this container.
ListContainer
 InheritedmaskView : Sprite
[read-only] Determinates the mask reference of this container.
ListContainer
 InheritedmaxHeight : Number
This property defined the maximum height of this display.
Background
 Inheritedmaxscroll : Number
[read-only] Returns the maxscroll value.
ScrollContainer
 InheritedmaxWidth : Number
Defines the maximum width of this display.
Background
 InheritedminHeight : Number
This property defined the mimimun height of this display (This value is >= 0).
Background
 InheritedminWidth : Number
This property defined the mimimun width of this display (This value is >= 0).
Background
 InheritednoScrollEasing : Boolean
Indicates if the scroll use an easing effect.
ScrollContainer
 InheritednumChildren : int
[override] [read-only] Determinates the number of children of this object.
Container
 InheritedpropHeight : 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
 InheritedpropWidth : String = width
The width property name use in the container to layout all items.
ListContainer
 InheritedpropX : String = x
The x property name use in the container to layout all items.
ListContainer
 InheritedpropY : String = y
The y property name use in the container to layout all items.
ListContainer
 Inheritedrectangle : Rectangle
[read-only] Returns the internal Rectangle object of this display.
ListContainer
 Inheritedscroll : Number
Returns the scroll value of this container.
ScrollContainer
  scrollAutoRatio : Number = 15
Defines a value between 0 and 50%.
AutoScrollContainer
 InheritedscrollDuration : Number = 12
Indicates the scroll duration.
ScrollContainer
 InheritedscrollEasing : Function
Indicates the scroll easing method.
ScrollContainer
  scrollInterval : Number
Determinates the delay in ms to refresh the scroll value.
AutoScrollContainer
 Inheritedspace : Number
Indicates the space value (in pixel) between 2 childs in the list.
ListContainer
 InheritedspaceH : Number
Indicates the space value (in pixel) between 2 childs in the list when the direction is horizontal.
ListContainer
 InheritedspaceV : Number
Indicates the space value (in pixel) between 2 childs in the list when the direction is vertical.
ListContainer
 Inheritedstyle : Style
Returns the style of this component.
CoreComponent
 InheritedtopLeftRadius : Number
The radius of the upper-left corner, in pixels.
Background
 InheritedtopRightRadius : Number
The radius of the upper-right corner, in pixels.
Background
 InheriteduseCacheAsBitmap : Boolean
Indicates if the container use cacheAsBitmap flag when the scroll is in progress.
ScrollContainer
 InheriteduseGradientBox : Boolean
Indicates if the IFillStyle of this display use gradient box matrix (only if the IFillStyle is a FillGradientStyle).
Background
 InheriteduseScrollRect : Boolean
Indicates if this container use a scrollRect reference to mask the content.
ListContainer
 Inheritedw : Number
Determinates the virtual height value of this component.
Background
Protected Properties
 PropertyDefined By
 Inherited_area : Sprite
This area sprite defines a hide background display back of the display.
ListContainer
 Inherited_areaPen : RectanglePen
The pen of the area IPen object.
ListContainer
 Inherited_background : Sprite
This Background reference defines a background display.
ListContainer
 Inherited_backgroundPen : RectanglePen
The pen of the background Pen object.
ListContainer
 Inherited_bound : Rectangle
The Rectangle internal bound object of the container.
ListContainer
 Inherited_container : Sprite
This CoreSprite reference defines a container display.
ListContainer
 Inherited_mask : Sprite
This CoreShape reference defines a mask display.
ListContainer
 Inherited_maskPen : RectanglePen
The pen of the mask IPen object.
ListContainer
 Inherited_scope : DisplayObjectContainer
The scope of the active display of this container component.
CoreComponent
Public Methods
 MethodDefined By
  
AutoScrollContainer(direction:String = vertical, id:* = null, isFull:Boolean = false, name:String = null)
Creates a new AutoScrollContainer instance.
AutoScrollContainer
 Inherited
addChild(child:DisplayObject):DisplayObject
[override] Adds a child DisplayObject instance to this DisplayObjectContainer instance.
ScrollContainer
 Inherited
addChildAt(child:DisplayObject, index:int):DisplayObject
[override] Adds a child DisplayObject instance to this DisplayObjectContainer instance.
ScrollContainer
 Inherited
[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
 Inherited
Refreshs and changes the child position of all childs in the container.
ListContainer
 Inherited
clear():void
Removes all childs in the container.
Container
 Inherited
contains(child:DisplayObject):Boolean
[override] Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
Container
 Inherited
containsAt(index:int):Boolean
Returns true if a child exist in the display list at the specified index value.
Container
 Inherited
doLater():void
Launch an event with a delayed interval.
Background
  
draw(... arguments):void
[override] Draws the view of the component.
AutoScrollContainer
 Inherited
Returns the Builder constructor use to initialize this component.
CoreComponent
 Inherited
getChildAt(index:int):DisplayObject
[override] Returns the child display object instance that exists at the specified index.
Container
 Inherited
getChildByName(name:String):DisplayObject
[override] Returns the child display object that exists with the specified name.
Container
 Inherited
getChildIndex(child:DisplayObject):int
[override] Returns the index position of a child DisplayObject instance.
Container
 Inherited
getChildPositionAt(n:Number):Point
Returns the child position with the specified index and the current direction of this display.
ListContainer
 Inherited
Returns the current container position.
ScrollContainer
 Inherited
Returns the string representation of the coordinate attribute used in this display with the current direction value.
ListContainer
  
Returns the string representation of the coordinate attribute used in this display with the current direction value.
AutoScrollContainer
 Inherited
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
 Inherited
Returns the string representation of the size attribute with the current direction.
ListContainer
 Inherited
Returns the Style constructor use to initialize this component.
CoreComponent
 Inherited
Invoked when the group property or the groupName property changed.
CoreComponent
 Inherited
hide():void
Hides the component.
CoreComponent
 Inherited
initBackgroundPen(graphic:* = null):IPen
Init the pen to draw the background of this display.
Background
 Inherited
initialize():void
Initialize the component.
CoreComponent
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreSprite
 Inherited
isVisible():Boolean
Returns true if the component is visible.
CoreComponent
 Inherited
lock():void
[override] Locks the object.
CoreComponent
 Inherited
lockMask():void
Use the mask protection.
ListContainer
 Inherited
move(x:Number, y:Number):void
Moves the component.
CoreComponent
 Inherited
Notify a change in this component.
CoreComponent
 Inherited
Notify an event when the enabled property is changed.
CoreComponent
 Inherited
Invoked when the scroll is finished.
ScrollContainer
 Inherited
Notify an event when you resize the component.
Background
 Inherited
Notify a scroll ComponentEvent.
ScrollContainer
 Inherited
Invoked when the scroll is started.
ScrollContainer
 Inherited
refresh(init:*):void
Refresh and initialize the display with a generic object and invoke the "update" method.
Background
 Inherited
registerView(scope:DisplayObjectContainer = null):void
Registers the view of this component.
CoreComponent
 Inherited
removeChild(child:DisplayObject):DisplayObject
[override] Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.
ScrollContainer
 Inherited
removeChildAt(index:int):DisplayObject
[override] Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
ScrollContainer
 Inherited
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
 Inherited
removeRange(from:int, to:int):Array
[override] Removes a range of childs in the container.
ScrollContainer
 Inherited
resetLock():void
Reset the lock security of the display.
CoreSprite
 Inherited
resize(e:Event = null):void
Resize and update the background.
Background
 Inherited
scope():DisplayObject
Returns the real scope reference of this component.
CoreComponent
 Inherited
setChildIndex(child:DisplayObject, index:int):void
[override] Changes the position of an existing child in the display object container.
Container
 Inherited
setCornerRadius(n:Number):void
Defines all corner radius of the background (upper-left, upper-right, bottom-left and bottom-right).
Background
 Inherited
setScroll(value:Number, noEvent:Boolean = false):void
Sets the scroll value of the container.
ScrollContainer
 Inherited
setSize(w:Number, h:Number):void
Sets the virtual width (w) and height (h) values of the component.
Background
 Inherited
setStyle(... args):void
Sets the style property on the style declaration or object.
CoreComponent
 Inherited
show():void
Shows the component.
CoreComponent
 Inherited
speedScroll(n:Number):void
Scroll the container without scroll and without notify an event.
ScrollContainer
  
Start the mouse event activity.
AutoScrollContainer
  
stopMouseEvent(noEvent:Boolean = false):void
Stops the mouse event activity.
AutoScrollContainer
 Inherited
swapChildren(child1:DisplayObject, child2:DisplayObject):void
[override] Swaps the z-order (front-to-back order) of the two specified child objects.
Container
 Inherited
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
 Inherited
toArray():Array
Returns the Array representation of all childs in this container.
Container
 Inherited
unlock():void
[override] Unlocks the display.
CoreComponent
 Inherited
unlockMask():void
Unlock the mask protect.
ListContainer
 Inherited
Unregisters the view of this component.
CoreComponent
 Inherited
update():void
[override] Updates the component.
CoreComponent
 Inherited
This method is invoked after the draw() method in the update() method.
Background
 Inherited
viewDestroyed(e:Event = null):void
Invoked when the component is removed.
CoreComponent
  
[override] Invoked when the view enabled value change.
AutoScrollContainer
 Inherited
viewResize():void
Invoked when the component is resized.
Background
 Inherited
viewStyleChanged(e:Event = null):void
Invoked when the component Style changed.
CoreComponent
Protected Methods
 MethodDefined By
 Inherited
_refreshChilds(... arguments):void
Invoked to refreshChilds during the scroll of this container.
ScrollContainer
 Inherited
addedToStage(e:Event = null):void
Invoked when the display is added to the stage.
CoreSprite
 Inherited
addedToStageResize(e:Event = null):void
Invoked when the display is removed from the stage to enable the autoSize mode.
Background
 Inherited
fireComponentEvent(type:String):void
Dispatchs a ComponentEvent with the specified type.
CoreComponent
 Inherited
Refresh the mask view of the display.
ListContainer
 Inherited
Refresh the mask view of the display.
ListContainer
 Inherited
removedFromStage(e:Event = null):void
Invoked when the display is removed from the stage.
CoreSprite
 Inherited
removedFromStageResize(e:Event = null):void
Invoked when the display is removed from the stage to disable the autoSize mode.
Background
 Inherited
renderLayout(layout:Layout = null):void
Receives a message when the layout emit when is rendered.
CoreComponent
 Inherited
updateLayout(layout:Layout = null):void
[override] Invoked when the container layout change.
ListContainer
Property Detail
autoScrollproperty
autoScroll:Boolean

Determinates the auto scroll activity.


Implementation
    public function get autoScroll():Boolean
    public function set autoScroll(value:Boolean):void
propMouseXproperty 
public var propMouseX:String = mouseX

The mouse x property name.

propMouseYproperty 
public var propMouseY:String = mouseY

The mouse y property name.

scrollAutoRatioproperty 
public var scrollAutoRatio:Number = 15

Defines a value between 0 and 50%.

scrollIntervalproperty 
scrollInterval:Number

Determinates the delay in ms to refresh the scroll value.


Implementation
    public function get scrollInterval():Number
    public function set scrollInterval(value:Number):void
Constructor Detail
AutoScrollContainer()Constructor
public function AutoScrollContainer(direction:String = vertical, id:* = null, isFull:Boolean = false, name:String = null)

Creates a new AutoScrollContainer instance.

Parameters
direction:String (default = vertical)
 
id:* (default = null)
 
isFull:Boolean (default = false)
 
name:String (default = null)
Method Detail
draw()method
override public function draw(... arguments):void

Draws the view of the component.

Parameters

... arguments

getMouseProperty()method 
public function getMouseProperty():String

Returns the string representation of the coordinate attribute used in this display with the current direction value.

Returns
String — the string representation of the coordinate attribute used in this display with the current direction value.
startMouseEvent()method 
public function startMouseEvent():void

Start the mouse event activity.

stopMouseEvent()method 
public function stopMouseEvent(noEvent:Boolean = false):void

Stops the mouse event activity.

Parameters

noEvent:Boolean (default = false)

viewEnabled()method 
override public function viewEnabled():void

Invoked when the view enabled value change.