On 2/22/13 5:49 PM, "Justin Mclean" <jus...@classsoftware.com> wrote:

> Hi,
> 
>> Yuck, I was hoping it would be in the spark.swc or mobile.swc.  If it is in
>> framework.swc it can be more tricky.
> 
> The the next issue SoftKeyboardEvent doesn't exist in Flash Player 10.1,
> there's 118 references to it in the SDK. In some cases we could work around
> but where it's adding event listeners, defining event meta data etc may not be
> so easy to change.
> 
I think we have to decide whether, like Linux, we want folks to be able to
build from sources, or just get the binary distribution to work. I would
vote for the latter for both Linux and 10.1.  Then the binary distribution
can be compiled with a later playerglobal and our 10.1 users can either not
use Spark components, or we can try refactoring code.

If you choose this latter approach, then the new proposed change to
SystemManager would look like this:

    var softKeyboardRect:Rectangle;
    if (Capabilities.version.indexOf("10.1") == -1)
        softKeyboardRect = gimmethesoftkeyboardrect();
    else
        softKeyboardRect = new Rectangle(0,0,0,0); // or make this static
    bounds.height = bounds.height - softKeyboardRect.height;

And gimmethesoftkeyboardrect() would look like:
    private function gimmethesoftkeyboardrect():Rectangle
    {
        return stage.softKeyboardRect;
    }

This would not compile on 10.1, but the binary distribution would run fine
because the verifier will never verify the code path that uses the 10.2 API
when running on 10.1.  This has the advantage of not requiring us to use []
syntax and make typos.

I'll bet we can wrap the SoftKeyboardEvent usage all 118 times in similar
logic and get away with it.  The main questions are: is it worth it, and is
it ok to require folks to only use unofficial binary distributions.

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to