<?xml version="1.0" encoding="UTF-8"?>
<book title="Learning Flash Lite 1.x ActionScript" directory="FlashLiteLearningAS1">
<page href="00005688.html" title="About Flash Lite 1.x ActionScript" text="About Flash Lite 1.x ActionScript You use ActionScript to add programming logic and interactivity to your Adobe&#174; Flash&#174; Lite&#8482; applications. The version of ActionScript in Macromedia&#174; Flash&#174; Lite&#8482; 1.0 and Macromedia&#174; Flash &#174; Lite&#8482;1.1 software from Adobe--referred to collectively as Flash Lite 1.x ActionScript--is a hybrid of Adobe's Macromedia&#174; Flash&#174; 4 ActionScript, plus additional commands and properties specific the Flash Lite player, such as the ability to initiate phone calls or text messages, or get time and date information from the device. This chapter contains the following topics: Flash Lite 1.x ActionScript overview Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript Features not available in Flash Lite 1.x ActionScript About Flash Lite 1.x ActionScript You use ActionScript to add programming logic and interactivity to your Adobe&#174; Flash&#174; Lite&#8482; applications. The version of ActionScript in Macromedia&#174; Flash&#174; Lite&#8482; 1.0 and Macromedia&#174; Flash &#174; Lite&#8482;1.1 software from Adobe--referred to collectively as Flash Lite 1.x ActionScript--is a hybrid of Adobe's Macromedia&#174; Flash&#174; 4 ActionScript, plus additional commands and properties specific the Flash Lite player, such as the ability to initiate phone calls or text messages, or get time and date information from the device. This chapter contains the following topics: Flash Lite 1.x ActionScript overview Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript Features not available in Flash Lite 1.x ActionScript About Flash Lite 1.x ActionScript You use ActionScript to add programming logic and interactivity to your Adobe&#174; Flash&#174; Lite&#8482; applications. The version of ActionScript in Macromedia&#174; Flash&#174; Lite&#8482; 1.0 and Macromedia&#174; Flash &#174; Lite&#8482;1.1 software from Adobe--referred to collectively as Flash Lite 1.x ActionScript--is a hybrid of Adobe's Macromedia&#174; Flash&#174; 4 ActionScript, plus additional commands and properties specific the Flash Lite player, such as the ability to initiate phone calls or text messages, or get time and date information from the device. This chapter contains the following topics: Flash Lite 1.x ActionScript overview Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript Features not available in Flash Lite 1.x ActionScript " />
<page href="00005689.html" title="Flash Lite 1.x ActionScript overview" text="Flash Lite 1.x ActionScript overview Flash Lite 1.x ActionScript consists of the following parts: Flash Player 4 ActionScript&#160;This includes operators (for example, comparison and assignment operators), movie clip properties (for example, _height, _x, and _y), Timeline control functions (for example, gotoAndPlay() or stop()), and network functions, such as the loadVariables() and loadMovie() functions (Flash Lite 1.1 only). For a list of unsupported Flash 4 ActionScript, see Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript. Phone integration commands and properties&#160;Flash Lite provides commands that let you, for example, query the date and time information from the device, initiate a phone call or short message service (SMS) text message, or start external applications installed on the&#160;device. Platform capability variables (Flash Lite 1.1 only)&#160;These properties provide information about the capabilities of the device or Flash Lite runtime environment. For example, the _capLoadData variable indicates if your application can load data over the network. fscommand2() function&#160;Like the fscommand() function, you use fscommand2() to communicate with the host environment or system--in this case, the mobile phone or device. The fscommand2() function provides enhancements to fscommand(), including the ability to pass an arbitrary number of arguments and to retrieve immediate return values (rather than having to wait until the next frame, as with fscommand()). Flash Lite 1.x ActionScript overview Flash Lite 1.x ActionScript consists of the following parts: Flash Player 4 ActionScript&#160;This includes operators (for example, comparison and assignment operators), movie clip properties (for example, _height, _x, and _y), Timeline control functions (for example, gotoAndPlay() or stop()), and network functions, such as the loadVariables() and loadMovie() functions (Flash Lite 1.1 only). For a list of unsupported Flash 4 ActionScript, see Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript. Phone integration commands and properties&#160;Flash Lite provides commands that let you, for example, query the date and time information from the device, initiate a phone call or short message service (SMS) text message, or start external applications installed on the&#160;device. Platform capability variables (Flash Lite 1.1 only)&#160;These properties provide information about the capabilities of the device or Flash Lite runtime environment. For example, the _capLoadData variable indicates if your application can load data over the network. fscommand2() function&#160;Like the fscommand() function, you use fscommand2() to communicate with the host environment or system--in this case, the mobile phone or device. The fscommand2() function provides enhancements to fscommand(), including the ability to pass an arbitrary number of arguments and to retrieve immediate return values (rather than having to wait until the next frame, as with fscommand()). Flash Lite 1.x ActionScript overview Flash Lite 1.x ActionScript consists of the following parts: Flash Player 4 ActionScript&#160;This includes operators (for example, comparison and assignment operators), movie clip properties (for example, _height, _x, and _y), Timeline control functions (for example, gotoAndPlay() or stop()), and network functions, such as the loadVariables() and loadMovie() functions (Flash Lite 1.1 only). For a list of unsupported Flash 4 ActionScript, see Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript. Phone integration commands and properties&#160;Flash Lite provides commands that let you, for example, query the date and time information from the device, initiate a phone call or short message service (SMS) text message, or start external applications installed on the&#160;device. Platform capability variables (Flash Lite 1.1 only)&#160;These properties provide information about the capabilities of the device or Flash Lite runtime environment. For example, the _capLoadData variable indicates if your application can load data over the network. fscommand2() function&#160;Like the fscommand() function, you use fscommand2() to communicate with the host environment or system--in this case, the mobile phone or device. The fscommand2() function provides enhancements to fscommand(), including the ability to pass an arbitrary number of arguments and to retrieve immediate return values (rather than having to wait until the next frame, as with fscommand()). " />
<page href="00005690.html" title="Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript" text="Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript The following Flash Lite 1.1 ActionScript features are not available in Flash Lite 1.0: Network access or network status information. For example, in Flash Lite 1.0 you cannot use the loadVariables() or loadMovie() functions to load external data or SWF files, or the various fscommand2() commands for determining a device's connection signal strength or the status of a network request. Getting time and date information from the device. Platform capability variables, which provide information about the capabilities of the Flash Lite platform and of the device. The fscommand2() function and its associated commands, such as SetSoftKeys and FullScreen. The scroll and maxscroll text field properties. Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript The following Flash Lite 1.1 ActionScript features are not available in Flash Lite 1.0: Network access or network status information. For example, in Flash Lite 1.0 you cannot use the loadVariables() or loadMovie() functions to load external data or SWF files, or the various fscommand2() commands for determining a device's connection signal strength or the status of a network request. Getting time and date information from the device. Platform capability variables, which provide information about the capabilities of the Flash Lite platform and of the device. The fscommand2() function and its associated commands, such as SetSoftKeys and FullScreen. The scroll and maxscroll text field properties. Differences between Flash Lite 1.0 and Flash Lite 1.1 ActionScript The following Flash Lite 1.1 ActionScript features are not available in Flash Lite 1.0: Network access or network status information. For example, in Flash Lite 1.0 you cannot use the loadVariables() or loadMovie() functions to load external data or SWF files, or the various fscommand2() commands for determining a device's connection signal strength or the status of a network request. Getting time and date information from the device. Platform capability variables, which provide information about the capabilities of the Flash Lite platform and of the device. The fscommand2() function and its associated commands, such as SetSoftKeys and FullScreen. The scroll and maxscroll text field properties. " />
<page href="00005691.html" title="Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript" text="Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript The following Flash 4 ActionScript features are unsupported, or only partially supported, in Flash Lite 1.x ActionScript: The startDrag() and stopDrag() functions. Flash Lite 1.x ActionScript supports a subset of the button events supported in Flash Player 4. For more information about handling button events, see Creating Interactivity and Navigation in Developing Flash Lite Applications. Flash Lite 1.x ActionScript supports a subset of key events supported in Flash Player 4. For more information about supported key events in Flash Lite, see Creating Interactivity and Navigation in Developing Flash Lite Applications. The _dropTarget property. The _soundBufTime property. The _url property. The String() conversion function. Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript The following Flash 4 ActionScript features are unsupported, or only partially supported, in Flash Lite 1.x ActionScript: The startDrag() and stopDrag() functions. Flash Lite 1.x ActionScript supports a subset of the button events supported in Flash Player 4. For more information about handling button events, see Creating Interactivity and Navigation in Developing Flash Lite Applications. Flash Lite 1.x ActionScript supports a subset of key events supported in Flash Player 4. For more information about supported key events in Flash Lite, see Creating Interactivity and Navigation in Developing Flash Lite Applications. The _dropTarget property. The _soundBufTime property. The _url property. The String() conversion function. Flash 4 ActionScript not supported by Flash Lite 1.x ActionScript The following Flash 4 ActionScript features are unsupported, or only partially supported, in Flash Lite 1.x ActionScript: The startDrag() and stopDrag() functions. Flash Lite 1.x ActionScript supports a subset of the button events supported in Flash Player 4. For more information about handling button events, see Creating Interactivity and Navigation in Developing Flash Lite Applications. Flash Lite 1.x ActionScript supports a subset of key events supported in Flash Player 4. For more information about supported key events in Flash Lite, see Creating Interactivity and Navigation in Developing Flash Lite Applications. The _dropTarget property. The _soundBufTime property. The _url property. The String() conversion function. " />
<page href="00005692.html" title="Features not available in Flash Lite 1.x ActionScript" text="Features not available in Flash Lite 1.x ActionScript Because Flash Lite player is based on an older version of Flash Player, it does not support all the programming features available in more recent releases of Flash Player or other programming languages that you might be familiar with. This section discusses programming features not available in Flash Lite 1.x ActionScript and available alternatives and work-arounds. User-defined functions&#160;Flash Lite 1.x does not support the ability to define and call custom functions. However, you can use the call() function to execute code that resides on an arbitrary frame in the timeline. For more information, see Using the call() function to create functions. Native arrays, objects, or other complex data types&#160;Flash Lite 1.x does not support native array data structures or other complete data types. However, you can emulate arrays using pseudo-arrays, a technique that involves using the eval() function to dynamically evaluate concatenated strings. For more information, see Emulating arrays. Runtime loading of external image or sound files&#160;Unlike the desktop version of Flash Player, Flash Lite 1.x ActionScript cannot load external JPEG files or MP3 files. In Flash Lite 1.1 you can use the loadMovie() function to load external SWF files. For more information, see Loading external SWF files. Features not available in Flash Lite 1.x ActionScript Because Flash Lite player is based on an older version of Flash Player, it does not support all the programming features available in more recent releases of Flash Player or other programming languages that you might be familiar with. This section discusses programming features not available in Flash Lite 1.x ActionScript and available alternatives and work-arounds. User-defined functions&#160;Flash Lite 1.x does not support the ability to define and call custom functions. However, you can use the call() function to execute code that resides on an arbitrary frame in the timeline. For more information, see Using the call() function to create functions. Native arrays, objects, or other complex data types&#160;Flash Lite 1.x does not support native array data structures or other complete data types. However, you can emulate arrays using pseudo-arrays, a technique that involves using the eval() function to dynamically evaluate concatenated strings. For more information, see Emulating arrays. Runtime loading of external image or sound files&#160;Unlike the desktop version of Flash Player, Flash Lite 1.x ActionScript cannot load external JPEG files or MP3 files. In Flash Lite 1.1 you can use the loadMovie() function to load external SWF files. For more information, see Loading external SWF files. Features not available in Flash Lite 1.x ActionScript Because Flash Lite player is based on an older version of Flash Player, it does not support all the programming features available in more recent releases of Flash Player or other programming languages that you might be familiar with. This section discusses programming features not available in Flash Lite 1.x ActionScript and available alternatives and work-arounds. User-defined functions&#160;Flash Lite 1.x does not support the ability to define and call custom functions. However, you can use the call() function to execute code that resides on an arbitrary frame in the timeline. For more information, see Using the call() function to create functions. Native arrays, objects, or other complex data types&#160;Flash Lite 1.x does not support native array data structures or other complete data types. However, you can emulate arrays using pseudo-arrays, a technique that involves using the eval() function to dynamically evaluate concatenated strings. For more information, see Emulating arrays. Runtime loading of external image or sound files&#160;Unlike the desktop version of Flash Player, Flash Lite 1.x ActionScript cannot load external JPEG files or MP3 files. In Flash Lite 1.1 you can use the loadMovie() function to load external SWF files. For more information, see Loading external SWF files. " />
<page href="00005693.html" title="Flash 4 ActionScript Primer" text="Flash 4 ActionScript Primer Macromedia Flash Lite 1.x ActionScript from Adobe is based on the version of ActionScript that was first available in Macromedia Flash Player 4 from Adobe. Consequently, several programming features available in later versions of Flash Player (for desktop systems) are not available to Flash Lite 1.x applications. If you're unfamiliar with Flash 4 ActionScript syntax and features or if you've forgotten some of the details from previous Flash development work, this chapter provides a primer on using Flash 4 ActionScript in your Flash Lite applications. This chapter contains the following topics: Getting and setting movie clip properties Controlling other timelines Using variables Emulating arrays Working with text and strings Using the call() function to create functions Using the eval() function Flash 4 ActionScript Primer Macromedia Flash Lite 1.x ActionScript from Adobe is based on the version of ActionScript that was first available in Macromedia Flash Player 4 from Adobe. Consequently, several programming features available in later versions of Flash Player (for desktop systems) are not available to Flash Lite 1.x applications. If you're unfamiliar with Flash 4 ActionScript syntax and features or if you've forgotten some of the details from previous Flash development work, this chapter provides a primer on using Flash 4 ActionScript in your Flash Lite applications. This chapter contains the following topics: Getting and setting movie clip properties Controlling other timelines Using variables Emulating arrays Working with text and strings Using the call() function to create functions Using the eval() function Flash 4 ActionScript Primer Macromedia Flash Lite 1.x ActionScript from Adobe is based on the version of ActionScript that was first available in Macromedia Flash Player 4 from Adobe. Consequently, several programming features available in later versions of Flash Player (for desktop systems) are not available to Flash Lite 1.x applications. If you're unfamiliar with Flash 4 ActionScript syntax and features or if you've forgotten some of the details from previous Flash development work, this chapter provides a primer on using Flash 4 ActionScript in your Flash Lite applications. This chapter contains the following topics: Getting and setting movie clip properties Controlling other timelines Using variables Emulating arrays Working with text and strings Using the call() function to create functions Using the eval() function " />
<page href="00005694.html" title="Getting and setting movie clip properties" text="Getting and setting movie clip properties To get or set a movie clip property (if settable), you can use dot syntax or the setProperty() or getProperty() functions. You can also use the tellTarget() function. To use dot syntax, specify the movie clip instance name, followed by a dot (.) and then the property name. For example, the following code gets the x screen coordinate (represented by the _x movie clip property) of the movie clip named cartoonArea, and assigns the result to a variable named x_pos. x_pos = cartoonArea._x; The following example is equivalent to the previous example, but uses the getProperty() function to retrieve the movie clip's x position: x_pos = getProperty(cartoonArea, _x The setProperty() function lets you set a property of a movie clip instance, as shown in the following example: setProperty(cartoonArea, _x, 100 The following example is equivalent to the previous example but uses dot syntax: cartoonArea._x = 100; You can also get or set movie clip properties from within a tellTarget() statement. The following code is equivalent to the setProperty() example shown previously: tellTarget(&quot;/cartoonArea&quot;) {  _x = 100; } For more information about the tellTarget() function, see Controlling other timelines. Getting and setting movie clip properties To get or set a movie clip property (if settable), you can use dot syntax or the setProperty() or getProperty() functions. You can also use the tellTarget() function. To use dot syntax, specify the movie clip instance name, followed by a dot (.) and then the property name. For example, the following code gets the x screen coordinate (represented by the _x movie clip property) of the movie clip named cartoonArea, and assigns the result to a variable named x_pos. x_pos = cartoonArea._x; The following example is equivalent to the previous example, but uses the getProperty() function to retrieve the movie clip's x position: x_pos = getProperty(cartoonArea, _x The setProperty() function lets you set a property of a movie clip instance, as shown in the following example: setProperty(cartoonArea, _x, 100 The following example is equivalent to the previous example but uses dot syntax: cartoonArea._x = 100; You can also get or set movie clip properties from within a tellTarget() statement. The following code is equivalent to the setProperty() example shown previously: tellTarget(&quot;/cartoonArea&quot;) {  _x = 100; } For more information about the tellTarget() function, see Controlling other timelines. Getting and setting movie clip properties To get or set a movie clip property (if settable), you can use dot syntax or the setProperty() or getProperty() functions. You can also use the tellTarget() function. To use dot syntax, specify the movie clip instance name, followed by a dot (.) and then the property name. For example, the following code gets the x screen coordinate (represented by the _x movie clip property) of the movie clip named cartoonArea, and assigns the result to a variable named x_pos. x_pos = cartoonArea._x; The following example is equivalent to the previous example, but uses the getProperty() function to retrieve the movie clip's x position: x_pos = getProperty(cartoonArea, _x The setProperty() function lets you set a property of a movie clip instance, as shown in the following example: setProperty(cartoonArea, _x, 100 The following example is equivalent to the previous example but uses dot syntax: cartoonArea._x = 100; You can also get or set movie clip properties from within a tellTarget() statement. The following code is equivalent to the setProperty() example shown previously: tellTarget(&quot;/cartoonArea&quot;) {  _x = 100; } For more information about the tellTarget() function, see Controlling other timelines. " />
<page href="00005695.html" title="Controlling other timelines" text="Controlling other timelines To specify a path to a timeline, use slash syntax (/) combined with dots (..) to build the path reference. You can also use _levelN, _root, or _parent from Flash 5 notation to refer to, respectively, a specific movie level, the application's root timeline, or the parent timeline. For example, suppose you had a movie clip instance named box on your SWF file's main timeline. The box instance, in turn, contains another movie clip instance named cards. The following examples target the movie clip cards from the main timeline: tellTarget(&quot;/box/cards&quot;) tellTarget(&quot;_level0/box/cards&quot;) The following example targets the main timeline from the movie clip cards: tellTarget(&quot;../../cards&quot;) tellTarget(&quot;_root&quot;) The following example targets the parent movie clip cards:  tellTarget(&quot;../cards&quot;) tellTarget(&quot;_parent/cards&quot;) Controlling other timelines To specify a path to a timeline, use slash syntax (/) combined with dots (..) to build the path reference. You can also use _levelN, _root, or _parent from Flash 5 notation to refer to, respectively, a specific movie level, the application's root timeline, or the parent timeline. For example, suppose you had a movie clip instance named box on your SWF file's main timeline. The box instance, in turn, contains another movie clip instance named cards. The following examples target the movie clip cards from the main timeline: tellTarget(&quot;/box/cards&quot;) tellTarget(&quot;_level0/box/cards&quot;) The following example targets the main timeline from the movie clip cards: tellTarget(&quot;../../cards&quot;) tellTarget(&quot;_root&quot;) The following example targets the parent movie clip cards:  tellTarget(&quot;../cards&quot;) tellTarget(&quot;_parent/cards&quot;) Controlling other timelines To specify a path to a timeline, use slash syntax (/) combined with dots (..) to build the path reference. You can also use _levelN, _root, or _parent from Flash 5 notation to refer to, respectively, a specific movie level, the application's root timeline, or the parent timeline. For example, suppose you had a movie clip instance named box on your SWF file's main timeline. The box instance, in turn, contains another movie clip instance named cards. The following examples target the movie clip cards from the main timeline: tellTarget(&quot;/box/cards&quot;) tellTarget(&quot;_level0/box/cards&quot;) The following example targets the main timeline from the movie clip cards: tellTarget(&quot;../../cards&quot;) tellTarget(&quot;_root&quot;) The following example targets the parent movie clip cards:  tellTarget(&quot;../cards&quot;) tellTarget(&quot;_parent/cards&quot;) " />
<page href="00005696.html" title="Using variables" text="Using variables To specify a variable on a timeline, use slash syntax (/) combined with dots (..) and colons (:). You can also use the dot notation. The following code refers to the car variable on the main timeline: /:car _root.car The following example shows the car variable in a movie clip instance that resides on the main timeline: /mc1/mc2/:car _root.mc1.mc2.car The following example shows the car variable in a movie clip instance that resides on the current timeline: mc2/:car mc2.car Using variables To specify a variable on a timeline, use slash syntax (/) combined with dots (..) and colons (:). You can also use the dot notation. The following code refers to the car variable on the main timeline: /:car _root.car The following example shows the car variable in a movie clip instance that resides on the main timeline: /mc1/mc2/:car _root.mc1.mc2.car The following example shows the car variable in a movie clip instance that resides on the current timeline: mc2/:car mc2.car Using variables To specify a variable on a timeline, use slash syntax (/) combined with dots (..) and colons (:). You can also use the dot notation. The following code refers to the car variable on the main timeline: /:car _root.car The following example shows the car variable in a movie clip instance that resides on the main timeline: /mc1/mc2/:car _root.mc1.mc2.car The following example shows the car variable in a movie clip instance that resides on the current timeline: mc2/:car mc2.car " />
<page href="00005697.html" title="Emulating arrays" text="Emulating arrays Arrays are useful for creating and manipulating ordered lists of information such as variables and values. However, Flash Lite 1.1 does not support native array data structures. A common technique in Flash Lite (and Flash 4) programming is to emulate arrays with string processing. An emulated array is also called a pseudo-array. The key to pseudo-array processing is the eval() ActionScript function, which lets you access variables, properties, or movie clips by name. For more information, see Using the eval() function. A pseudo-array typically consists of two or more variables that share the same base name, followed by a numeric suffix. The suffix is the index for each array element. For example, suppose you create the following ActionScript variables: color_1 = &quot;orange&quot;; color_2 = &quot;green&quot;; color_3 = &quot;blue&quot;; color_4 = &quot;red&quot;; You can then use the following code to loop over the elements in the pseudo-array:  for (i = 1; i &lt;=4; i++) {  trace (eval (&quot;color_&quot; add i) } In addition to letting you reference existing variables, you can also use the eval() function on the left side of a variable assignment to create variables at runtime. For example, suppose you want to maintain a list of high scores as a user plays a game. Each time the user completes a turn, you add their score to the list: eval(&quot;highScore&quot; add scoreIndex) = currentScore; scoreIndex++; Each time this code executes, it adds a new item to the list of high scores and then increments the scoreIndex variable, which determines each item's index in the list. For instance, you might end up with the following variables: highScore1 = 2000 highScore2 = 1500 highScore3 = 3000 Emulating arrays Arrays are useful for creating and manipulating ordered lists of information such as variables and values. However, Flash Lite 1.1 does not support native array data structures. A common technique in Flash Lite (and Flash 4) programming is to emulate arrays with string processing. An emulated array is also called a pseudo-array. The key to pseudo-array processing is the eval() ActionScript function, which lets you access variables, properties, or movie clips by name. For more information, see Using the eval() function. A pseudo-array typically consists of two or more variables that share the same base name, followed by a numeric suffix. The suffix is the index for each array element. For example, suppose you create the following ActionScript variables: color_1 = &quot;orange&quot;; color_2 = &quot;green&quot;; color_3 = &quot;blue&quot;; color_4 = &quot;red&quot;; You can then use the following code to loop over the elements in the pseudo-array:  for (i = 1; i &lt;=4; i++) {  trace (eval (&quot;color_&quot; add i) } In addition to letting you reference existing variables, you can also use the eval() function on the left side of a variable assignment to create variables at runtime. For example, suppose you want to maintain a list of high scores as a user plays a game. Each time the user completes a turn, you add their score to the list: eval(&quot;highScore&quot; add scoreIndex) = currentScore; scoreIndex++; Each time this code executes, it adds a new item to the list of high scores and then increments the scoreIndex variable, which determines each item's index in the list. For instance, you might end up with the following variables: highScore1 = 2000 highScore2 = 1500 highScore3 = 3000 Emulating arrays Arrays are useful for creating and manipulating ordered lists of information such as variables and values. However, Flash Lite 1.1 does not support native array data structures. A common technique in Flash Lite (and Flash 4) programming is to emulate arrays with string processing. An emulated array is also called a pseudo-array. The key to pseudo-array processing is the eval() ActionScript function, which lets you access variables, properties, or movie clips by name. For more information, see Using the eval() function. A pseudo-array typically consists of two or more variables that share the same base name, followed by a numeric suffix. The suffix is the index for each array element. For example, suppose you create the following ActionScript variables: color_1 = &quot;orange&quot;; color_2 = &quot;green&quot;; color_3 = &quot;blue&quot;; color_4 = &quot;red&quot;; You can then use the following code to loop over the elements in the pseudo-array:  for (i = 1; i &lt;=4; i++) {  trace (eval (&quot;color_&quot; add i) } In addition to letting you reference existing variables, you can also use the eval() function on the left side of a variable assignment to create variables at runtime. For example, suppose you want to maintain a list of high scores as a user plays a game. Each time the user completes a turn, you add their score to the list: eval(&quot;highScore&quot; add scoreIndex) = currentScore; scoreIndex++; Each time this code executes, it adds a new item to the list of high scores and then increments the scoreIndex variable, which determines each item's index in the list. For instance, you might end up with the following variables: highScore1 = 2000 highScore2 = 1500 highScore3 = 3000 " />
<page href="00005698.html" title="Working with text and strings" text="Working with text and strings Flash Lite provides some basic ActionScript commands and properties for working with text. You can get and set the values of text fields, concatenate strings, URL-encode or URL-decode text strings, and create scrolling text fields. This section contains the following topics: Concatenating strings Scrolling text Working with text and strings Flash Lite provides some basic ActionScript commands and properties for working with text. You can get and set the values of text fields, concatenate strings, URL-encode or URL-decode text strings, and create scrolling text fields. This section contains the following topics: Concatenating strings Scrolling text Working with text and strings Flash Lite provides some basic ActionScript commands and properties for working with text. You can get and set the values of text fields, concatenate strings, URL-encode or URL-decode text strings, and create scrolling text fields. This section contains the following topics: Concatenating strings Scrolling text " />
<page href="00005699.html" title="Concatenating strings" text="Concatenating strings To concatenate strings in Flash Lite, you use the add operator, as the following example shows: city = &quot;Boston&quot;; team = &quot;Red Sox&quot;; fullName = city add &quot; &quot; add team; // Result: // fullName = &quot;Boston Red Sox&quot; Concatenating strings To concatenate strings in Flash Lite, you use the add operator, as the following example shows: city = &quot;Boston&quot;; team = &quot;Red Sox&quot;; fullName = city add &quot; &quot; add team; // Result: // fullName = &quot;Boston Red Sox&quot; Concatenating strings To concatenate strings in Flash Lite, you use the add operator, as the following example shows: city = &quot;Boston&quot;; team = &quot;Red Sox&quot;; fullName = city add &quot; &quot; add team; // Result: // fullName = &quot;Boston Red Sox&quot; " />
<page href="00005700.html" title="Scrolling text" text="Scrolling text You can use the scroll property of dynamic and input text fields to get or set the field's current scroll position. You can also use the maxscroll position to determine a text field's current scroll position relative to the maximum scroll position. For an example of how to create a scrolling text field, see Creating scrolling text in Developing Flash Lite Applications. Scrolling text You can use the scroll property of dynamic and input text fields to get or set the field's current scroll position. You can also use the maxscroll position to determine a text field's current scroll position relative to the maximum scroll position. For an example of how to create a scrolling text field, see Creating scrolling text in Developing Flash Lite Applications. Scrolling text You can use the scroll property of dynamic and input text fields to get or set the field's current scroll position. You can also use the maxscroll position to determine a text field's current scroll position relative to the maximum scroll position. For an example of how to create a scrolling text field, see Creating scrolling text in Developing Flash Lite Applications. " />
<page href="00005701.html" title="Using the call() function to create functions" text="Using the call() function to create functions You can't define or call custom functions in Flash Lite as you can in Flash Player 5 and later. However, you can use the call() ActionScript function to execute code that resides on an arbitrary frame in the timeline. This technique lets you encapsulate commonly used code in a single location, making it easier to maintain.  The call() function takes a frame number or frame label as a parameter. For example, the following ActionScript calls the code located on the frame labeled moveUp:  call(&quot;moveUp&quot; The call() function operates synchronously; any ActionScript that follows a call() function call won't execute until all of the ActionScript on the specified frame finishes executing.  To call ActionScript on another frame: In a new Flash document, insert a keyframe on Frame 10. With the new keyframe selected, open the Actions panel (Window &gt; Actions), and type the following code: trace(&quot;Hello from frame 10&quot; Select the keyframe on Frame 1, and in the Actions panel, type the following code: stop( call(10 This code stops the playhead on Frame 1, and then calls the code on Frame 10. Test the application in Adobe&#174; Device Central&#8482;.  You should see &quot;Hello from frame 10&quot; displayed in the emulator.  You can also call code that resides on another timeline, such as a movie clip's timeline. To execute the code, specify the movie clip instance name followed by a colon, and then the frame number or label. For example, the following ActionScript calls the code that resides on the frame labeled moveUp in the movie clip instance named callClip: call(&quot;callClip:moveUp&quot; This technique is often used to create call clips or function clips--movie clips whose sole purpose is to encapsulate regularly used code. A call clip contains a keyframe for each function you want to create. You typically label each keyframe according to its purpose. Adobe also recommends that you create a new layer for each new keyframe, and that you give each layer the same name as the frame label you assign to the keyframe.  The following figure shows the Timeline of an example call clip. The first keyframe of a call clip always contains a stop() action, which ensures that the playhead doesn't continually loop over the frames in its Timeline. Subsequent keyframes contain code for each &quot;function.&quot; Each function keyframe is labeled to identify what it does. To make editing and viewing the call clip easier, each function keyframe is typically inserted on a separate layer. The following procedure explains how to create and use a call clip.  To create and use a call clip: In Adobe&#174; Flash&#174; CS3, create a new document from the Flash Lite 1.1 Symbian Series 60 document template. Select Insert &gt; New Symbol. In the Create New Symbol dialog box, type Call Clip in the Name text box, and then click&#160;OK. The movie clip opens in editing mode. Click the Add New Layer button the Timeline window twice to insert two new layers. Name the top layer Actions, the second layer function1, and the third layer function2. Insert a keyframe on Frame 2 of the function1 layer, and another keyframe on Frame 3 of the function2 layer, as the following figure shows: Select the keyframe on the Actions layer and open the Actions panel. Add a stop() action to the Actions panel. Select the keyframe on Frame 2 of the function1 layer and do the following: In the Property inspector, type function1 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function1 was called.&quot; Select the keyframe on Frame 3 of the function2 layer and do the following: In the Property inspector, type function2 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function2 was called.&quot; Press Control+E (Windows) or Command+E (Macintosh) to return to the main Timeline. Set your document's view to include the work area around the Stage by selecting View &gt; Work Area. Because the call clip doesn't need to be visible to the user, you can place it in the work area. Open the Library panel (Window &gt; Library) and drag the Call Clip symbol to the work area around the Stage. The call clip doesn't contain any visual elements so it appears on the Stage as a small circle, representing the movie clip's registration point. In the Property inspector, type callClip in the Instance Name text box. In the Timeline, select Frame 1 on the layer named ActionScript. In the Actions panel, enter the following code: call(&quot;callClip:function1&quot; call(&quot;callClip:function2&quot; Test your application in the emulator (Control &gt; Test Movie). You should see the following text: function1 was called. function2 was called.   To make your call clip more easily identifiable on the Stage, add some text or other visual element to the first keyframe in the call clip's Timeline.  Using the call() function to create functions You can't define or call custom functions in Flash Lite as you can in Flash Player 5 and later. However, you can use the call() ActionScript function to execute code that resides on an arbitrary frame in the timeline. This technique lets you encapsulate commonly used code in a single location, making it easier to maintain.  The call() function takes a frame number or frame label as a parameter. For example, the following ActionScript calls the code located on the frame labeled moveUp:  call(&quot;moveUp&quot; The call() function operates synchronously; any ActionScript that follows a call() function call won't execute until all of the ActionScript on the specified frame finishes executing.  To call ActionScript on another frame: In a new Flash document, insert a keyframe on Frame 10. With the new keyframe selected, open the Actions panel (Window &gt; Actions), and type the following code: trace(&quot;Hello from frame 10&quot; Select the keyframe on Frame 1, and in the Actions panel, type the following code: stop( call(10 This code stops the playhead on Frame 1, and then calls the code on Frame 10. Test the application in Adobe&#174; Device Central&#8482;.  You should see &quot;Hello from frame 10&quot; displayed in the emulator.  You can also call code that resides on another timeline, such as a movie clip's timeline. To execute the code, specify the movie clip instance name followed by a colon, and then the frame number or label. For example, the following ActionScript calls the code that resides on the frame labeled moveUp in the movie clip instance named callClip: call(&quot;callClip:moveUp&quot; This technique is often used to create call clips or function clips--movie clips whose sole purpose is to encapsulate regularly used code. A call clip contains a keyframe for each function you want to create. You typically label each keyframe according to its purpose. Adobe also recommends that you create a new layer for each new keyframe, and that you give each layer the same name as the frame label you assign to the keyframe.  The following figure shows the Timeline of an example call clip. The first keyframe of a call clip always contains a stop() action, which ensures that the playhead doesn't continually loop over the frames in its Timeline. Subsequent keyframes contain code for each &quot;function.&quot; Each function keyframe is labeled to identify what it does. To make editing and viewing the call clip easier, each function keyframe is typically inserted on a separate layer. The following procedure explains how to create and use a call clip.  To create and use a call clip: In Adobe&#174; Flash&#174; CS3, create a new document from the Flash Lite 1.1 Symbian Series 60 document template. Select Insert &gt; New Symbol. In the Create New Symbol dialog box, type Call Clip in the Name text box, and then click&#160;OK. The movie clip opens in editing mode. Click the Add New Layer button the Timeline window twice to insert two new layers. Name the top layer Actions, the second layer function1, and the third layer function2. Insert a keyframe on Frame 2 of the function1 layer, and another keyframe on Frame 3 of the function2 layer, as the following figure shows: Select the keyframe on the Actions layer and open the Actions panel. Add a stop() action to the Actions panel. Select the keyframe on Frame 2 of the function1 layer and do the following: In the Property inspector, type function1 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function1 was called.&quot; Select the keyframe on Frame 3 of the function2 layer and do the following: In the Property inspector, type function2 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function2 was called.&quot; Press Control+E (Windows) or Command+E (Macintosh) to return to the main Timeline. Set your document's view to include the work area around the Stage by selecting View &gt; Work Area. Because the call clip doesn't need to be visible to the user, you can place it in the work area. Open the Library panel (Window &gt; Library) and drag the Call Clip symbol to the work area around the Stage. The call clip doesn't contain any visual elements so it appears on the Stage as a small circle, representing the movie clip's registration point. In the Property inspector, type callClip in the Instance Name text box. In the Timeline, select Frame 1 on the layer named ActionScript. In the Actions panel, enter the following code: call(&quot;callClip:function1&quot; call(&quot;callClip:function2&quot; Test your application in the emulator (Control &gt; Test Movie). You should see the following text: function1 was called. function2 was called.   To make your call clip more easily identifiable on the Stage, add some text or other visual element to the first keyframe in the call clip's Timeline.  Using the call() function to create functions You can't define or call custom functions in Flash Lite as you can in Flash Player 5 and later. However, you can use the call() ActionScript function to execute code that resides on an arbitrary frame in the timeline. This technique lets you encapsulate commonly used code in a single location, making it easier to maintain.  The call() function takes a frame number or frame label as a parameter. For example, the following ActionScript calls the code located on the frame labeled moveUp:  call(&quot;moveUp&quot; The call() function operates synchronously; any ActionScript that follows a call() function call won't execute until all of the ActionScript on the specified frame finishes executing.  To call ActionScript on another frame: In a new Flash document, insert a keyframe on Frame 10. With the new keyframe selected, open the Actions panel (Window &gt; Actions), and type the following code: trace(&quot;Hello from frame 10&quot; Select the keyframe on Frame 1, and in the Actions panel, type the following code: stop( call(10 This code stops the playhead on Frame 1, and then calls the code on Frame 10. Test the application in Adobe&#174; Device Central&#8482;.  You should see &quot;Hello from frame 10&quot; displayed in the emulator.  You can also call code that resides on another timeline, such as a movie clip's timeline. To execute the code, specify the movie clip instance name followed by a colon, and then the frame number or label. For example, the following ActionScript calls the code that resides on the frame labeled moveUp in the movie clip instance named callClip: call(&quot;callClip:moveUp&quot; This technique is often used to create call clips or function clips--movie clips whose sole purpose is to encapsulate regularly used code. A call clip contains a keyframe for each function you want to create. You typically label each keyframe according to its purpose. Adobe also recommends that you create a new layer for each new keyframe, and that you give each layer the same name as the frame label you assign to the keyframe.  The following figure shows the Timeline of an example call clip. The first keyframe of a call clip always contains a stop() action, which ensures that the playhead doesn't continually loop over the frames in its Timeline. Subsequent keyframes contain code for each &quot;function.&quot; Each function keyframe is labeled to identify what it does. To make editing and viewing the call clip easier, each function keyframe is typically inserted on a separate layer. The following procedure explains how to create and use a call clip.  To create and use a call clip: In Adobe&#174; Flash&#174; CS3, create a new document from the Flash Lite 1.1 Symbian Series 60 document template. Select Insert &gt; New Symbol. In the Create New Symbol dialog box, type Call Clip in the Name text box, and then click&#160;OK. The movie clip opens in editing mode. Click the Add New Layer button the Timeline window twice to insert two new layers. Name the top layer Actions, the second layer function1, and the third layer function2. Insert a keyframe on Frame 2 of the function1 layer, and another keyframe on Frame 3 of the function2 layer, as the following figure shows: Select the keyframe on the Actions layer and open the Actions panel. Add a stop() action to the Actions panel. Select the keyframe on Frame 2 of the function1 layer and do the following: In the Property inspector, type function1 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function1 was called.&quot; Select the keyframe on Frame 3 of the function2 layer and do the following: In the Property inspector, type function2 in the Frame Label text box. In the Actions panel (Window &gt; Actions), type the following code: trace(&quot;function2 was called.&quot; Press Control+E (Windows) or Command+E (Macintosh) to return to the main Timeline. Set your document's view to include the work area around the Stage by selecting View &gt; Work Area. Because the call clip doesn't need to be visible to the user, you can place it in the work area. Open the Library panel (Window &gt; Library) and drag the Call Clip symbol to the work area around the Stage. The call clip doesn't contain any visual elements so it appears on the Stage as a small circle, representing the movie clip's registration point. In the Property inspector, type callClip in the Instance Name text box. In the Timeline, select Frame 1 on the layer named ActionScript. In the Actions panel, enter the following code: call(&quot;callClip:function1&quot; call(&quot;callClip:function2&quot; Test your application in the emulator (Control &gt; Test Movie). You should see the following text: function1 was called. function2 was called. " />
<page href="00005702.html" title="Using the eval() function" text="Using the eval() function The eval() function lets you dynamically reference variables and movie clip instances at runtime. The eval() function takes a string expression as a parameter and returns either the value of the variable represented by that expression or a reference to a movie clip. For example, the following code evaluates the value of the name ActionScript variable and assigns the result to nameValue: name = &quot;Jack&quot;; nameValue = eval(&quot;name&quot; // result: nameValue = &quot;Jack&quot; The eval() function is often used with for() loops and the add (string concatenation) operator to create string-based arrays, because Flash Lite doesn't support native array data structures. For more information, see Emulating arrays. You can also use eval() to reference movie clip instances by name. For example, suppose you had three movie clips named clip1, clip2, and clip3. The following for() loop increments the x position of each clip by 10 pixels: for(index = 1; index &lt;= 3; index++) {  eval(&quot;clip&quot; add index)._x += 10 }  Using the eval() function The eval() function lets you dynamically reference variables and movie clip instances at runtime. The eval() function takes a string expression as a parameter and returns either the value of the variable represented by that expression or a reference to a movie clip. For example, the following code evaluates the value of the name ActionScript variable and assigns the result to nameValue: name = &quot;Jack&quot;; nameValue = eval(&quot;name&quot; // result: nameValue = &quot;Jack&quot; The eval() function is often used with for() loops and the add (string concatenation) operator to create string-based arrays, because Flash Lite doesn't support native array data structures. For more information, see Emulating arrays. You can also use eval() to reference movie clip instances by name. For example, suppose you had three movie clips named clip1, clip2, and clip3. The following for() loop increments the x position of each clip by 10 pixels: for(index = 1; index &lt;= 3; index++) {  eval(&quot;clip&quot; add index)._x += 10 }  Using the eval() function The eval() function lets you dynamically reference variables and movie clip instances at runtime. The eval() function takes a string expression as a parameter and returns either the value of the variable represented by that expression or a reference to a movie clip. For example, the following code evaluates the value of the name ActionScript variable and assigns the result to nameValue: name = &quot;Jack&quot;; nameValue = eval(&quot;name&quot; // result: nameValue = &quot;Jack&quot; The eval() function is often used with for() loops and the add (string concatenation) operator to create string-based arrays, because Flash Lite doesn't support native array data structures. For more information, see Emulating arrays. You can also use eval() to reference movie clip instances by name. For example, suppose you had three movie clips named clip1, clip2, and clip3. The following for() loop increments the x position of each clip by 10 pixels: for(index = 1; index &lt;= 3; index++) {  eval(&quot;clip&quot; add index)._x += 10 }  " />
<page href="00005703.html" title="Common Scripting Tasks" text="Common Scripting Tasks This chapter discusses common Flash Lite scripting tasks for working with the user's device. These include, for example, getting device capability information, initiating phone calls and text messages, and determining network status. This chapter contains the following topics: Determining device and platform capabilities Opening a web page Initiating a phone call Initiating a text or multimedia message Initiating an e-mail message Loading external SWF files Loading external data Common Scripting Tasks This chapter discusses common Flash Lite scripting tasks for working with the user's device. These include, for example, getting device capability information, initiating phone calls and text messages, and determining network status. This chapter contains the following topics: Determining device and platform capabilities Opening a web page Initiating a phone call Initiating a text or multimedia message Initiating an e-mail message Loading external SWF files Loading external data Common Scripting Tasks This chapter discusses common Flash Lite scripting tasks for working with the user's device. These include, for example, getting device capability information, initiating phone calls and text messages, and determining network status. This chapter contains the following topics: Determining device and platform capabilities Opening a web page Initiating a phone call Initiating a text or multimedia message Initiating an e-mail message Loading external SWF files Loading external data " />
<page href="00005704.html" title="Determining device and platform capabilities" text="Determining device and platform capabilities Macromedia Flash Lite 1.1 from Adobe includes a number of ActionScript variables that provide information about features and capabilities available to Flash Lite applications running on a particular device. For example, the _capLoadData variable indicates if the device supports loading external data, and the _capSMS variable indicates if the device supports sending SMS (short message service) messages. For a full list of capability variables, see Capabilities in the Flash Lite 1.x ActionScript Language Reference. Typically, you use capability variables to determine if a device supports a specific feature before attempting to use that feature. For example, suppose that you wanted to develop an application that downloads data from a web server using the loadVariables() function. Before attempting to load the data, you can first check the value of the _capLoadData variable to determine if the device supports that feature, as follows: if(_capLoadData == 1) {  loadVariables(&quot;http://foo.com/data.txt&quot; } else {  status_message = &quot;Sorry, unable to load external data.&quot; } Flash Lite defines capability variables on the root timeline of the main SWF file. So to access these variables from another timeline--for example, from within a movie clip's timeline--you need to qualify the path to the variable. For instance, the following example uses a slash (/) to provide the fully qualified path to the _capSMS variable.  canSendSMS = /:_capSMS Determining device and platform capabilities Macromedia Flash Lite 1.1 from Adobe includes a number of ActionScript variables that provide information about features and capabilities available to Flash Lite applications running on a particular device. For example, the _capLoadData variable indicates if the device supports loading external data, and the _capSMS variable indicates if the device supports sending SMS (short message service) messages. For a full list of capability variables, see Capabilities in the Flash Lite 1.x ActionScript Language Reference. Typically, you use capability variables to determine if a device supports a specific feature before attempting to use that feature. For example, suppose that you wanted to develop an application that downloads data from a web server using the loadVariables() function. Before attempting to load the data, you can first check the value of the _capLoadData variable to determine if the device supports that feature, as follows: if(_capLoadData == 1) {  loadVariables(&quot;http://foo.com/data.txt&quot; } else {  status_message = &quot;Sorry, unable to load external data.&quot; } Flash Lite defines capability variables on the root timeline of the main SWF file. So to access these variables from another timeline--for example, from within a movie clip's timeline--you need to qualify the path to the variable. For instance, the following example uses a slash (/) to provide the fully qualified path to the _capSMS variable.  canSendSMS = /:_capSMS Determining device and platform capabilities Macromedia Flash Lite 1.1 from Adobe includes a number of ActionScript variables that provide information about features and capabilities available to Flash Lite applications running on a particular device. For example, the _capLoadData variable indicates if the device supports loading external data, and the _capSMS variable indicates if the device supports sending SMS (short message service) messages. For a full list of capability variables, see Capabilities in the Flash Lite 1.x ActionScript Language Reference. Typically, you use capability variables to determine if a device supports a specific feature before attempting to use that feature. For example, suppose that you wanted to develop an application that downloads data from a web server using the loadVariables() function. Before attempting to load the data, you can first check the value of the _capLoadData variable to determine if the device supports that feature, as follows: if(_capLoadData == 1) {  loadVariables(&quot;http://foo.com/data.txt&quot; } else {  status_message = &quot;Sorry, unable to load external data.&quot; } Flash Lite defines capability variables on the root timeline of the main SWF file. So to access these variables from another timeline--for example, from within a movie clip's timeline--you need to qualify the path to the variable. For instance, the following example uses a slash (/) to provide the fully qualified path to the _capSMS variable.  canSendSMS = /:_capSMS " />
<page href="00005705.html" title="Opening a web page" text="Opening a web page You use the getURL() command to open a web page in the device's web browser. This is the same way you open a web page from a desktop Flash application. For example, the following opens the Adobe web page: getURL(&quot;http:www.adobe.com&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following code, attached to a button instance on the Stage, opens a web page when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;http://www.adobe.com&quot; } Opening a web page You use the getURL() command to open a web page in the device's web browser. This is the same way you open a web page from a desktop Flash application. For example, the following opens the Adobe web page: getURL(&quot;http:www.adobe.com&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following code, attached to a button instance on the Stage, opens a web page when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;http://www.adobe.com&quot; } Opening a web page You use the getURL() command to open a web page in the device's web browser. This is the same way you open a web page from a desktop Flash application. For example, the following opens the Adobe web page: getURL(&quot;http:www.adobe.com&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following code, attached to a button instance on the Stage, opens a web page when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;http://www.adobe.com&quot; } " />
<page href="00005706.html" title="Initiating a phone call" text="Initiating a phone call To initiate a phone call from a Flash Lite application, you use the getURL() function. Typically, you use this function to open a web page, but in this case you specify tel: as the protocol (in place of http), and then provide the phone number you wish the phone to dial. When you call this function, Flash Lite displays a confirmation dialog box asking the user for permission to make the call to the specified number. The following code attempts to initiate call to 555-1212: getURL(&quot;tel:555-1212&quot; Flash Lite only processes one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example starts a phone call when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;tel:555-1212&quot; } Initiating a phone call To initiate a phone call from a Flash Lite application, you use the getURL() function. Typically, you use this function to open a web page, but in this case you specify tel: as the protocol (in place of http), and then provide the phone number you wish the phone to dial. When you call this function, Flash Lite displays a confirmation dialog box asking the user for permission to make the call to the specified number. The following code attempts to initiate call to 555-1212: getURL(&quot;tel:555-1212&quot; Flash Lite only processes one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example starts a phone call when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;tel:555-1212&quot; } Initiating a phone call To initiate a phone call from a Flash Lite application, you use the getURL() function. Typically, you use this function to open a web page, but in this case you specify tel: as the protocol (in place of http), and then provide the phone number you wish the phone to dial. When you call this function, Flash Lite displays a confirmation dialog box asking the user for permission to make the call to the specified number. The following code attempts to initiate call to 555-1212: getURL(&quot;tel:555-1212&quot; Flash Lite only processes one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example starts a phone call when the user presses the Select button on the device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;tel:555-1212&quot; } " />
<page href="00005707.html" title="Initiating a text or multimedia message" text="Initiating a text or multimedia message You can use Flash Lite to initiate a short message service (SMS) or multimedia message service (MMS) message. To initiate an SMS or MMS message in a Flash Lite application, you use the getURL() command, passing it the sms: or mms: protocols in place of the standard http protocol, and then the phone number to which you want to send the message. getURL(&quot;sms:555-1212&quot; You can optionally specify the message body in the URL query string, as the following code&#160;shows: getURL(&quot;sms:555-1212?body=More info please&quot; To initiate an MMS message, you use the mms: protocol instead of sms:, as follows: getURL(&quot;mms:555-1212&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example initiates an SMS message when the user presses the Select button on the&#160;device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;sms:555-1212&quot; }   It's not possible to specify an attachment for the MMS message from Flash Lite. Initiating a text or multimedia message You can use Flash Lite to initiate a short message service (SMS) or multimedia message service (MMS) message. To initiate an SMS or MMS message in a Flash Lite application, you use the getURL() command, passing it the sms: or mms: protocols in place of the standard http protocol, and then the phone number to which you want to send the message. getURL(&quot;sms:555-1212&quot; You can optionally specify the message body in the URL query string, as the following code&#160;shows: getURL(&quot;sms:555-1212?body=More info please&quot; To initiate an MMS message, you use the mms: protocol instead of sms:, as follows: getURL(&quot;mms:555-1212&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example initiates an SMS message when the user presses the Select button on the&#160;device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;sms:555-1212&quot; }   It's not possible to specify an attachment for the MMS message from Flash Lite. Initiating a text or multimedia message You can use Flash Lite to initiate a short message service (SMS) or multimedia message service (MMS) message. To initiate an SMS or MMS message in a Flash Lite application, you use the getURL() command, passing it the sms: or mms: protocols in place of the standard http protocol, and then the phone number to which you want to send the message. getURL(&quot;sms:555-1212&quot; You can optionally specify the message body in the URL query string, as the following code&#160;shows: getURL(&quot;sms:555-1212?body=More info please&quot; To initiate an MMS message, you use the mms: protocol instead of sms:, as follows: getURL(&quot;mms:555-1212&quot; Flash Lite processes only one getURL() action per frame or per event handler. Certain handsets restrict the getURL() action to keypress events only, in which case the getURL() call is processed only if it is triggered within a keypress event handler. Even under such circumstances, only one getURL() action is processed per keypress event handler. The following example initiates an SMS message when the user presses the Select button on the&#160;device:  on (keyPress &quot;&lt;Enter&gt;&quot;){  getURL(&quot;sms:555-1212&quot; } " />
<page href="00005708.html" title="Initiating an e-mail message" text="Initiating an e-mail message You can use Flash Lite to initiate an e-mail message. To initiate an e-mail message, you use the getURL() command and pass it the mailto: protocol, followed by the recipient's e-mail address. You can optionally specify the message subject and body in the URL's query string, as&#160;follows: getURL(&quot;mailto:mobile-developer@adobe.com?subject=Flash Lite&quot; To specify just the message body in the query string, use the following code: getURL(&quot;mailto:mobile-developer@adobe.com?body=More+info+please&quot; Initiating an e-mail message You can use Flash Lite to initiate an e-mail message. To initiate an e-mail message, you use the getURL() command and pass it the mailto: protocol, followed by the recipient's e-mail address. You can optionally specify the message subject and body in the URL's query string, as&#160;follows: getURL(&quot;mailto:mobile-developer@adobe.com?subject=Flash Lite&quot; To specify just the message body in the query string, use the following code: getURL(&quot;mailto:mobile-developer@adobe.com?body=More+info+please&quot; Initiating an e-mail message You can use Flash Lite to initiate an e-mail message. To initiate an e-mail message, you use the getURL() command and pass it the mailto: protocol, followed by the recipient's e-mail address. You can optionally specify the message subject and body in the URL's query string, as&#160;follows: getURL(&quot;mailto:mobile-developer@adobe.com?subject=Flash Lite&quot; To specify just the message body in the query string, use the following code: getURL(&quot;mailto:mobile-developer@adobe.com?body=More+info+please&quot; " />
<page href="00005709.html" title="Loading external SWF files" text="Loading external SWF files The loadMovie() function lets you load SWF files from a network or local file. This feature is only available in Flash Lite 1.1 and later. The following caveats apply when you load external SWF files: Flash Lite can load other Flash Lite 1.0 or Flash Lite 1.1 SWF files, or Flash 4-formatted SWF files or earlier. If you attempt to load a SWF file in another format (for example, a Flash Player 6 SWF file), Flash Lite will generate a runtime error.  Flash Lite cannot directly load external image files, such as JPEG or GIF images. To load these types of media, you need to convert the image data to the SWF file format. You can do this &quot;manually&quot; with the Flash authoring tool by importing the image file into a new document, and then exporting the file to a Flash Lite or Flash 4 SWF file. There are also third-party utilities that can perform this type of conversion for you automatically. For more information about loading SWF files, see loadMovie() in Flash Lite 1.x ActionScript Language Reference. Loading external SWF files The loadMovie() function lets you load SWF files from a network or local file. This feature is only available in Flash Lite 1.1 and later. The following caveats apply when you load external SWF files: Flash Lite can load other Flash Lite 1.0 or Flash Lite 1.1 SWF files, or Flash 4-formatted SWF files or earlier. If you attempt to load a SWF file in another format (for example, a Flash Player 6 SWF file), Flash Lite will generate a runtime error.  Flash Lite cannot directly load external image files, such as JPEG or GIF images. To load these types of media, you need to convert the image data to the SWF file format. You can do this &quot;manually&quot; with the Flash authoring tool by importing the image file into a new document, and then exporting the file to a Flash Lite or Flash 4 SWF file. There are also third-party utilities that can perform this type of conversion for you automatically. For more information about loading SWF files, see loadMovie() in Flash Lite 1.x ActionScript Language Reference. Loading external SWF files The loadMovie() function lets you load SWF files from a network or local file. This feature is only available in Flash Lite 1.1 and later. The following caveats apply when you load external SWF files: Flash Lite can load other Flash Lite 1.0 or Flash Lite 1.1 SWF files, or Flash 4-formatted SWF files or earlier. If you attempt to load a SWF file in another format (for example, a Flash Player 6 SWF file), Flash Lite will generate a runtime error.  Flash Lite cannot directly load external image files, such as JPEG or GIF images. To load these types of media, you need to convert the image data to the SWF file format. You can do this &quot;manually&quot; with the Flash authoring tool by importing the image file into a new document, and then exporting the file to a Flash Lite or Flash 4 SWF file. There are also third-party utilities that can perform this type of conversion for you automatically. For more information about loading SWF files, see loadMovie() in Flash Lite 1.x ActionScript Language Reference. " />
<page href="00005710.html" title="Loading external data" text="Loading external data To load external data into a Flash Lite application, you use the loadVariables() function. You can load data over the network (from an HTTP address) or from the local file system. This feature is available only in Flash Lite 1.1 and later. This section demonstrates how to use the loadVariables() function to load data from an external file and display that data in dynamic text fields. First you'll create the data file, a text file that contains five name-value pairs separated by ampersand (&amp;) symbols. Then you'll create the Flash Lite application that loads and displays the data contained in the text file.  This example assumes that the data file and the SWF are both located in the same folder, either on your computer (when you test in the emulator) or on the device's memory card (when you test on an actual device). To test the application on the device, you must do one of the following: Transfer the text file to your device and put it in the same folder as the SWF file. Post the text file to a URL on a web server (for example, www.your-server.com/data.txt). Then modify the loadVariables() call in the sample application to point to that URL, as follows: loadVariables(&quot;http://www.your-server.com/data.txt&quot;, &quot;data_clip&quot; For an example of an application that loads data over the network, see the &quot;Flash Lite news reader&quot; in Flash Samples. To create the data file: Using a text editor (for example, Notepad or SimpleText), create a file that contains the following text: item_1=Hello&amp;item_2=Bonjour&amp;item_3=Hola&amp;item_4=Buon+giorno&amp;item_5=G&#39;day Save the file as data.txt. To create the Flash Lite application to load the data: Create a new document from the Flash Lite 1.1 Symbian Series 60 document template. For more information about using Flash Lite document templates, see Using Flash Lite document templates in Getting Started with Flash Lite 1.x. Save the file as dataloading.fla to the same folder that contains the text file (data.txt) that you created previously. In the Timeline, select Frame 1 of the layer named Content. Using the Text tool, create five dynamic text fields on the Stage, as the following figure&#160;shows: Select the first (top-most) text field, and in the Property inspector, type item_1 in the Var text box. This variable name corresponds to the name of the first variable defined in the data.txt file you created previously (item_1=Hello). In the same manner as described in the previous two steps, give the remaining four text fields the variable names item_2, item_3, item_4, and item_5. Shift-select each text field so that they're all selected, and select Modify &gt; Convert To Symbol. In the Convert to Symbol dialog box, select Movie Clip as the symbol type and click OK. Select the movie clip you just created and, in the Property inspector, type data_clip in the Instance Name text box. In the Timeline, select Frame 1 of the Actions layer and open the Actions panel (Window&#160;&gt;&#160;Actions). Type the following code in the Actions panel: loadVariables(&quot;data.txt&quot;, &quot;data_clip&quot; Save your changes (File &gt; Save) and test the application in the emulator (Control &gt; Test Movie). You should see each text field populated with the data in the text file, as the following figure shows:  Loading external data To load external data into a Flash Lite application, you use the loadVariables() function. You can load data over the network (from an HTTP address) or from the local file system. This feature is available only in Flash Lite 1.1 and later. This section demonstrates how to use the loadVariables() function to load data from an external file and display that data in dynamic text fields. First you'll create the data file, a text file that contains five name-value pairs separated by ampersand (&amp;) symbols. Then you'll create the Flash Lite application that loads and displays the data contained in the text file.  This example assumes that the data file and the SWF are both located in the same folder, either on your computer (when you test in the emulator) or on the device's memory card (when you test on an actual device). To test the application on the device, you must do one of the following: Transfer the text file to your device and put it in the same folder as the SWF file. Post the text file to a URL on a web server (for example, www.your-server.com/data.txt). Then modify the loadVariables() call in the sample application to point to that URL, as follows: loadVariables(&quot;http://www.your-server.com/data.txt&quot;, &quot;data_clip&quot; For an example of an application that loads data over the network, see the &quot;Flash Lite news reader&quot; in Flash Samples. To create the data file: Using a text editor (for example, Notepad or SimpleText), create a file that contains the following text: item_1=Hello&amp;item_2=Bonjour&amp;item_3=Hola&amp;item_4=Buon+giorno&amp;item_5=G&#39;day Save the file as data.txt. To create the Flash Lite application to load the data: Create a new document from the Flash Lite 1.1 Symbian Series 60 document template. For more information about using Flash Lite document templates, see Using Flash Lite document templates in Getting Started with Flash Lite 1.x. Save the file as dataloading.fla to the same folder that contains the text file (data.txt) that you created previously. In the Timeline, select Frame 1 of the layer named Content. Using the Text tool, create five dynamic text fields on the Stage, as the following figure&#160;shows: Select the first (top-most) text field, and in the Property inspector, type item_1 in the Var text box. This variable name corresponds to the name of the first variable defined in the data.txt file you created previously (item_1=Hello). In the same manner as described in the previous two steps, give the remaining four text fields the variable names item_2, item_3, item_4, and item_5. Shift-select each text field so that they're all selected, and select Modify &gt; Convert To Symbol. In the Convert to Symbol dialog box, select Movie Clip as the symbol type and click OK. Select the movie clip you just created and, in the Property inspector, type data_clip in the Instance Name text box. In the Timeline, select Frame 1 of the Actions layer and open the Actions panel (Window&#160;&gt;&#160;Actions). Type the following code in the Actions panel: loadVariables(&quot;data.txt&quot;, &quot;data_clip&quot; Save your changes (File &gt; Save) and test the application in the emulator (Control &gt; Test Movie). You should see each text field populated with the data in the text file, as the following figure shows:  Loading external data To load external data into a Flash Lite application, you use the loadVariables() function. You can load data over the network (from an HTTP address) or from the local file system. This feature is available only in Flash Lite 1.1 and later. This section demonstrates how to use the loadVariables() function to load data from an external file and display that data in dynamic text fields. First you'll create the data file, a text file that contains five name-value pairs separated by ampersand (&amp;) symbols. Then you'll create the Flash Lite application that loads and displays the data contained in the text file.  This example assumes that the data file and the SWF are both located in the same folder, either on your computer (when you test in the emulator) or on the device's memory card (when you test on an actual device). To test the application on the device, you must do one of the following: Transfer the text file to your device and put it in the same folder as the SWF file. Post the text file to a URL on a web server (for example, www.your-server.com/data.txt). Then modify the loadVariables() call in the sample application to point to that URL, as follows: loadVariables(&quot;http://www.your-server.com/data.txt&quot;, &quot;data_clip&quot; For an example of an application that loads data over the network, see the &quot;Flash Lite news reader&quot; in Flash Samples. To create the data file: Using a text editor (for example, Notepad or SimpleText), create a file that contains the following text: item_1=Hello&amp;item_2=Bonjour&amp;item_3=Hola&amp;item_4=Buon+giorno&amp;item_5=G&#39;day Save the file as data.txt. To create the Flash Lite application to load the data: Create a new document from the Flash Lite 1.1 Symbian Series 60 document template. For more information about using Flash Lite document templates, see Using Flash Lite document templates in Getting Started with Flash Lite 1.x. Save the file as dataloading.fla to the same folder that contains the text file (data.txt) that you created previously. In the Timeline, select Frame 1 of the layer named Content. Using the Text tool, create five dynamic text fields on the Stage, as the following figure&#160;shows: Select the first (top-most) text field, and in the Property inspector, type item_1 in the Var text box. This variable name corresponds to the name of the first variable defined in the data.txt file you created previously (item_1=Hello). In the same manner as described in the previous two steps, give the remaining four text fields the variable names item_2, item_3, item_4, and item_5. Shift-select each text field so that they're all selected, and select Modify &gt; Convert To Symbol. In the Convert to Symbol dialog box, select Movie Clip as the symbol type and click OK. Select the movie clip you just created and, in the Property inspector, type data_clip in the Instance Name text box. In the Timeline, select Frame 1 of the Actions layer and open the Actions panel (Window&#160;&gt;&#160;Actions). Type the following code in the Actions panel: loadVariables(&quot;data.txt&quot;, &quot;data_clip&quot; Save your changes (File &gt; Save) and test the application in the emulator (Control &gt; Test Movie). You should see each text field populated with the data in the text file, as the following figure shows:  " />
</book>