×
Namespaces

Variants
Actions
Revision as of 04:24, 29 June 2012 by hamishwillee (Talk | contribs)

Archived:Display contact informations and locations in Google Maps with Flash Lite 3.1

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: pasi.manninen (22 Mar 2010)
Last edited: hamishwillee (29 Jun 2012)
Featured Article
04 Apr
2010

Contents

Overview

APIBridge and Platform Services API provides great plug-ins for Flash Lite Developers. In this article Location Service plug-in and ActionScript Contacts Service API are used to display contacts informations in scrollable list and location in Google Maps (static map).

First the users device location is determined with Location Service plug-in and then contacts address (home and work), city and country are loaded with ActionScript Contacts Services API. Contacts information are displayed with scrollable list (which expands when user click contacts name). User can press contacts name to find more information about selected contact. Contact home or work address can be viewed in google maps, if contact has added street addresses in contact's information. Flash Lite application calculates also distance between contact and user, and both markers are displayed in static Google Map (map can be viewed with different zoom levels).

ContactsDemo03.jpg ContactsDemo04.jpg ContactsDemo05.jpg ContactsDemo06.jpg ContactsDemo09.jpg

This article will show how to implement static zoomable Google Map (with contact information) in Flash Lite 3.1 supported devices.

Installing API Bridge and Platform Services classes to Flash IDE

To start using APIBridge and Platform Services with Flash IDE, you first have to download needed classes and install those to your system. You can download APIBridge ActionScript API here and Platform Services API here.

In mac you can install classes to following directory: Library/Application Support/Adobe/Flash CS4/en/Configuration/Classes/ and in Windows: Adobe/Flash CS4/en/Configuration/Classes/. After that classes should work in your IDE.

Testing in device

You have to install API Bridge sis package on you phone first. You can find the sis package inside zip file provided for example here.

Programming in Flash

First of all you have to create a needed graphics UI (a few buttons and movie-clips) for the end user. Please look more information about those in source files (later in this article) or see screenshots in this page to get idea. I will cover here only programming part of using APIBridge and Contacts API with ActionScript 2.0. This Flash Lite code example is programmed to four frames in Flash and it uses two own made classes to handle contacts informations and scrollable list (Contacs.as and Container.as).

Initialization and loading APIBridge

Following code should be programmed in the first frame of timeline in Flash IDE. Here we import needed classes and set Flash Lite to use full screen, high quality and disable default keypad and disable softkeys.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// import APIBridge library
import si.apibridge.*;
// import Device library
import com.nokia.lib.Device;
// Import Platform Service Interface
import com.nokia.lib.Service;

// disable default keypad
fscommand2("DisableKeypadCompatibilityMode");
// enable Full Screen
fscommand2("FullScreen",true);
// set quality to high
fscommand2("SetQuality","high");
// disable softkeys
fscommand2("SetSoftKeys", "", "");
// no scale 
Stage.scaleMode = "noScale";
// align top left
Stage.align = "TL";
// disable forusrect
_focusrect = false;

Flash offers TextFormat class to create and use different text formats in dynamic textfields. Here in first frame we create two text formats which are used in contacts scrollable list. Font1 is embedded font in Flash Library, you can change it to what ever font you want (just change font in Flash Library).

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// header and data colors in contacts detail
var contactheader_fmt = new TextFormat();
contactheader_fmt.color= 0xFFFF00;
contactheader_fmt.size = 20;
contactheader_fmt.font = "Font1";

var contactdata_fmt:TextFormat = new TextFormat();
contactdata_fmt.color = 0xCCCCCC;
contactdata_fmt.size = 20;
contactdata_fmt.font = "Font1";

Flash cannot get latitude and longitude values directly from address data with ActionScript. In this code example PHP language is used to convert address data to latitude and longitude values. (To find more information about PHP coding in this article, see source codes later in this article).

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// get latitude and longitude values from contacts address
var phpUrl:String = "http://your.ip.here/getLatLng.php";

// users longitude and latitude
var longitude:Number;
var latitude:Number;

// Google Maps default zoom
var zoom:Number = 12;

// setInterval number, small wait's when we display data to user
var waitID:Number;

Flash Lite 3.1 supports Platform Services Device object, which helps Flash Lite developers to keep Flash Lite applications in portrait or landscape mode all the time. In this article Flash Lite application is designed to run portrait mode and all UI is in main_mc movieclip. If user has started application in landscape mode, main_mc movieclip is rotated and Device object will disable devices autorotation support. In this way Flash Lite application can be kept in portrait mode all the time.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// disable devices autorotation
var deviceObject:Object = new Device();
deviceObject.DisableAutoRotation(true);

// if not portrait, rotate main (to keep UI portrait and fullscreen)
var portrait:Boolean = true;
if (Stage.width > Stage.height) {
  main_mc._rotation = -90;
  main_mc._y = 360;
  portrait = false;
}

Next it is time to create a new instance of APIBridge. Errors will be shown in dynamic textfield in main_mc.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// create a new instance of APIBridge, with callback error function
var bridge:APIBridge = new APIBridge(onBridgeError);

// handle APIBridge errors
function onBridgeError(outParam:Object):Void {
  main_mc.info_txt.text = "APIBridge error " + outParam.ErrorCode + " " + outParam.ErrorMessage;
}

UI - Dialogs and Buttons

In this example only three buttons are used: back, zoom and exit. Those will be created dynamically from Flash Library with attachMovie command. But, first the loading dialog is attached to screen from Flash's Library to show loading information. loading_mc is centered to devices screen.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// show loading message
main_mc.attachMovie("Loading","loading_mc",main_mc.getNextHighestDepth());
if (portrait) {
  main_mc.loading_mc._x = Stage.width/2;
  main_mc.loading_mc._y = Stage.height/2;
} else {
  main_mc.loading_mc._x = Stage.height/2;
  main_mc.loading_mc._y = Stage.width/2;
}

Back button is used when user wants to go back from map view to contacts view. back_mc is forced to bottom left corner of device's screen. Map view is deleted from screen with removeMovieClip() command when user pressed back button.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// back button, go back to scrollable list view from map view
var back_mc:MovieClip = main_mc.attachMovie("button","back_mc",main_mc.getNextHighestDepth());
// back button is not visible yet
back_mc._visible = false;
if (portrait) {
  back_mc._x = 0;
  back_mc._y = Stage.height - back_mc._height;
} else {
  back_mc._x = 0 
  back_mc._y = Stage.width - back_mc._height;
}
back_mc.label_txt.text = "BACK";
// back button is pressed
back_mc.onPress = function():Void {
  // hide this button
  this._visible = false;
  // hide zoom button
  this._parent.zoom_mc._visible = false;
  // show contact list
  main_mc.container_mc._visible = true;
  // show scrollbar and dragger
  main_mc.bar._visible = true;
  main_mc.dragger._visible = true;
  // remove info_mc movieclip (info and map)
  main_mc.info_mc.removeMovieClip();
}

Zoom button is used when user wants to get a new static image from Google Maps. zoom_mc is centered to the bottom of device's screen. zoommap_mc instance is attached to screen from Flash Library (Linkage identifier is Zoom). Zoom is own made dialog where user can change Google Map's zoom level in input textfield. ZoomGoogleMap function is called after a new zoom level is adjusted and a new static image is loaded from Google Maps (loadMapClip is programmed later in frame 3).

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// zoom button
var zoom_mc:MovieClip = main_mc.attachMovie("button","zoom_mc",main_mc.getNextHighestDepth());
zoom_mc._visible = false;
if (portrait) {
  zoom_mc._x = Stage.width/2 - zoom_mc._width/2;
  zoom_mc._y = Stage.height - zoom_mc._height;
} else {
  zoom_mc._x = Stage.width/2 - zoom_mc._width/2;
  zoom_mc._y = Stage.width - zoom_mc._height;
}
zoom_mc.label_txt.text = "ZOOM";
// zoom button is pressed
zoom_mc.onPress = function():Void {
  // hide this button
  this._visible = false;
  // load Zoom movieclip from Flash Library and center it to screen
  var zoommap_mc:MovieClip = main_mc.attachMovie("Zoom","zoommap_mc",main_mc.getNextHighestDepth());
  if (portrait) {
    zoommap_mc._x = Stage.width/2;
    zoommap_mc._y = Stage.height/2;
  } else {
    zoommap_mc._x = Stage.height/2;
    zoommap_mc._y = Stage.width/2;
  }
  zoommap_mc.zoom_btn.label_txt.text = "ZOOM";
  zoommap_mc.zoom_txt.text = zoom;
  // zoom map button is pressed
  zoommap_mc.zoom_btn.onPress = ZoomGoogleMap;
}

// zoom level is adjusted, start loading a new static image from Google Maps
function ZoomGoogleMap():Void {
  // hide zoom button from screen
  main_mc.info_mc.map_mc._visible = false;
  // get new zoom level
  zoom = Number(main_mc.zoommap_mc.zoom_txt.text);
  // remove zoom map dialog from screen
  main_mc.zoommap_mc.removeMovieClip();
  // start map loading in one second
  waitID = setInterval(loadMapClip,1000,mapUrl);
}

Exit button is used when user wants to exit from application. 'exit_mc is forced to bottom right corner of device's screen.

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// exit button
var exit_mc:MovieClip = main_mc.attachMovie("button","exit_mc",main_mc.getNextHighestDepth());
if (portrait) {
  exit_mc._x = Stage.width - exit_mc._width;
  exit_mc._y = Stage.height - exit_mc._height;
} else {
  exit_mc._x = Stage.height - exit_mc._width;
  exit_mc._y = Stage.width - exit_mc._height;
}
exit_mc.label_txt.text = "EXIT";
exit_mc.onPress = function():Void {
  status = fscommand2("Quit");
}

Getting users devices location

User's location is determined with Location Service. Location Service has GetLocation function which can detect users device longitude and latitude. After location is found (or not), we are moving to next frame and start loading contact information from devices Contacts with S60 Platform Services API for Flash Lite.

ContactsDemo01.jpg

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// detect users device location
main_mc.loading_mc.text_txt.text = "Get location...";
// create a new location service
var location = bridge.Service("Service.Location", "ILocation");
var inParams = null;
location.GetLocation(inParams,onLocation);

// location is determined
function onLocation (transactionID:Number, eventID:String, outParam:Object):Void {
  if (outParam.ErrorCode != 0) {
    main_mc.loading_mc.text_txt.text = "ErrorCode: " + outParam.ErrorCode;
  } else {
    // get latitude and longitude values
    var outList = outParam.ReturnValue;
    longitude = outList.Longitude; 
    latitude = outList.Latitude;
    // does we get lon and lat values
    if (isNaN(longitude) || isNaN(latitude)) { 
      main_mc.loading_mc.text_txt.text = "Location not found";
      // set default values for debugging if you want calculate distances later
      //latitude = 62.2242356;
      //longitude = 25.7580824;
    } else {
      main_mc.loading_mc.text_txt.text = "Location found";
    }
  }
  // small delay here, display "Location found" or "not found" to user (2 seconds),
  // and then start loading contacts
  waitID = setInterval(getContacts,2000);
}

// start loading contact information from device
function getContacts():Void {
  main_mc.loading_mc.text_txt.text = "Load contacts...";
  clearInterval(waitID);
  gotoAndPlay(3);
}

// stop timeline
stop();

Loading contacts data from device

Contacts information data (name, street address, city and country) is loaded in third frame in Flash. This third frame also handles main functionality of this code example (scrollable list and mapview).

First container_mc is created to handle scrollable list of contact data. Next we create a new contact service from Platform Service and start loading contacts data from device. Contacts data are stored in to Contact Class (own made) and it's information is displayed with ContactItem MovieClip. Own made classes can be tied to visual movieclips in Flash Library (give Lingage identifier and Class informations in Symbol Properties). Container displays ContactItems in vertical order and scrollable list expands if user selects/presses contacts name. Multiple contacts can be "open" at same time. Look more informations about Contact.as and Container.as in source codes.

ContactsDemo02.jpgContactsDemo03.jpg ContactsDemo04.jpg

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// create empty movieclip for contacts ListItems
var container_mc:MovieClip = main_mc.attachMovie("Container","container_mc",this.getNextHighestDepth());
container_mc._visible = false;

// create contacts service object
var contact = new Service("Service.Contact","IDataSource");
var inParams = {Type:"Contact"};
// get contacts
var outParams = contact.GetList(inParams);
// do we get contacts
if (outParams.ErrorCode == 0) {
  // returned contacts data
  var outList = outParams.ReturnValue;
  var outputEntry = null;
  // contact items in container (step in y position is 40 px wide)
  var i:Number = 0;
  var step:Number = 40;
  // create contact items to container_mc
  do {
    // next contact
    outputEntry = outList.next();
    if (null != outputEntry) {
      // add a new contact to container list
      i++;
      var mc:MovieClip = container_mc.attachMovie("ContactItem","Contact"+i,container_mc.getNextHighestDepth());
      container_mc.addMC(mc);
      // add contact data to container item
      container_mc["Contact"+i].init(outputEntry, container_mc, i, contactheader_fmt, contactdata_fmt);
      // positioning in scrollable list
      container_mc["Contact"+i]._y = (i-1)*step;
    } else {
      // all contacts added to scrollable list
      break;
    }
  } while (true);
  // show contact list (go to next frame)	
  gotoAndStop("show");
} else {
  main_mc.loading_mc.info_txt.text = "Error: " + outParams.ErrorCode;
}

Contacts information are displayed in scrollable list when user clicks contacts name. If contact has home or work street address, user can select it to view address location in Google Maps. LoadVars objects are used to send data from Flash Lite application to server and vice versa. sendDataLV has address property where contact address is stored and sent to server side. Later PHP code returns latitude and longitude data and we call latLonLoaded function to start load static map from Google Maps.

ContactsDemo05.jpg

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// data objects to server and back (street address -> latitude and longitude values)
var sendDataLV:LoadVars;
var loadDataLV:LoadVars;

//start loading request
function showInMap(street:String,city:String,country:String):Void {
  // send and load data to/from server
  sendDataLV = new LoadVars();
  loadDataLV = new LoadVars();
  // show info and map to user
  var info_mc:MovieClip = main_mc.attachMovie("info","info_mc",main_mc.getNextHighestDepth());
  info_mc._x = 5;
  info_mc._y = 70;
  // show informations to user
  info_mc.text_txt.text = "Contact address:" + "\n";
  info_mc.text_txt.text += "- street : " + street + "\n";
  info_mc.text_txt.text += "- city : " + city + "\n";
  info_mc.text_txt.text += "- country : " + country + "\n";
  info_mc.text_txt.text += "\nContact location:\n";
  // send lat and lng request to server (from address data)
  loadDataLV.onLoad = latLonLoaded;
  sendDataLV.address = street+" "+city+" "+country;
  sendDataLV.sendAndLoad(phpUrl,loadDataLV,"POST");
  // back button visible, user can go back to scrollable list view
  back_mc._visible = true;
}

// latitude and longitude values are returned from server
function latLonLoaded(ok:Boolean):Void {
  if (ok) {
    // real values got from server, start loading map
    if (loadDataLV.latitude != undefined && loadDataLV.longitude != undefined) loadMap();
    else main_mc.info_mc.text_txt.text += "No Latitude and Longitude found.\n";
  } else {
    main_mc.info_mc.text_txt.text += "Can't connect server to get Lat and Lng!\n";
  }
}

Load static map from Google Maps

LoadMap function displays contacts informations (address, latitude and longitude) and users devices location if it is determined when this Flash Lite application is started. Users distance to contact's address location is also calculated and shown (look source codes more info about calculating distances between two longitude and latitude points).

ContactsDemo06.jpg ContactsDemo07.jpg

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// start loading static image from Google Maps
function loadMap():Void {
  // show loaded lat and long to user
  main_mc.info_mc.text_txt.text += "- latitude: "+loadDataLV.latitude+"\n";
  main_mc.info_mc.text_txt.text += "- longitude: "+loadDataLV.longitude+"\n";
  // if users devices location is determined, show that info too
  if (!isNaN(longitude) && !isNaN(latitude)) {
    main_mc.info_mc.text_txt.text += "\nUser location:\n";
    main_mc.info_mc.text_txt.text += "- latitude: "+latitude+"\n";
    main_mc.info_mc.text_txt.text += "- longitude: "+longitude+"\n";
    main_mc.info_mc.text_txt.text += "\nUsers distance to contact: " + calcDistance(loadDataLV.latitude,loadDataLV.longitude)+"\n";
  }
  main_mc.info_mc.text_txt.text += "\nLoading map, please wait...\n";
  // start map load, wait 2 seconds (user can read above informations from screen first)
  waitID = setInterval(loadMapClip,2000,mapUrl);
}

In this example MovieClipLoader class is used to load images from Google Maps. Image will be visible after it is loaded (and user has enough time to read above informations from screen first). Both contact address marker (green c) and users location marker (blue p) are displayed (if users devices location is determined).

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// use moviecliploader to load iamge
var loader:MovieClipLoader = new MovieClipLoader();
// listen onLoadComplete, image is loaded
var listener:Object = new Object();
listener.onLoadComplete = function(target:MovieClip):Void {
  // show image
  target._visible = true;
  // show zoom button
  zoom_mc._visible = true;
}
// register image loading listener
loader.addListener(listener);

// start loading image from google maps
function loadMapClip(mapUrl:String):Void {
  // remove waiting interval
  clearInterval(waitID);
  // google api key
  var apiKey:String = "API_KEY";
  // url to load
  var mapUrl:String = 
    "http://maps.google.com/staticmap?center=" + 
    loadDataLV.latitude + "," + loadDataLV.longitude + 
    "&format=jpg&zoom="+zoom+"&size=350x520" + 
    "&key=" + apiKey +
    "&markers="+loadDataLV.latitude+","+loadDataLV.longitude+","+"greenc";
  // add users location marker also (if determined)
  if (!isNaN(longitude) && !isNaN(latitude)) {
    mapUrl += "&markers="+latitude+","+longitude+","+"bluep"		
  }
  // start loading static image from google maps
  loader.loadClip(mapUrl, main_mc.info_mc.map_mc);
}

One final feature here is zooming. User can select a new zoom level and a new map image is loaded from Google Maps.

ContactsDemo08.jpg ContactsDemo09.jpg

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// new zoom level is adjusted, start loading static image again from google maps
function ZoomGoogleMap():Void {
  // hide previous image from screen (start loading new)
  main_mc.info_mc.map_mc._visible = false;
  // get zoom level from zoom map dialog
  zoom = Number(main_mc.zoommap_mc.zoom_txt.text);
  // remove zoom map dialog from screen
  main_mc.zoommap_mc.removeMovieClip();
  // start map load	again in 2 seconds
  waitID = setInterval(loadMapClip,2000,mapUrl);
}

// stop timeline
stop();

Scrollable list

Last frame in Flash handles contacts scrolling in scrollable list. Look more information in source codes.

Source Codes for Download

File: ContactsDemo.zip

194 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×