change orientation on just one card

Thomas McGrath III mcgrath3 at mac.com
Wed Jun 12 08:17:43 EDT 2013


Apparently it seems that the mobileUnlockOrientation is needed to allow a card to auto rotate to the desired new set of orientations allowed (even though there was no mobileLockOrientation set before).


-- Tom McGrath III
http://lazyriver.on-rev.com
mcgrath3 at mac.com

On Jun 12, 2013, at 5:54 AM, Pierre Sahores <sc at sahores-conseil.com> wrote:

> Works fine here (LC 5.5.5) in using the following code to open a substack in landscape mode and return to portrait mode as soon as the app closes it and goes back to the main stack :
> 
> 1.- In the substack stack's script :
> 
>> on preopenStack
>>   if the environment is not "mobile" 
>>   then exit preopenStack
>>   else if "playerA" is in the short name of this stack
>>   then mobileSetAllowedOrientations "portrait,landscape left,landscape right"
>> end preopenStack
> 
> 2.- In the substack card's script :
> 
>> on preopencard
>>   mobileUnlockOrientation
>>   mobileSetAllowedOrientations "portrait,landscape left,landscape right"
>> end preopencard
>> 
>> on closeCard
>>   mobileSetAllowedOrientations "portrait"
>> end closeCard
> 
> 3.- In the mainstack stack's script : nothing
> 
> 4.- In the mainstack card's script : nothing
> 
> Both preopenStack and preopenCard are needed to get the mobileSetAllowedOrientations message being efficiently catched on both iOS and Android platforms.
> 
> 
> Le 12 juin 2013 à 05:17, Scott Rossi a écrit :
> 
>> Seems to work here in LC 5.5.3 (what I have handy).
>> 
>> Not sure if anything has changed in later versions.
>> 
>> Regards,
>> 
>> Scott Rossi
>> Creative Director
>> Tactile Media, UX/UI Design
>> 
>> 
>> 
>> 
>> On 6/11/13 6:40 PM, "Thomas McGrath III" <mcgrath3 at mac.com> wrote:
>> 
>>> Has anyone been successful in having just one card in an app be
>>> restricted to just landscape. I have an app that is supported for all
>>> orientations but for one card I want to restrict the allowed orientations
>>> to just landscape.
>>> 
>>> I tried this on the card I want to restrict but with no luck:
>>> on preopencard
>>>   if the environment is "mobile" then
>>>        mobileSetAllowedOrientations "landscape left,landscape right"
>>>   end if
>>> end preopencard
>>> 
>>> Is there a way to set the orientation when opening a card. I can't seem
>>> to discover any.
>>> 
>>> Tom
>>> 
>>> 
>>> -- Tom McGrath III
>>> http://lazyriver.on-rev.com
>>> mcgrath3 at mac.com
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> Pierre Sahores
> mobile : 06 03 95 77 70
> www.sahores-conseil.com
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list