If you've been reading my blog lately, you'll know that I'm working on a Flash-based simulation. Haven't had much time to spend on this sim project, but what I have done is promising. I've been able to upgrade to FileMaker Pro 8.5, so I've got the latest tools. What I really need to do right now is plan how this is going to work.
A decision tree would be most valuable at this point to be able to see where things are supposed to go. If that doesn't come quickly enough I can navigate thru the demo file and take screenshots and print them out just to get started. It's not too extensive.
I'm thinking that I'll use a counter in the Flash movie to be the "boss". By that I mean that I'll pass one number to the Flash arrays so that it will populate the rest of the movie. So, if I want to go to the scene that's listed in record 6 in the FileMaker database, I'll make the counter read 5, since arrays start with 0 instead of 1. I will most likely have separate arrays for each field in the database. Since the arrays are parallel, passing the number 5 would give me all the fields associated with that record in FileMaker. For example...
background_img = backgroundArray[0].firstChild;
description = descriptionArray[0].firstChild;
...would give me the background image and the description of the scene that is listed as the first record in the database (since arrays start with 0).
background_img = backgroundArray[5].firstChild;
description = descriptionArray[5].firstChild;
...would give me both values for the 6th record in the database. And again, there will be many fields in the record for each scene (2-4 possible answer choices, the next scene that each answer will make you go to, points for each answer, feedback, etc.).
So what I'd need to do is associate that number with the answer that is chosen on any given scene in the sim. If the user chooses the first of 4 answers, for example, the counter might be updated to 5, we'll say. Perhaps if they choose the second answer they might be sent to scene 10. It doesn't really matter what order the records are made as long as they accurately point to the right scene. Pretty simple concept actually, and XPath should be very helpful in pulling it off.