Today I stumbled on a problem with Flex Spark Scroller and List components while developing an AIR mobile application.
Scroller component has a nice bounce effect when you pull it and it works the same way as you’ll expect the scrolling to work on iPhone (read here).
You don’t always need this behavior, and for some reason you can’t disable this effect. Another problem is that all the possible properties and methods on the Scroller class, which might allow you to change this functionality are eighter private or protected.
The only possible way to go is extending the Scroller class and disabling this effect manually in your class.
Here is a class I’ve created which does exactly this – com.avladov.components.Scroller
In order to disable the viewport dimensions overshooting just set overhsootEnabled value to false when you use the component.
Bouncing is diabled through overriding of performDrag and performThrow methods and resetting required values when needed.
If you have a better idea, feel free to share it 😉
Just a few steps showing you how to setup AIR 3.3 in Flash Builder 4.6 on Windows:
- Download AIR 3.3 SDK – air-sdk-download
- Navigate to your SDKs folder (under Flash Builder 4.6 installation directory).
- For 64x Windows: C:Program Files (x86)AdobeAdobe Flash Builder 4.6sdks
- For 32x Windows: C:Program FilesAdobeAdobe Flash Builder 4.6sdks
- Clone SDK 4.6 folder and rename it (Example: 4.6.0_AIR_3.3)
- Extract AIR SDK zip inside the new folder and overwrite all matches.
- Download Playerglobal SWC for Flash Player 11.3
- Go to /frameworks/libs/player/ inside your new SDK folder, create a new folder and name it “11.3” and place the SWC file from the previous step there. Don’t forget to rename it to playerglobal.swc
- Go back to 4.6.0_AIR_3.3 folder and open flex-sdk-description.xml
file. Change <name> value to something more meaningful and different from the current one. I preffer using Flex 4.6 (AIR 3.3)
- Open Flash Builder, go to Window->Preferences->Flash Builder->Installed Flex SDKs and add the new folder.
If you want to move an old project from AIR 3.1 or 3.2 to AIR 3.3 open its application.xml file and change the namespace at the top to match AIR 3.3. It should look like this:
For every project you create and uses AIR 3.3 don’t forget to add -swf-version=16 to the compile arguments right after -locale en_US