Search code examples
listapache-flexflex4flash-builder

Flex 4.10 new features


I have installed Flex 4.10.0 SDK for Flash Builder 4.7 (tried both MacOS and Windows) using the new Apache Flex SDK Installer and loved how smoothly it has worked:

enter image description here

Also I'm excited that someone is still working on the Flex SDK (thank you!) - because for quite some time it looked abandoned.

My 3 questions:

  1. Does anybody have a list of the (supposedly over fifteen?) new Spark components? I have only noticed one sofar: mx.controls.Alert -> spark.components.Alert. (And I have noticed that spark.utils.MultiDPIBitmapSource supports source480dpi which is great).

  2. Does anybody know, if there is a fix for the spark.components.List not remembering its scrolling position? Because currently in my Flex game with 2 Lists updated by server I have to use custom skin and data group as explained in this nice blog.

  3. Currently to scroll a spark.components.List to a bottom I have to use the following hack and wonder if that issue has been approached too?

    public static function scrollToBottom(list:List):void {
        // update the verticalScrollPosition to the end of the List
        // virtual layout may require us to validate a few times
        var delta:Number = 0;
        var count:int = 0;
    
        while (count++ < 10) {
            list.validateNow();
            delta = list.layout.getVerticalScrollPositionDelta(NavigationUnit.END);
            list.layout.verticalScrollPosition += delta;
    
            if (delta == 0)
                break;
        }
    }
    

UPDATE:

For the issue #3 I've created a JIRA #33660 with a test case and screenshot attached. There were already similar bug reports, but they were closed by Adobe.

UPDATE 2:

For the issue #2 I haven't been able to create a simple test case yet, but I definetely see that problem in my app (the link is above, do not want to spam), where 2 Lists are updated via TCP socket by server.

Here is my current test case (not really demoing the problem), maybe someone can improve it:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               applicationComplete="init()">

    <fx:Script>
        <![CDATA[
            import flash.utils.setInterval;
            private function init():void {
                setInterval(add, 1000);
            }

            private function add():void {
                var pos:int = Math.floor(myAC.length * Math.random());
                myAC.addItemAt({label: Math.random()}, pos);
            }
        ]]>
    </fx:Script>

    <s:List id="myList" width="100%" height="100%">
        <s:dataProvider>
            <s:ArrayCollection id="myAC" />
        </s:dataProvider>
    </s:List>

    <s:controlBarContent>
        <s:Button id="myButton" label="Add number" click="add()" />
    </s:controlBarContent>

</s:Application>

Solution

  • In reply to Part 1, I found a Release Notes file that mentions the following new Spark components:

    Accordion, DataAccordion, InlineScroller, CallOut, CallOutButton, Alert, ColorPicker, MenuBar, Menu, and ProgressBar.

    Also several new layouts: AccordionLayout, CarouselLayout, CoverflowLayout, StackLayout (and more).