Array

Place Call

Must Read

Admin
Admin
Just post!

The URLRequest class can be used to open the Phone application to place a call. By prepending the request with tel:, you will tell Android to launch the Phone application when the navigateToURL method is called. Figure 6-8 shows the sample application running and Figure 6-9 shows the Phone application with the phone number pre-populated:

<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”>
<fx:Script>
<![CDATA[
protectedfunction sendIt_clickHandler(event:MouseEvent):void
{
var s:String = “”;
s += “tel:”;
s+= call.text;
navigateToURL(new URLRequest(s));
}
]]>
</fx:Script>
<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>
</fx:Declarations>
<s:Label text=”Phone #” top=”40″ left=”50″/>
<s:TextInput id=”call” top=”30″ left=”160″ text=”2125559999″ width=”250″/>
<s:Button id=”sendIt” label=”Send” click=”sendIt_clickHandler(event)” top=”110″
left=”160″/>
</s:Application>

A sample Phone application

The Phone application with number pre-populated

Previous articleCreate Email
Next articleSplash Screen
- Advertisement -

Latest News

STOOF International presents armoured SUV Trojan with certified maximum protection

The "Trojan", based on the Toyota LC 300, in resistance class VR9, from STOOF International, represents an absolute novelty...
- Advertisement -

More Articles Like This

- Advertisement -