all groups > flash data integration > december 2005 >
You're in the

flash data integration

group:

dynamic xml filenames through .asp


dynamic xml filenames through .asp whitearrayan
12/29/2005 3:54:28 PM
flash data integration: I have a Flash application that consists in a multiple choice test. The
questions and answers are loaded from an .xml file using:

doc.load("quiz.xml")

First question: Can I make the name of the archive "quiz.xml" dynamic so I can
have only one page with different quizzes? I have unsuccessfully tried with
something like

var x;
var doc = new XML();
doc.load(x+".xml")


Second question: Can I get the value for var x from the same .asp page the
..swf file is in? How do I pass it from asp to flash?

Thank you
Re: dynamic xml filenames through .asp knoxx
12/29/2005 10:58:18 PM
Hi,

To answer your first question, yes you can make different xml pages that hold
different types of quizzes. And your second question is you can pass a variable
through an .asp page through flash by using the flashvars technique. In your
..asp page your can simply put flashvars=myXmlPageVar=<%=xmlpage%>. Here's a
link on how to use it:

http://www.permadi.com/tutorial/flashVars/

But a more efficient way to do it is by using categories in your xml page to
define the different type of questions. So that way you don't have to post back
and all the questions will get loaded at once. I'm not sure how you are doing
it, but that's just a suggestion. Hope that helps.

Thanks,
Jaime
Re: dynamic xml filenames through .asp whitearrayan
12/30/2005 12:43:07 PM
Thank you, Jaime, for your advice.
I'll put that into practice and see what happens.
AddThis Social Bookmark Button