Layering Mobile Controls

Ender Nafi Elekçioğlu endernafi at gmail.com
Sat Mar 2 15:02:06 EST 2013


Hi all,  


Is there any workaround to use two different mobile controls whose "rect" properties are same?
Here is the case:
I have three fullscreen browser controls {created by *mobileControlCreate "browser"* command},
the left and right controls are outside of the screen {something like this: http://cloud.keehuna.com/image/3c0i0z0t2F1E}

And I want to switch between them via a native scroller {created by *mobileControlCreate "scroller"* command},
my code is something like this:

on scrollerDidScroll pX, pY
__switch mobileControlTarget()
____case "theScroller"
________/* you should reverse the direction and get rid of static values */
______put (pX - 960) & comma & 40 & comma & (pX - 480) & comma & 280 into tRectL
______put (pX - 480) & comma & 40 & comma & pX & comma & 280 into tRectC
______put pX & comma & 40 & comma & (pX + 480) & comma & 280 into tRectR
_      
______set the text of field "scrollValues" to pX & " - " & pY & return & tRectL && tRectC && tRectR
_
______mobileControlSet "theBrowserL", "rect", tRectL
______mobileControlSet "theBrowserC", "rect", tRectC
______mobileControlSet "theBrowserR", "rect", tRectR
______break
__end switch
end scrollerDidScroll



Well, of course it doesn't work because the browser control is blocking the scroller control.
The touch events can't pass through the browser and reach to the scroller.

I can always squeeze the browser control's height and leave some space at the bottom to the scroller.
But it's a very bad design both from a visual and functional perspective.

Another method is not to use the scroller control
and inject jqueryMobile and an appropriate swipe command into the html file via script.
But this method works only on local html files not with online webpages.


Any insights & thoughts about this?


Best,

~ Ender Nafi



~ ·  Keehuna Studio  
~ ·  Sorcerers of Design




More information about the use-livecode mailing list