This is an automated email from the ASF dual-hosted git repository.

pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
     new 9f179ba  Added initial versions of Container and Box.
9f179ba is described below

commit 9f179ba3675b386639930973e2f0662cf9d6c190
Author: Peter Ent <[email protected]>
AuthorDate: Wed Mar 14 16:51:15 2018 -0400

    Added initial versions of Container and Box.
---
 .../MXRoyale/src/main/resources/defaults.css       |  16 +
 .../src/main/resources/mx-royale-manifest.xml      |   3 +
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   1 +
 .../MXRoyale/src/main/royale/mx/containers/Box.as  | 314 +++++++++
 .../src/main/royale/mx/containers/BoxDirection.as  |  63 ++
 .../MXRoyale/src/main/royale/mx/core/Container.as  | 784 +++++++++++++++++++++
 .../src/main/royale/mx/events/IndexChangedEvent.as | 308 ++++++++
 7 files changed, 1489 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css 
b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 3c3e1a7..92cbd8c 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -36,6 +36,15 @@ Button
        IBeadModel: 
ClassReference("org.apache.royale.html.beads.models.ImageAndTextModel");
 }
 
+Container
+{
+       IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView");
+       IBeadLayout: 
ClassReference("org.apache.royale.html.beads.layouts.BasicLayout");
+       IViewport: 
ClassReference("org.apache.royale.html.supportClasses.ScrollingViewport");
+       IViewportModel: 
ClassReference("org.apache.royale.html.beads.models.ViewportModel");
+       align-items: flex-start;
+}
+
 Image
 {
        vertical-align: top;
@@ -67,6 +76,13 @@ TextInput
                IBeadView: 
ClassReference("org.apache.royale.html.beads.CSSImageAndTextButtonView");
        }
        
+       Container
+       {
+               IBackgroundBead: 
ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
+               IBorderBead: 
ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
+               IContentView: 
ClassReference("org.apache.royale.html.supportClasses.ContainerContentArea");
+       }
+       
        Label
        {
                IBeadModel: 
ClassReference("org.apache.royale.html.beads.models.TextModel");
diff --git 
a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml 
b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index 0f9170c..654f834 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -30,4 +30,7 @@
        <component id="RadioButtonGroup" class="mx.controls.RadioButtonGroup" />
        <component id="TextInput" class="mx.controls.TextInput" />
        
+       <component id="Box" class="mx.containers.Box" />
+       <component id="Container" class="mx.core.Container" />
+       
 </componentPackage>
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as 
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 907858e..79a5c5f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -28,6 +28,7 @@ package
 internal class MXRoyaleClasses
 {
     import mx.core.UIComponent; UIComponent;
+       import mx.core.Container; Container;
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Box.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Box.as
new file mode 100644
index 0000000..80ad82f
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Box.as
@@ -0,0 +1,314 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers
+{
+       import org.apache.royale.core.IBeadLayout;
+       import org.apache.royale.events.Event;
+       import org.apache.royale.html.beads.layouts.HorizontalLayout;
+       import org.apache.royale.html.beads.layouts.VerticalLayout;
+
+COMPILE::JS
+{
+       import goog.DEBUG;
+}
+/*
+import flash.events.Event;
+import mx.containers.utilityClasses.BoxLayout;
+*/
+import mx.core.Container;
+/*
+import mx.core.IUIComponent;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+*/
+
+
+/**
+ *  A Halo Box container lays out its children in a single vertical column
+ *  or a single horizontal row.
+ *  The <code>direction</code> property determines whether to use
+ *  vertical (default) or horizontal layout.
+ * 
+ *  <p><b>Note:</b> Adobe recommends that, when possible, you use the Spark 
containers 
+ *  with HorizontalLayout or VerticalLayout instead of the Halo Box 
container.</p>
+ *
+ *  <p>The Box class is the base class for the VBox and HBox classes.
+ *  You use the <code>&lt;mx:Box&gt;</code>, <code>&lt;mx:VBox&gt;</code>,
+ *  and <code>&lt;mx:HBox&gt;</code> tags to define Box containers.</p>
+ *
+ *  <p>A Box container has the following default sizing characteristics:</p>
+ *     <table class="innertable">
+ *        <tr>
+ *           <th>Characteristic</th>
+ *           <th>Description</th>
+ *        </tr>
+ *        <tr>
+ *           <td>Default size</td>
+ *           <td><strong>Vertical Box</strong> The height is large enough to 
hold all its children at the default 
+ *               or explicit height of the children, plus any vertical gap 
between the children, plus the top and 
+ *               bottom padding of the container. The width is the default or 
explicit width of the widest child, 
+ *               plus the left and right padding of the container. 
+ *               <br><strong>Horizontal Box</strong> The width is large enough 
to hold all of its children at the 
+ *               default width of the children, plus any horizontal gap 
between the children, plus the left and 
+ *               right padding of the container. The height is the default or 
explicit height of the tallest child, 
+ *               plus the top and bottom padding for the container.</br>
+ *           </td>
+ *        </tr>
+ *        <tr>
+ *           <td>Default padding</td>
+ *           <td>0 pixels for the top, bottom, left, and right values.</td>
+ *        </tr>
+ *     </table>
+ *
+ *  @mxml
+ *
+ *  <p>The <code>&lt;mx:Box&gt;</code> tag inherits all of the tag 
+ *  attributes of its superclass, and adds the following tag attributes:</p>
+ *
+ *  <p>
+ *  <pre>
+ *  &lt;mx:Box
+ *    <strong>Properties</strong>
+ *    direction="vertical|horizontal"
+ *    <strong>Styles</strong>
+ *    horizontalAlign="left|center|right"
+ *    horizontalGap="8"
+ *    paddingBottom="0"
+ *    paddingTop="0"
+ *    verticalAlign="top|middle|bottom"
+ *    verticalGap="6"
+ *    &gt;
+ *    ...
+ *      <i>child tags</i>
+ *    ...
+ *  &lt;/mx:Box&gt;
+ *  </pre>
+ *  </p>
+ *
+ *  @includeExample examples/SimpleBoxExample.mxml
+ *
+ *  @see mx.core.Container
+ *  @see mx.containers.HBox
+ *  @see mx.containers.VBox
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class Box extends Container
+{
+   
+    
//--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function Box()
+    {
+        super();
+    }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Variables
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Public properties
+    //
+    
//--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  direction
+    //----------------------------------
+
+    [Bindable("directionChanged")]
+    [Inspectable(category="General", enumeration="vertical,horizontal", 
defaultValue="vertical")]
+       
+       private var _direction:String = BoxDirection.VERTICAL;
+
+    /**
+     *  The direction in which this Box container lays out its children.
+     *  Possible MXML values are
+     *  <code>"horizontal"</code> and <code>"vertical"</code>.
+     *  Possible values in ActionScript are 
<code>BoxDirection.HORIZONTAL</code>
+     *  and <code>BoxDirection.VERTICAL</code>.
+     *
+     *  @default BoxDirection.VERTICAL
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get direction():String
+    {
+        return _direction;
+    }
+
+    /**
+     *  @private
+     */
+    public function set direction(value:String):void
+    {
+               _direction = value;
+               
+               var layoutBead:IBeadLayout = getBeadByType(IBeadLayout) as 
IBeadLayout;
+               //if (layoutBead) removeBead(layoutBead);
+               if (layoutBead) {
+                       trace("At this time the layoutBead cannot be removed 
because the active layout bead cannot have its strand un-set");
+                       return
+               }
+               
+//             if (_direction == BoxDirection.VERTICAL) {
+//                     addBead(new VerticalLayout()); // TBD: replace with 
MX-specific vertical layout
+//             } else {
+//                     addBead(new HorizontalLayout()); // TBD: replace with 
MX-specific horizontal layout
+//             }
+               
+               dispatchEvent(new Event("directionChanged"));
+               dispatchEvent(new Event("layoutNeeded"));
+
+    }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    
//--------------------------------------------------------------------------
+
+       override public function addedToParent():void
+       {
+               // set the layout bead based on the direction
+               
+               if (_direction == BoxDirection.VERTICAL) {
+                       addBead(new VerticalLayout()); // TBD: replace with 
MX-specific vertical layout
+               } else {
+                       addBead(new HorizontalLayout()); // TBD: replace with 
MX-specific horizontal layout
+               }
+               
+               super.addedToParent();
+       }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  Method used to convert number of pixels to a
+     *  percentage relative to the contents of this container.
+     *
+     *  <p>The percentage value is relevant only while the
+     *  container does not change size or layout.
+     *  After a resize and/or new layout has occurred,
+     *  the value returned from this method may be stale.</p>
+     *
+     *  <p>An example of how this method could be used would
+     *  be to restore a component's size to a specific number
+     *  of pixels after hiding it.</p>
+     *
+     *  @param pxl The number of pixels for which a percentage
+     *  value is desired.
+     *
+     *  @return The percentage value that would be equivalent
+     *  to <code>pxl</code> under the current layout conditions
+     *  of this container.
+     *  A negative value indicates that the container must grow
+     *  in order to accommodate the requested size.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+//NOTE:
+// Will probably use this in the MX layouts
+//
+//    public function pixelsToPercent(pxl:Number):Number
+//    {
+//        var vertical:Boolean = isVertical();
+//
+//        // Compute our total percent and total # pixels for that percent.
+//        var totalPerc:Number = 0;
+//        var totalSize:Number = 0;
+//
+//        var n:int = numChildren;
+//        for (var i:int = 0; i < n; i++)
+//        {
+//            var child:IUIComponent = getLayoutChildAt(i);
+//
+//            var size:Number = vertical ? child.height : child.width;
+//            var perc:Number = vertical ? child.percentHeight : 
child.percentWidth;
+//
+//            if (!isNaN(perc))
+//            {
+//                totalPerc += perc;
+//                totalSize += size;
+//            }
+//        }
+//
+//        // Now if we found one let's compute the percent amount
+//        // that we'd require for a given number of pixels.
+//        var p:Number = 100;
+//        if (totalSize != pxl)
+//        {
+//            // Now we want the ratio of pixels per percent to
+//            // remain constant as we assume the a component
+//            // will consume them. So,
+//            //
+//            //  (totalSize - pxl) / totalPerc = totalSize / (totalPerc + p)
+//            //
+//            // where we solve for p.
+//
+//            p = ((totalSize * totalPerc) / (totalSize - pxl)) - totalPerc;
+//        }
+//
+//        return p;
+//    }
+       
+       /**
+        * @private
+        */
+       protected function isVertical():Boolean
+       {
+               return _direction == BoxDirection.VERTICAL;
+       }
+}
+
+}
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/BoxDirection.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/BoxDirection.as
new file mode 100644
index 0000000..0e0e68b
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/BoxDirection.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.containers
+{
+       
+/**
+ *  The BoxDirection class specifies constant values
+ *  for the <code>direction</code> property of the Box container.
+ *
+ *  @see mx.containers.Box
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public final class BoxDirection
+{
+       
//--------------------------------------------------------------------------
+       //
+       //  Class constants
+       //
+       
//--------------------------------------------------------------------------
+
+       /**
+        *  Specifies that children of the Box container are laid out 
horizontally.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public static const HORIZONTAL:String = "horizontal";
+       
+       /**
+        *  Specifies that children of the Box container are laid out 
vertically.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public static const VERTICAL:String = "vertical";
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
new file mode 100644
index 0000000..33f5681
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Container.as
@@ -0,0 +1,784 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.core
+{
+       import org.apache.royale.core.ContainerBaseStrandChildren;
+       import org.apache.royale.core.IBeadLayout;
+       import org.apache.royale.core.IChild;
+       import org.apache.royale.core.IContainer;
+       import org.apache.royale.core.IContentViewHost;
+       import org.apache.royale.core.ILayoutHost;
+       import org.apache.royale.core.ILayoutParent;
+       import org.apache.royale.core.ILayoutView;
+       import org.apache.royale.core.IParent;
+       import org.apache.royale.core.IStatesImpl;
+       import org.apache.royale.core.IStrandPrivate;
+       import org.apache.royale.core.IMXMLDocument;
+       import org.apache.royale.core.ValuesManager;
+       import org.apache.royale.events.Event;
+       import org.apache.royale.events.ValueChangeEvent;
+       import org.apache.royale.events.ValueEvent;
+       import org.apache.royale.states.State;
+       import org.apache.royale.utils.loadBeadFromValuesManager;
+       import org.apache.royale.utils.MXMLDataInterpreter;
+
+COMPILE::JS
+{
+    import goog.DEBUG;
+       import org.apache.royale.core.WrappedHTMLElement;
+       import org.apache.royale.html.util.addElementToWrapper;
+}
+/*
+import flash.display.DisplayObject;
+import flash.display.DisplayObjectContainer;
+import flash.display.Graphics;
+import flash.display.InteractiveObject;
+import flash.display.Loader;
+import flash.display.Shape;
+import flash.display.Sprite;
+import flash.events.Event;
+import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
+import flash.geom.Point;
+import flash.geom.Rectangle;
+import flash.system.ApplicationDomain;
+import flash.text.TextField;
+import flash.text.TextLineMetrics;
+import flash.ui.Keyboard;
+import flash.utils.getDefinitionByName;
+
+import mx.binding.BindingManager;
+import mx.containers.utilityClasses.PostScaleAdapter;
+import mx.controls.HScrollBar;
+import mx.controls.VScrollBar;
+import mx.controls.listClasses.IListItemRenderer;
+import mx.controls.scrollClasses.ScrollBar;
+import mx.core.IUITextField;
+import mx.events.ChildExistenceChangedEvent;
+*/
+import mx.events.FlexEvent;
+import mx.events.IndexChangedEvent;
+
+/*
+import mx.events.ScrollEvent;
+import mx.events.ScrollEventDetail;
+import mx.events.ScrollEventDirection;
+import mx.geom.RoundedRectangle;
+import mx.managers.IFocusManager;
+import mx.managers.IFocusManagerContainer;
+import mx.managers.ILayoutManagerClient;
+import mx.managers.ISystemManager;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+import mx.styles.IStyleClient;
+import mx.styles.StyleProtoChain;
+
+use namespace mx_internal;
+*/
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched after a child has been added to a container.
+ *
+ *  <p>The childAdd event is dispatched when the <code>addChild()</code>
+ *  or <code>addChildAt()</code> method is called.
+ *  When a container is first created, the <code>addChild()</code>
+ *  method is automatically called for each child component declared
+ *  in the MXML file.
+ *  The <code>addChildAt()</code> method is automatically called
+ *  whenever a Repeater object adds or removes child objects.
+ *  The application developer may also manually call these
+ *  methods to add new children.</p>
+ *
+ *  <p>At the time when this event is sent, the child object has been
+ *  initialized, but its width and height have not yet been calculated,
+ *  and the child has not been drawn on the screen.
+ *  If you want to be notified when the child has been fully initialized
+ *  and rendered, then register as a listener for the child's
+ *  <code>creationComplete</code> event.</p>
+ *
+ *  @eventType mx.events.ChildExistenceChangedEvent.CHILD_ADD
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+//[Event(name="childAdd", type="mx.events.ChildExistenceChangedEvent")]
+
+/**
+ *  Dispatched after the index (among the container children)
+ *  of a container child changes.
+ *  This event is only dispatched for the child specified as the argument to
+ *  the <code>setChildIndex()</code> method; it is not dispatched
+ *  for any other child whose index changes as a side effect of the call
+ *  to the <code>setChildIndex()</code> method.
+ *
+ *  <p>The child's index is changed when the
+ *  <code>setChildIndex()</code> method is called.</p>
+ *
+ *  @eventType mx.events.IndexChangedEvent.CHILD_INDEX_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="childIndexChange", type="mx.events.IndexChangedEvent")]
+
+/**
+ *  Dispatched before a child of a container is removed.
+ *
+ *  <p>This event is delivered when any of the following methods is called:
+ *  <code>removeChild()</code>, <code>removeChildAt()</code>,
+ *  or <code>removeAllChildren()</code>.</p>
+ *
+ *  @eventType mx.events.ChildExistenceChangedEvent.CHILD_REMOVE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+//[Event(name="childRemove", type="mx.events.ChildExistenceChangedEvent")]
+
+/**
+ *  Dispatched when the <code>data</code> property changes.
+ *
+ *  <p>When a container is used as a renderer in a List or other components,
+ *  the <code>data</code> property is used pass to the container
+ *  the data to display.</p>
+ *
+ *  @eventType mx.events.FlexEvent.DATA_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+[Event(name="dataChange", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the user manually scrolls the container.
+ *
+ *  <p>The event is dispatched when the scroll position is changed using
+ *  either the mouse (e.g. clicking on the scrollbar's "down" button)
+ *  or the keyboard (e.g., clicking on the down-arrow key).
+ *  However, this event is not dispatched if the scroll position
+ *  is changed programatically (e.g., setting the value of the
+ *  <code>horizontalScrollPosition</code> property).
+ *  The <code>viewChanged</code> event is delivered whenever the
+ *  scroll position is changed, either manually or programatically.</p>
+ *
+ *  <p>At the time when this event is dispatched, the scrollbar has
+ *  been updated to the new position, but the container's child objects
+ *  have not been shifted to reflect the new scroll position.</p>
+ *
+ *  @eventType mx.events.ScrollEvent.SCROLL
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+//[Event(name="scroll", type="mx.events.ScrollEvent")]
+
+/**
+ * The default property uses when additional MXML content appears within an 
element's
+ * definition in an MXML file.
+ */
+[DefaultProperty("mxmlContent")]
+
+/**
+ *  The Container class is an abstract base class for components that
+ *  controls the layout characteristics of child components.
+ *  You do not create an instance of Container in an application.
+ *  Instead, you create an instance of one of Container's subclasses,
+ *  such as Canvas or HBox.
+ *
+ *  <p>The Container class contains the logic for scrolling, clipping,
+ *  and dynamic instantiation.
+ *  It contains methods for adding and removing children.
+ *  It also contains the <code>getChildAt()</code> method, and the logic
+ *  for drawing the background and borders of containers.</p>
+ *
+ *  @mxml
+ *
+ *  Flex Framework containers inherit the following attributes from the 
Container
+ *  class:</p>
+ *
+ *  <pre>
+ *  &lt;mx:<i>tagname</i>
+ *    <strong>Properties</strong>
+ *    autoLayout="true|false"
+ *    clipContent="true|false"
+ *    creationIndex="undefined"
+ *    creationPolicy="auto|all|queued|none"
+ *    defaultButton="<i>No default</i>"
+ *    horizontalLineScrollSize="5"
+ *    horizontalPageScrollSize="0"
+ *    horizontalScrollBar="null"
+ *    horizontalScrollPolicy="auto|on|off"
+ *    horizontalScrollPosition="0"
+ *    icon="undefined"
+ *    label=""
+ *    verticalLineScrollSize="5"
+ *    verticalPageScrollSize="0"
+ *    verticalScrollBar="null"
+ *    verticalScrollPolicy="auto|on|off"
+ *    verticalScrollPosition="0"
+ *
+ *    <strong>Styles</strong>
+ *    backgroundAlpha="1.0"
+ *    backgroundAttachment="scroll"
+ *    backgroundColor="undefined"
+ *    backgroundDisabledColor="undefined"
+ *    backgroundImage="undefined"
+ *    backgroundSize="auto"
+ *    <i>    For the Application container only,</i> backgroundSize="100%"
+ *    barColor="undefined"
+ *    borderColor="0xAAB3B3"
+ *    borderSides="left top right bottom"
+ *    borderSkin="mx.skins.halo.HaloBorder"
+ *    borderStyle="inset"
+ *    borderThickness="1"
+ *    color="0x0B333C"
+ *    cornerRadius="0"
+ *    disabledColor="0xAAB3B3"
+ *    disbledOverlayAlpha="undefined"
+ *    dropShadowColor="0x000000"
+ *    dropShadowEnabled="false"
+ *    fontAntiAliasType="advanced"
+ *    fontfamily="Verdana"
+ *    fontGridFitType="pixel"
+ *    fontSharpness="0""
+ *    fontSize="10"
+ *    fontStyle="normal"
+ *    fontThickness="0"
+ *    fontWeight="normal"
+ *    horizontalScrollBarStyleName="undefined"
+ *    paddingBottom="0"
+ *    paddingLeft="0"
+ *    paddingRight="0"
+ *    paddingTop="0"
+ *    shadowDirection="center"
+ *    shadowDistance="2"
+ *    textAlign="left"
+ *    textDecoration="none|underline"
+ *    textIndent="0"
+ *    verticalScrollBarStyleName="undefined"
+ *
+ *    <strong>Events</strong>
+ *    childAdd="<i>No default</i>"
+ *    childIndexChange="<i>No default</i>"
+ *    childRemove="<i>No default</i>"
+ *    dataChange="<i>No default</i>"
+ *    scroll="<i>No default</i>"
+ *    &gt;
+ *      ...
+ *      <i>child tags</i>
+ *      ...
+ *  &lt;/mx:<i>tagname</i>&gt;
+ *  </pre>
+ *
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class Container extends UIComponent
+                                          implements IDataRenderer, IChildList,
+                                          IContainer, ILayoutParent, 
ILayoutView, IContentViewHost,
+                                          IStrandPrivate, IMXMLDocument
+                       //implements IContainer, IDataRenderer,
+                       //IFocusManagerContainer, IListItemRenderer,
+                       //IRawChildrenContainer, IChildList, 
IVisualElementContainer,
+                       //INavigatorContent
+
+{
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Notes: Child management
+    //
+    
//--------------------------------------------------------------------------
+
+    /*
+
+        Although at the level of a Flash DisplayObjectContainer, all
+        children are equal, in a Flex Container some children are "more
+        equal than others". (George Orwell, "Animal Farm")
+
+        In particular, Flex distinguishes between content children and
+        non-content (or "chrome") children. Content children are the kind
+        that can be specified in MXML. If you put several controls
+        into a VBox, those are its content children. Non-content children
+        are the other ones that you get automatically, such as a
+        background/border, scrollbars, the titlebar of a Panel,
+        AccordionHeaders, etc.
+
+        Most application developers are uninterested in non-content children,
+        so Container overrides APIs such as numChildren and getChildAt()
+        to deal only with content children. For example, Container, keeps
+        its own _numChildren counter.
+
+        Container assumes that content children are contiguous, and that
+        non-content children come before or after the content children.
+        In order words, Container partitions DisplayObjectContainer's
+        index range into three parts:
+
+        A B C D E F G H I
+        0 1 2 3 4 5 6 7 8    <- index for all children
+              0 1 2 3        <- index for content children
+
+        The content partition contains the content children D E F G.
+        The pre-content partition contains the non-content children
+        A B C that always stay before the content children.
+        The post-content partition contains the non-content children
+        H I that always stay after the content children.
+
+        Container maintains two state variables, _firstChildIndex
+        and _numChildren, which keep track of the partitioning.
+        In this example, _firstChildIndex would be 3 and _numChildren
+        would be 4.
+
+    */
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function Container()
+    {
+        super();
+               typeNames = "Container";
+    }
+       
+       /**
+        * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+        */
+       COMPILE::JS
+       override protected function createElement():WrappedHTMLElement
+       {
+               return addElementToWrapper(this,'div');
+       }
+       
+       
//--------------------------------------------------------------------------
+       //
+       //  IMXMLDocument et al
+       //
+       
//--------------------------------------------------------------------------
+       
+       private var _mxmlDescriptor:Array;
+       private var _mxmlDocument:Object = this;
+       private var _initialized:Boolean;
+       
+       override public function addedToParent():void
+       {
+               if (!_initialized) {
+                       // each MXML file can also have styles in fx:Style block
+                       ValuesManager.valuesImpl.init(this);
+               }
+               
+               super.addedToParent();
+               
+               if (!_initialized) {
+                       
MXMLDataInterpreter.generateMXMLInstances(_mxmlDocument, this, MXMLDescriptor);
+                       
+                       dispatchEvent(new Event("initBindings"));
+                       dispatchEvent(new Event("initComplete"));
+                       _initialized = true;
+               }
+               
+               // Load the layout bead if it hasn't already been loaded.
+               loadBeadFromValuesManager(IBeadLayout, "iBeadLayout", this);
+       }
+       
+       /**
+        *  @copy org.apache.royale.core.Application#MXMLDescriptor
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        */
+       public function get MXMLDescriptor():Array
+       {
+               return _mxmlDescriptor;
+       }
+       
+       /**
+        *  @private
+        */
+       public function setMXMLDescriptor(document:Object, value:Array):void
+       {
+               _mxmlDocument = document;
+               _mxmlDescriptor = value;
+       }
+       
+       /**
+        *  @copy org.apache.royale.core.Application#generateMXMLAttributes()
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        */
+       public function generateMXMLAttributes(data:Array):void
+       {
+               MXMLDataInterpreter.generateMXMLProperties(this, data);
+       }
+       
+       /**
+        *  @copy org.apache.royale.core.ItemRendererClassFactory#mxmlContent
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        * 
+        *  @royalesuppresspublicvarwarning
+        */
+       public var mxmlContent:Array;
+       
+       /*
+       * IContainer
+       */
+       
+       /**
+        *  @private
+        */
+       public function childrenAdded():void
+       {
+               dispatchEvent(new ValueEvent("childrenAdded"));
+       }
+       
+       /*
+       * Utility
+       */
+       
+       /**
+        * Dispatches a "layoutNeeded" event
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        */
+       public function layoutNeeded():void
+       {
+               dispatchEvent( new Event("layoutNeeded") );
+       }
+       
+       
+       //----------------------------------
+       //  data
+       //----------------------------------
+       
+       /**
+        *  @private
+        *  Storage for the data property;
+        */
+       private var _data:Object;
+       
+       [Bindable("dataChange")]
+       [Inspectable(environment="none")]
+       
+       /**
+        *  The <code>data</code> property lets you pass a value
+        *  to the component when you use it as an item renderer or item editor.
+        *  You typically use data binding to bind a field of the 
<code>data</code>
+        *  property to a property of this component.
+        *
+        *  <p>When you use the control as a drop-in item renderer or drop-in
+        *  item editor, Flex automatically writes the current value of the item
+        *  to the <code>selected</code> property of this control.</p>
+        *
+        *  <p>You do not set this property in MXML.</p>
+        *
+        *  @default null
+        *  @see mx.core.IDataRenderer
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public function get data():Object
+       {
+               return _data;
+       }
+       
+       /**
+        *  @private
+        */
+       public function set data(value:Object):void
+       {
+               _data = value;
+               dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+       }
+       
+       /*
+       * ILayoutParent
+       */
+       
+       /**
+        * Returns the ILayoutHost which is its view. From ILayoutParent.
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        */
+       public function getLayoutHost():ILayoutHost
+       {
+               return view as ILayoutHost;
+       }
+       
+       
//--------------------------------------------------------------------------
+       //  StrandChildren
+       
//--------------------------------------------------------------------------
+       
+       private var _strandChildren:ContainerBaseStrandChildren;
+       
+       /**
+        * @copy org.apache.royale.core.IContentViewHost#strandChildren
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.8
+        */
+       
+       /**
+        * @private
+        */
+       public function get strandChildren():IParent
+       {
+               if (_strandChildren == null) {
+                       _strandChildren = new ContainerBaseStrandChildren(this);
+               }
+               return _strandChildren;
+       }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  element/child handlers
+    //
+    
//--------------------------------------------------------------------------
+
+       
+       /**
+        * @private
+        */
+       COMPILE::JS
+       override public function addElement(c:IChild, dispatchEvent:Boolean = 
true):void
+       {
+               super.addElement(c, dispatchEvent);
+               if (dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenAdded", c));
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::JS
+       override public function addElementAt(c:IChild, index:int, 
dispatchEvent:Boolean = true):void
+       {
+               super.addElementAt(c, index, dispatchEvent);
+               if (dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenAdded", c));
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::JS
+       override public function removeElement(c:IChild, dispatchEvent:Boolean 
= true):void
+       {
+               super.removeElement(c, dispatchEvent);
+               //TODO This should possibly be ultimately refactored to be more 
PAYG
+               if (dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenRemoved", 
c));
+       }
+       
+       /*
+       * The following functions are for the SWF-side only and re-direct 
element functions
+       * to the content area, enabling scrolling and clipping which are 
provided automatically
+       * in the JS-side. 
+       */
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function addElement(c:IChild, dispatchEvent:Boolean = 
true):void
+       {
+               var contentView:IParent = getLayoutHost().contentView as 
IParent;
+               contentView.addElement(c, dispatchEvent);
+               if (dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenAdded", c));
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function addElementAt(c:IChild, index:int, 
dispatchEvent:Boolean = true):void
+       {
+               var contentView:IParent = getLayoutHost().contentView as 
IParent;
+               contentView.addElementAt(c, index, dispatchEvent);
+               if (dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenAdded", c));
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function getElementIndex(c:IChild):int
+       {
+               var layoutHost:ILayoutHost = view as ILayoutHost;
+               var contentView:IParent = layoutHost.contentView as IParent;
+               return contentView.getElementIndex(c);
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function removeElement(c:IChild, dispatchEvent:Boolean 
= true):void
+       {
+               var layoutHost:ILayoutHost = view as ILayoutHost;
+               var contentView:IParent = layoutHost.contentView as IParent;
+               contentView.removeElement(c, dispatchEvent);
+               //TODO This should possibly be ultimately refactored to be more 
PAYG
+               if(dispatchEvent)
+                       this.dispatchEvent(new ValueEvent("childrenRemoved", 
c));
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function get numElements():int
+       {
+               var layoutHost:ILayoutHost = view as ILayoutHost;
+               var contentView:IParent = layoutHost.contentView as IParent;
+               return contentView.numElements;
+       }
+       
+       /**
+        * @private
+        */
+       COMPILE::SWF
+       override public function getElementAt(index:int):IChild
+       {
+               var layoutHost:ILayoutHost = view as ILayoutHost;
+               var contentView:IParent = layoutHost.contentView as IParent;
+               return contentView.getElementAt(index);
+       }
+       
+       /*
+       * IStrandPrivate
+       *
+       * These "internal" function provide a backdoor way for proxy classes to
+       * operate directly at strand level. While these function are available 
on
+       * both SWF and JS platforms, they really only have meaning on the 
SWF-side. 
+       * Other subclasses may provide use on the JS-side.
+       *
+       * @see org.apache.royale.core.IContainer#strandChildren
+       */
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $numElements():int
+       {
+               return super.numElements;
+       }
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $addElement(c:IChild, dispatchEvent:Boolean = true):void
+       {
+               super.addElement(c, dispatchEvent);
+       }
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $addElementAt(c:IChild, index:int, 
dispatchEvent:Boolean = true):void
+       {
+               super.addElementAt(c, index, dispatchEvent);
+       }
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $removeElement(c:IChild, dispatchEvent:Boolean = 
true):void
+       {
+               super.removeElement(c, dispatchEvent);
+       }
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $getElementIndex(c:IChild):int
+       {
+               return super.getElementIndex(c);
+       }
+       
+       /**
+        * @private
+        * @suppress {undefinedNames}
+        * Support strandChildren.
+        */
+       public function $getElementAt(index:int):IChild
+       {
+               return super.getElementAt(index);
+       }
+}
+
+}
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/events/IndexChangedEvent.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/events/IndexChangedEvent.as
new file mode 100644
index 0000000..fe1d484
--- /dev/null
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/events/IndexChangedEvent.as
@@ -0,0 +1,308 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.events
+{
+
+import org.apache.royale.events.Event;
+import org.apache.royale.events.IRoyaleEvent;
+
+/**
+ *  The IndexChangedEvent class represents events that are dispatched when 
+ *  an index changes.
+ *  This event can indicate that the index value of a child of a container 
changed,
+ *  the displayed child of a navigator container such as an Accordion or 
+ *  ViewStack changed, or the order of column headers in a DataGrid 
+ *  control changed.
+ *
+ *  @see mx.core.Container
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class IndexChangedEvent extends Event
+{
+    
//--------------------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  The IndexChangedEvent.CHANGE constant defines the value of the 
+     *  <code>type</code> property of the event object for a 
<code>change</code> event,
+     *  which indicates that an index has changed, such as when and Accordion 
control
+     *  changes the displayed panel or a ViewStack changes views. 
+     *
+     *  <p>The properties of the event object have the following values:</p>
+     *  <table class="innertable">
+     *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines 
the 
+     *       event listener that handles the event. For example, if you use 
+     *       <code>myButton.addEventListener()</code> to register an event 
listener, 
+     *       myButton is the value of the <code>currentTarget</code>. 
</td></tr>
+     *     <tr><td><code>inputType</code></td><td>Indicates whether this event 
+     *         was caused by a mouse or keyboard interaction.</td></tr>
+     *     <tr><td><code>newIndex</code></td><td>The zero-based index 
+     *       after the change.</td></tr>
+     *     <tr><td><code>oldIndex</code></td><td>The zero-based index 
+     *       before the change.</td></tr>
+     *     <tr><td><code>relatedObject</code></td><td>Contains a reference
+     *       to the child object that corresponds to the new index.</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the 
event; 
+     *       it is not always the Object listening for the event. 
+     *       Use the <code>currentTarget</code> property to always access the 
+     *       Object listening for the event.</td></tr>
+     *     <tr><td><code>TriggerEvent</code></td><td>The event that 
+     *        triggered this event.</td></tr>
+     *     <tr><td><code>Type</code></td><td>IndexChangedEvent.CHANGE</td></tr>
+     *  </table>
+     *   
+     *  @eventType change
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static const CHANGE:String = "change";
+
+    /**
+     *  The IndexChangedEvent.CHILD_INDEX_CHANGE constant defines the value of 
the 
+     *  <code>type</code> property of the event object for a childIndexChange 
event,
+     *  which indicates that a component's index among a container's children 
+     *  has changed.
+     *
+     *  <p>The properties of the event object have the following values:</p>
+     *  <table class="innertable">
+     *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines 
the 
+     *       event listener that handles the event. For example, if you use 
+     *       <code>myButton.addEventListener()</code> to register an event 
listener, 
+     *       myButton is the value of the <code>currentTarget</code>. 
</td></tr>
+     *     <tr><td><code>inputType</code></td><td>Indicates whether this event 
+     *         was caused by a mouse or keyboard interaction.</td></tr>
+     *     <tr><td><code>newIndex</code></td><td>The zero-based index of the 
+     *       child after the change.</td></tr>
+     *     <tr><td><code>oldIndex</code></td><td>The zero-based index of the 
+     *       child before the change.</td></tr>
+     *     <tr><td><code>relatedObject</code></td><td>Contains a reference
+     *       to the child object whose index changed.</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the 
event; 
+     *       it is not always the Object listening for the event. 
+     *       Use the <code>currentTarget</code> property to always access the 
+     *       Object listening for the event.</td></tr>
+     *     <tr><td><code>TriggerEvent</code></td><td>null</td></tr>
+     *     
<tr><td><code>Type</code></td><td>IndexChangedEvent.CHILD_INDEX_CHANGE</td></tr>
+     *  </table>
+     *   
+     *  @eventType childIndexChange
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static const CHILD_INDEX_CHANGE:String = "childIndexChange";
+
+    /**
+     *  The IndexChangedEvent.HEADER_SHIFT constant defines the value of the 
+     *  <code>type</code> property of the event object for a 
<code>headerShift</code> event,
+     *  which indicates that a header has changed its index, as when a user 
drags
+     *  a DataGrid column to a new position.
+     *
+     *  <p>The properties of the event object have the following values:</p>
+     *  <table class="innertable">
+     *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines 
the 
+     *       event listener that handles the event. For example, if you use 
+     *       <code>myButton.addEventListener()</code> to register an event 
listener, 
+     *       myButton is the value of the <code>currentTarget</code>. 
</td></tr>
+     *     <tr><td><code>inputType</code></td><td>Indicates whether this event 
+     *         was caused by a mouse or keyboard interaction.</td></tr>
+     *     <tr><td><code>newIndex</code></td><td>The zero-based index of the 
+     *       header after the change.</td></tr>
+     *     <tr><td><code>oldIndex</code></td><td>The zero-based index of the 
+     *       header before the change.</td></tr>
+     *     <tr><td><code>relatedObject</code></td><td>null</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the 
event; 
+     *       it is not always the Object listening for the event. 
+     *       Use the <code>currentTarget</code> property to always access the 
+     *       Object listening for the event.</td></tr>
+     *     <tr><td><code>TriggerEvent</code></td><td>The event that 
+     *        triggered this event.</td></tr>
+     *     
<tr><td><code>Type</code></td><td>IndexChangedEvent.HEADER_SHIFT</td></tr>
+     *  </table>
+     *   
+     *  @eventType headerShift
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public static const HEADER_SHIFT:String = "headerShift";
+    
+    
//--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *  Normally called by a Flex control and not used in application code.
+     *
+     *  @param type The event type; indicates the action that caused the event.
+     *
+     *  @param bubbles Specifies whether the event can bubble
+     *  up the display list hierarchy.
+     *
+     *  @param cancelable Specifies whether the behavior
+     *  associated with the event can be prevented.
+     *
+     *  @param relatedObject The child object associated with the index change.
+     *
+     *  @param oldIndex The zero-based index before the change.
+     *
+     *  @param newIndex The zero-based index after the change.
+     *
+     *  @param triggerEvent The event that triggered this event.
+     *  
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function IndexChangedEvent(type:String, bubbles:Boolean = false,
+                                      cancelable:Boolean = false,
+                                      relatedObject:Object = null,
+                                      oldIndex:Number = -1,
+                                      newIndex:Number = -1,
+                                      triggerEvent:Event = null)
+    {
+        super(type, bubbles, cancelable);
+
+        this.relatedObject = relatedObject;
+        this.oldIndex = oldIndex;
+        this.newIndex = newIndex;
+        this.triggerEvent = triggerEvent;
+    }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Properties
+    //
+    
//--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  newIndex
+    //----------------------------------
+
+    /**
+     *  The zero-based index after the change. For <code>change</code> events
+     *  it is the index of the current child. For <code>childIndexChange</code>
+     *  events, it is the new index of the child. For <code>headerShift</code>
+     *  events, it is the new index of the header.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var newIndex:Number;
+
+    //----------------------------------
+    //  oldIndex
+    //----------------------------------
+
+    /**
+     *  The zero-based index before the change.  
+     *  For <code>change</code> events it is the index of the previous child.
+     *  For <code>childIndexChange</code> events, it is the previous index 
+     *  of the child.
+     *  For <code>headerShift</code> events, it is the previous index of 
+     *  the header.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var oldIndex:Number;
+
+    //----------------------------------
+    //  relatedObject
+    //----------------------------------
+
+    /**
+     *  The child object whose index changed, or the object associated with
+     *  the new index. This property is not set for header changes. 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var relatedObject:Object;
+
+    //----------------------------------
+    //  triggerEvent
+    //----------------------------------
+
+    /**
+     *  The event that triggered this event. 
+     *  Indicates whether this event was caused by a mouse or keyboard 
interaction.
+     *  The value is <code>null</code> when a container dispatches a 
+     *  <code>childIndexChanged</code> event.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public var triggerEvent:Event;
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Overridden methods: Event
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function clone():IRoyalEvent
+    {
+        return new IndexChangedEvent(type, bubbles, cancelable,
+                                     relatedObject, oldIndex, 
+                                     newIndex, triggerEvent);
+    }
+}
+
+}

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to