|
-
Everyone in this forum seems to have a good deal of experiece and always come up with unique ideas and ways to approach a task...
Here's one that has had me thinking... and I cannot come up with what I think would be the best way...
I would like to make a flash file that has a query field for a user to input a zipcode. The swf would then return a Name and Phonenumber for a salesperson assigned to that zipcode.
I can find many resources to let me do this in a CGI/HTML environment.... however...
I would like to be able to have this on a cdrom and a website.
Has anyone done anything like this in Flash... better yet... in Koolmoves? Is it possible?
Any ideas or pointing in the right direction would be appreciated.
-
Here is a VERY simple ActionScript solution.
On the main movie put two dynamic text boxes.
One named "zipToFind"
One named "result"
//Frame 1
//======================
rep1 = "ZipCode 2745 - Dave, 123456";
rep2 = "ZipCode 2356 - Bob, 45678";
rep3 = "ZipCode 2785 - Dave, 61425";
rep4 = "ZipCode 2935 - Dave, 67801";
rep5 = "ZipCode 2672 - Dave, 56182";
rep6 = "ZipCode 2762 - Dave, 37894";
rep7 = "ZipCode 2173 - Dave, 78219";
rep8 = "ZipCode 2001 - Dave, 89125";
rep9 = "ZipCode 2981 - Dave, 98752";
function search(zip){
for (i = 1; i < 10; i++){
rep = eval("rep" + i);
if ( rep.substring(8,12) == zip){
return result = rep;
} else {
result = "";
}
}
}
//Frame 2
//================================
search(zipToFind);
//================================
Run the movie and enter one of the zip codes in the first text box "zipToFind"
The second text box should display the matching record.
This can obviously be refined alot, but it gives you an idea.
Regards
Hilary
--
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|