Front and Back Scripts on Mobile
Sannyasin Brahmanathaswami
brahma at hindu.org
Sat Jul 2 00:42:33 EDT 2016
We are looking to use some back scripts on mobile.
If I add this to a backscript
command testMessagePath pMessage
answer pMessage with "OK"
end testMessagePath
Add this to either a back OR front script.
then add a button to the top of any card in the stack
testMessagePath "Got it"
save and reload the stack… it works on desktop, but not on mobile
OTOH some other commands in the back script *are* firing… because we have some set up functions that are not failing.
Are there caveats for using front and back scripts on mobile that we need understand?
BR
To add more failure points
this works if we put everything in the stack script of the stack that has the scrolling group. but if we move the "createScroller" and isMobile and scrollerDidScroll commands to the back or front script… they fail.
??
on opencard
set the vScroll of grp "portal-links" to 0 -- ensures correct initial alignment
createScroller "portal-links" -- replaces any existing one
end opencard
command CreateScroller pName -- scrolling fields
if not isMobile() then exit CreateScroller
deleteMobileControl pName -- delete any existing
put (the rect of control pName) into tRect
mobileControlCreate "scroller", pName
mobileControlSet pName, "rect", tRect
put ("0,0," & (the formattedwidth of control pName) & "," & the formattedheight of control pName) into tRect
mobileControlSet pName, "contentRect" , tRect
mobileControlSet pName, "hScroll" , 0
mobileControlSet pName, "vScroll" , 0
mobileControlSet pName, "hIndicator" , false
-- if pName = "quote" then
-- mobileControlSet pName, "vIndicator", true
-- end if
mobileControlSet pName, "visible", true
end CreateScroller
on scrollerDidScroll hScrolled, vScrolled
put mobileControlTarget() into tControlID
set the vscroll of control tControlID to vscrolled
pass scrollerDidScroll
end scrollerDidScroll
function isMobile -- jg, for convenience
return the environment is "mobile"
end isMobile
More information about the use-livecode
mailing list