Livecode Wiki
No edit summary
 
No edit summary
Tags: Visual edit apiedit
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Creates a native iOS or Android control.
+
Creates a native iOS or Android control.Syntax:
 
Syntax:
 
 
mobileControlCreate <nowiki><controlType></nowiki> [, <nowiki><controlName></nowiki> ]
 
mobileControlCreate <nowiki><controlType></nowiki> [, <nowiki><controlName></nowiki> ]
   
Line 15: Line 13:
 
mobileControlSet "myFirstPlayer", "visible", true
 
mobileControlSet "myFirstPlayer", "visible", true
 
mobileControlSet "myFirstPlayer", "rect", "50,50,500,500"
 
mobileControlSet "myFirstPlayer", "rect", "50,50,500,500"
mobileControlSet "myFirstPlayer", "filename", specialFolderPath("engine") \
+
mobileControlSet "myFirstPlayer", "filename", specialFolderPath("engine") & "/movie.mp4"
& "/movie.mp4"
 
 
mobileControlDo "myFirstPlayer", "play"
 
mobileControlDo "myFirstPlayer", "play"
   
Line 34: Line 31:
 
Parameters:
 
Parameters:
 
*controlType (enum): The type of control to create.
 
*controlType (enum): The type of control to create.
  +
**browser: Native iOS or Android web browser control
*- browser: Native iOS or Android web browser control - scroller: Native iOS or Android scroller control- player: Native iOS or Android player control- input: Native iOS or Android text input control- multiline: Native iOS or Android multi-line text control
 
  +
**scroller: Native iOS or Android scroller control
* controlName:Optional string to use to identify the control.The [[controlName]] must be unique amongst all existing controls and cannot be an integer.
 
  +
**player: Native iOS or Android player control
  +
**input: Native iOS or Android text input control
  +
**multiline: Native iOS or Android multi-line text control
 
* controlName:Optional string to use to identify the control.The ''controlName'' must be unique amongst all existing controls and cannot be an integer.
 
*The result: The unique (numeric) id for the new control is returned in[[the result]].
 
*The result: The unique (numeric) id for the new control is returned in[[the result]].
   

Latest revision as of 10:01, 13 September 2016

Creates a native iOS or Android control.Syntax:

mobileControlCreate <controlType> [, <controlName> ]

Examples:

mobileControlCreate "browser"
mobileControlCreate "scroller", "myFirstScroller"
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlCreate "player", "myFirstPlayer"
mobileControlSet "myFirstPlayer", "visible", true
mobileControlSet "myFirstPlayer", "rect", "50,50,500,500"
mobileControlSet "myFirstPlayer", "filename", specialFolderPath("engine") & "/movie.mp4"
mobileControlDo "myFirstPlayer", "play"
mobileControlCreate "multiline", "myMultiLineTextInput"

Low-level support has been added for creating and manipulating some native mobile controls (views) on iOS and Android.

Native mobile iOS and Android controllers can only be created dynamically in script.

To destroy a native control use: mobileControlDelete To configure a native control use: mobileControlSet To read a property of a native control use: mobileControlGet To control the behavior of a native control use: mobileControlDo

Parameters:

  • controlType (enum): The type of control to create.
    • browser: Native iOS or Android web browser control
    • scroller: Native iOS or Android scroller control
    • player: Native iOS or Android player control
    • input: Native iOS or Android text input control
    • multiline: Native iOS or Android multi-line text control
  • controlName:Optional string to use to identify the control.The controlName must be unique amongst all existing controls and cannot be an integer.
  • The result: The unique (numeric) id for the new control is returned inthe result.

See also: mobileControlSet (command),mobileControlGet (command),mobileControlGet (function),mobileControlTarget (function),the result (function),mobileControls (function),