Creating partial word searches in Flash

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
FuZzY665
Registered User
Posts: 58
Joined: 11 Aug 2006, 02:00
Location: Durban
Contact:

Creating partial word searches in Flash

Post by FuZzY665 »

Sup Guys

I'm trying to create a search function in the site I'm currently building.
It is flash based and all the data is pulled dynamically from XML files.

I've managed to get as far as searching for items, but the whole item name must be used.
What I'm struggling with is how can I search for partial words.

This is the code that does the searching after the XML is loaded.

Code: Select all

//Word entered to search for
var filterValue:String = nameTile.toLowerCase();
//Matching the word against items in the XML
var filteritems:String = xmldata.product.(tile == filterValue);
//Returns if item is found or not
var index:int = filteritems.indexOf(filterValue);
if (index != -1) {
	trace(filteritems);
} else {
	trace("Item not found");
}
Anyone know the best way to do this?
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Creating partial word searches in Flash

Post by rustypup »

Most people would sooner die than think; in fact, they do so - Bertrand Russel
maxxis
Moderator Emeritus
Posts: 8307
Joined: 30 Jun 2004, 02:00
Location: ( . Y . )
Contact:

Re: Creating partial word searches in Flash

Post by maxxis »

Ive done this before.

Ill look for the code and upload it.

The module would build words based on the keystrokes and filtered from the xml data collected by the parser.

What do you want to use it for?
User avatar
rustypup
Registered User
Posts: 8872
Joined: 13 Dec 2004, 02:00
Location: nullus pixius demonica
Contact:

Re: Creating partial word searches in Flash

Post by rustypup »

regex quickstart - very helpful site...
regex in CS3...
Most people would sooner die than think; in fact, they do so - Bertrand Russel
FuZzY665
Registered User
Posts: 58
Joined: 11 Aug 2006, 02:00
Location: Durban
Contact:

Re: Creating partial word searches in Flash

Post by FuZzY665 »

It's so the user of the site can search for a specific product by name
Post Reply