This content has been marked as final. Show 7 replies
you dont have to store the variable in one external file. Just store it on the _root.
Like put an array on your _root that will contain all the result of your questions. It can be numbers (if you want to give a note on 100%) or true/false.
Example (i will use the number to give a 100% at the end):
Hope it will help you!
Many thanks... but the problem is that I have one question per swf... so maybe storing the results in the _root will not work... right?
As I understand, your method will only work if I use always the same swf. Please tell me if I'm wrong.
Youre wrong. In any swf that is loaded, the _root is always the first swf not the loaded swf. So dont worry, your data will always be accessible via the _root for any loaded swf.
I made a mistake in my code ... the last line shoule be :
trace("Points = " + totalPoints);
mmm... maybe I still don't understand, each swf will be completely independent to each other, I will not use loadmovie or something similar to load them.
I'd rather prefer to do it with using an external file to store the results, maybe it will be more versatile and will have no problems in any way that I decide to use those swf. Thanks for your patience.
continu to use the loadmovie. There is no problem about it. The thing is that each swf loaded cant talk to each others if they are unload when a new one is loaded. So thats why you need to keep the results in one place that will be available for every swf.
When the test is complete and you load your final swf, this swf is not aware of the result of the preceding questions. But he will be able to know it by asking the _root. Once a swf is loaded, his own _root is not recognized as THE MAIN _root. The main _root is the _root of the first swf ... the one embeded in your html page.
So lets assume this: For each questions swf, when the user press the button to continu, you evaluate his/her answer and store in the _root the points for that question (ex: zero if false or 2 if right).Now, when test is completed, you load a final swf to show the result. When this swf is completely loaded, he ask the _root what are the results. He process those data and display them like you programed it to do.
I'm making this as a part of a work and I don't know how the people who is in charge will continue developing this test, which is part of a larger work. That's why I need to make everything working by its own, without depending in the html file or main swf...
Loading and storing the values in an external file seemed the best to me, but many thanks anyway. I'm sure your method works OK but maybe is not appropiate for what I need now.
I will listen to suggestions of whoever wants to help me in some other way. Thanks a lot.