PDA

View Full Version : Flash Lite Search Application


Kunemon
11-23-2009, 03:46 AM
Hi,
I've recently thought of creating an application that does a search for local delicacies and i've done up the graphic user interface. The only problem i have now is that i do not know how to make the search function work.

Is there a tutorial or guide to teach us how to be able to link flash lite applications to a search and displays the results that the user inputs together with the information from the search?

A detailed example would be that the user keys in a kind of food product and after searching, the results would be displayed and the user is able to choose from one of the results to get its detailed information.

I need to know how am i able to let flash lite perform this search and where does it do the search. Is there anyone who can help me with this?

Side note : I am using adobe Flash CS4 with action script 2.0 and flash lite 3.0.

Thank You
Regards
Kunemon

Thommas
11-23-2009, 07:52 AM
You can use some sort of webservice to provide search to user.

Use loadXML and loadVars to do so.

However, you'll need to develop your own search webservice, or find some fitting your needs.

Kunemon
11-24-2009, 01:38 AM
Oh, thanks, i've read about the Load and Xml thing, any idea how am i supposed to create my own search webservice? is there a guide on this?

Thommas
11-24-2009, 09:47 AM
<?php

$result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

$result .= "\n<spots>";

// RETRIEVE $locations from DATABASE

foreach ($locations as $location)
{
$spot = $location->getLocation()->getSpot();
if (!$spot)
continue;
$result .= "\n<spot>";
$result .= "\n<id>" . $location->getLocation()->getSpot()->getIdSpot() . "</id>";
$result .= "\n<name>" . utf8_encode($location->getLocation()->getSpot()->getName()) . "</name>";
$result .= "\n<latitude>" . $location->getLatitude() . "</latitude>";
$result .= "\n<longitude>" . $location->getLongitude() . "</longitude>";
$result .= "\n<radius>" . $location->getRadius() . "</radius>";
$result .= "\n</spot>";
}

$result .= "\n</spots>";

header ("content-type: text/xml");
print $result;

?>

Here is a quick example ;)