mobileSetAllowedOrientations Problem

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
gshearne
Posts: 36
Joined: Mon Jun 02, 2014 4:41 am

mobileSetAllowedOrientations Problem

Post by gshearne » Mon Jul 14, 2014 9:55 pm

Hi,
The code snippet below is causing me problems. It was working fine and I have not made any changes. Does anyone see an issue.

The error I get is:
stack "Alfabe Kreyol": execution error at line 2 (Handler: can't find handler) near "mobileSetAllowedOrientations", char 1

on preOpenStack
mobileSetAllowedOrientations landscape
set the fullscreenmode of this stack to "exactFit"
end preOpenStack

I have also tried:
on preOpenStack
mobileSetAllowedOrientations "landscape left"
set the fullscreenmode of this stack to "exactFit"
end preOpenStack

Thanks !!

LCNeil
Livecode Staff Member
Livecode Staff Member
Posts: 1223
Joined: Wed Oct 03, 2012 4:07 pm

Re: mobileSetAllowedOrientations Problem

Post by LCNeil » Mon Jul 14, 2014 10:13 pm

Hi gshearne,

mobileSetAllowedOrientations is mobile specific syntax so running it on the desktop environment will throw an error.

You can add in some additional checks to bypass this script when not running on mobile. Something like the following will work-

Code: Select all

on preOpenStack
if the environment is "mobile" then
mobileSetAllowedOrientations landscape
end if
set the fullscreenmode of this stack to "exactFit"
end preOpenStack
let us know how you get on.

Kind Regards,


Neil Roger
--
LiveCode Support Team ~ http://www.livecode.com

gshearne
Posts: 36
Joined: Mon Jun 02, 2014 4:41 am

Re: mobileSetAllowedOrientations Problem

Post by gshearne » Mon Jul 14, 2014 11:19 pm

Thanks. That did the trick. Regards

Post Reply