Skip to main content
Inspiring
September 1, 2011
Question

iOS and Android Native Scroll in Adobe AIR

  • September 1, 2011
  • 6 replies
  • 35223 views

I think it would be a great idea to implement the smooth scroll present in native iOS and Android applications for use in Adobe AIR projects.


Currently, the only way to obtain smooth scrolling lists with images is using StageWebView to show the image list in HTML format, and then awkwardly implement some JavaScript / AS3 communication functionality so the list in the StageWebView is interactive and can communicate with the main program. This is excessively complicated and very error prone (I've found some inexplicable JavaScript errors that only happen in the iPad, not in Android, and not in the PC!).

It would be way better to be able to skip all the StageWebView process altogether and being able to use a simple AS3 API to put any sprite/movieclip into a scrollable canvas which can be moved using the iOS native scroll.

Using Flash animation to simulate the scroll in a list with images is too slow in the iPad and gives a bad user experience. iPad users expect the native iPad scroll, not some poor jerky simulation. A native scroll is the only way to go.

And even though I talk about the iPad, this should be applicable to the native Android scroll, too.

Scrolling is a VERY BASIC action in a tablet, so this should be implemented as soon as possible.

Actually, I'm amazed we're already at AIR 3.0 beta, and still after all this time nobody thought of this. All sorts of fancy stuff is being added to AIR (hardware accelerated video, webcam and microphone access, etc...) but still something as basic and important as a smooth scroll, which every tablet user expects, is still not possible in Adobe AIR. We either have to implement some slow Flash animated scroll, or use the extremely complicated StageWebView with JavaScript/AS3 communication approach (I'm using a third party library called StageWebViewBridge for the JS/AS3 interoperations, which is great, but still, it's a far from ideal solution, since it's pretty fiddly and the JavaScript code doesn't always work properly in iOS).

This topic has been closed for replies.

6 replies

May 23, 2013

Please have a look at it, I have made a smooth scroll list for Android and iOS.

https://vipulkhandelwalblog.wordpress.com/

OMA2kAuthor
Inspiring
May 23, 2013

Thanks for the link, I'll try your library later. So this is using the regular DisplayList? Have you tried Feathers' List or Scroller components, to compare performance?

May 24, 2013

Yes, I have used display list, but for performance, i've used object pooling.

There is no feathers list or scroller component used.

Known Participant
April 6, 2012

@OMA2k

honestly I don't believe Adobe will manage to implement it soon (and "soon" in this context is rather for years than monthes). I wish I'm wrong.

Even though your API prototype / usage example in bugbase looks pretty suitable. It's defenitely better then nothing, but still all this "Stage" things being rendered in a separate layers (apart from our DisplayList) could be a bit pinfull... And what about desktops or any other custom solutions that run with any kind of touch surfaces? Those developers also would love to have touch scrolling, but again I can hardly believe those OSs would provide this kind of functionality.

Meanwhile you could try my solution=) It's 99% equal to native iOS scrolling (I've tested side-by-side, same "flick" leads to same time, position and dynamics of the motion). And it's also much more advanced in customization and reusable, unlike one mentioned above for example.

source: https://github.com/fljot/TouchScrolling

compiled demos: https://github.com/fljot/TouchScrolling/downloads

Participating Frequently
June 15, 2012

That works nice!

but where   came this Events from?

                    import org.gestouch.events.TapGestureEvent;

                              import org.gestouch.gestures.TapGesture;

Known Participant
June 15, 2012

@mechla

check out the swf in libs folder. That's my gesture recognition library. TapGesture is used only in that example (for UI), but PanGesture is used inside scrolling itself (similar to how UIPanGestureRecognizer is used inside UIScrollView in Apple's UIKit).

Known Participant
March 30, 2012

I am weighing up using Flash CS5.5 and Air 3.2 for an iPad only project. The app is essentially like a newspaper and will involve scrolling content comprised of text and images.

From reading this thread, it sounds like the scrolling behaviour could be pretty lousy? Can anyone reassure me that Flash and Air combination will perform this functionality to a reasonable standard. Apart from this issue, it would appear the Flash/Air implementation would be perfect for this app.

Any advice appreciated.

Participant
January 16, 2012

I feel your pain and I 100% agree. In the mean time, I created a couple of classes to mimic IOS scrolling in AIR. It's not perfect, but this should hold you off until native scrolling is leveraged in AIR.

http://jacksonkr.com/content/ios-scrolling-flash

Inspiring
December 14, 2011

i added my vote to the bugbase - more people should do the same. please help us adobe. bad scrolling in a flash app = nobody wanting the flash app...

chris.campbell
Legend
September 1, 2011

Thanks for the suggestion, I agree that this sounds like a nice thing to have.  Would you mind adding this to bugbase.adobe.com and posting back with the URL?  I'd like to encourage others interested to add their votes and comments.

Thanks,

Chris

OMA2kAuthor
Inspiring
September 2, 2011

It's great to hear you find this a good idea

The lack of a native scroll is one of my biggest frustrations with Adobe AIR, and I've already lost countless hours with the workaround StageWebView implementation, which still is giving me some problems.

Here's the "native scroll" feature request at bugbase:

https://bugbase.adobe.com/index.cfm?event=bug&id=2958123

I hope more developers get interested in this.

BTW, I think StageWebView should implement easier communication with JavaScript, like the one provided by the third party StageWebViewBridge library (http://code.google.com/p/stagewebviewbridge/), since most of the times you need a StageWebView, you'll also need to add some interactivity with the AIR application (except if you just use it for HTML banners/admobs).

Participating Frequently
September 4, 2011

I too think a Native Scroll is a needed feature.  my experience ...

  • I am using Air 2.6, CS5.5  (tried AIR 2.7, however I lost some key features in a particular IOS app that I made and reverted back to 2.6)
  • experimented with a variety of scroll techniques, even the TLF textfield, and found the more smooth, the more cumbersome it was, however none were smooth enough
  • came across your notes on StageWebViewBridge and considered that until I noticed
    • on a new Galaxy Tab 10.1 Android Honeycomb, StageWebView actually jerks. I notice this on my apps and on other people's MarketPlace apps
    • side by side with an IPAD(1), the IPAD/Air 2.6 shows off what the smoothness should be like, the StageWebView in IPAD is flawless and even does the bounce at the top of the page and at the bottom of the page, like both IOS and Android default browsers do.
    • implied is that the default browser in the Galaxy/Android is perfectly smooth.
    • unsure if I'm missing something on this, I tried auto, CPU, GPU, and making StageWebView full screen on my simple app with no difference but like I said I am noticing this fairly modest jerk in another developers apps
    • I hadn't noticed this earlier on a small Dell Streak device because it's so much smaller a screen, but when I look close now, the jerk is there as well
  • as a result I would wonder if the StageWebViewBridge would be equally problematic for me...  bottom line is that I've cancelled smooth scrolling for now, rationalizing also that I find it a bit neurotic (fun but you actually have to work harder at knowing what you've flipped past or towards) and there is already enough of it on the devices and Flash does some cool stuff that I can live without it until it becomes easy to implement.

my2cents!