This is something I’ve had ‘nearly completed’ for ages, but I feel confident enough to allow others to use it now. With the copious number of history game topics that I’ve got on the SchoolHistory.co.uk website, together with the topics that other history teachers are developing using my ContentGenerator.net programs, I found that it was too tricky for students to find the games they were looking for.
I thus developed a Flash-based menu system that would allow users to search and sort the various games until they found what they were looking for. Having done this I also produced a mini-search tool that I plan to put all across the website so users can find relevant games. Yet as it is Flash, and cleverly hyperlinks to the games page, the search box can actually be used on any website.
By insterting the html code into a webpage anyone can add their own history games search box to their own site.
This sends a search query to the games index page on the SchoolHistory.co.uk website. When someone types a search term into the box and presses the search button, this sends a Flash GetURL command with the search term included. For example, if they searched for ‘Hastings’, the Flash GetURL actionscript would be: http://www.schoolhistory.co.uk/games/index.shtml?searchQuery=hastings
Through some (really) extensive trial and error, I’ve managed to get the Flash menu to ‘look’ at the url and automatically search for the term if one has been added. This is a combination of javascript and FlashVars (our old friends
). I’ve added javascript code to make the Flash work, but when the flash .swf is called it uses: menu.swf+document.location.search. This means that if a search term is present in the url, it is sent to the Flash file when it loads. I’ve found this to be a great way of sending FlashVars automatically to Flash. It does trigger a slight delay, but I feel the trade-off is well worth it. The moment the Flash menu loads, it checks to see if any FlashVars have been sent, and if so, if triggers a search for those terms. Quite a complex solution, but for the end user it seems to work brilliantly.
My only addition that I think would make the search box even more useful would be to ‘pre-populate’ it with a search term. This would mean that if I have a page on the Norman Conquest, this page could load the search box with ‘Norman Conquest‘ already in the box. To make this happen, I’ll need to add a little extra code to the search box so terms can be added via the html. The beauty of this solution is that as the search box is hosted on my site, I will be able to improve it and those who have already added it to their site don’t need to do anything.
3 responses so far ↓
1 Carl // Nov 1, 2005 at 2:18 pm
The new game search & index page is great.
I would like to hear a more technical explanation such as how it was setup, database wise etc..
Great Stuff.
2 Andrew Field // Nov 1, 2005 at 11:05 pm
Thanks Carl. This is probably one of those things that people will hopefully just use rather than consider how it works.
What I’ve done is add the game data as an array - so each game title has its own array that contains the detials e.g. url, all the relevant details, the date of the topic, the autor, suitability and so on.
So it doesn’t actually use a database, it more constructs a database from an array as the Flash file loads.
Then when you select an option by either searching or using the drop-down boxes a new array is built from the existing array, limited to the choices you have made.
I’ll explain in a little more depth how it all works in a separate article, but it is basically a front-end for an array search.
I got ideas from the following suggestions:
http://www.darronschall.com/weblog/archives/000069.cfm
http://www.permadi.com/tutorial/flashQueryString/
+ the functionality of the Macromedia Exchange.
My solution works with Flash 6 and later as this was the school standard when I began working with it. A faster solution would be to use the Flash DataGrid components that now come with Flash. These can be published to work in Flash 7 or later, which most schools should now have installed.
3 Doug Belshaw // Dec 19, 2005 at 10:46 pm
Andrew, the games search tool really is excellent. The pupils at my school use it a lot when they’ve finished an ICT-based lesson instead of ‘wandering’ aimlessly around the Internet. Thus they’re having fun and learning at the same time!
Thanks for putting this together and allowing others to have the search box on their sites!