xboxscene.org forums

Author Topic: Somebody Want To Explain This  (Read 135 times)

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Somebody Want To Explain This
« on: February 28, 2004, 05:24:00 PM »

I see the stuff in the ActionScriptReadMe.txt but it's got me confused.
LoadDialogFromXML <UIHandle> <XMLHandle> <XMLLocation>

Now would this be how it works if you had multiple dialogs in one XML file?

XMLOpen ScriptXML $ActualPath$\Scripts\SomeScript\SomeScript.xml
LoadDialogFromXML FirstDLG ScriptXML !.FirstDialogToLoad
LoadDialogFromXML SecongDLG ScriptXML !.SecondDialogToLoad

Is the XMLHandle like a Variable of sorts for the main script\dialog xml file location? That way you don't have to keep specifying the file location whenever you want to create a dialog? And does this mean that if you use XMLClose then your dialog will mess up (Like you can't GET or SET values)?
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Somebody Want To Explain This
« Reply #1 on: February 28, 2004, 06:05:00 PM »

QUOTE (flattspott @ Feb 28 2004, 10:24 PM)
I see the stuff in the ActionScriptReadMe.txt but it's got me confused.
LoadDialogFromXML <UIHandle> <XMLHandle> <XMLLocation>

Now would this be how it works if you had multiple dialogs in one XML file?

XMLOpen ScriptXML $ActualPath$\Scripts\SomeScript\SomeScript.xml
LoadDialogFromXML FirstDLG ScriptXML !.FirstDialogToLoad
LoadDialogFromXML SecongDLG ScriptXML !.SecondDialogToLoad

Is the XMLHandle like a Variable of sorts for the main script\dialog xml file location? That way you don't have to keep specifying the file location whenever you want to create a dialog? And does this mean that if you use XMLClose then your dialog will mess up (Like you can't GET or SET values)?

The example you types in is exactly how it's used.

You open an XML object, then create new Dialog UI Objects from nodes within the XML.

Alternatively, you might have:

CODE

XMLOpen ScriptXML $ActualPath$\Scripts\SomeScript\SomeScript.xml
LoadDialogFromXML FirstDLG ScriptXML !.Dialogs.Dialog?DlgID=IPSetupOne
LoadDialogFromXML SecongDLG ScriptXML !.Dialogs.Dialog?DlgID=IPSetupTwo


to take advantage of the new query locational method.

...and yes, you should keep the XML object around for the life of the dialogs, unless it's an internal XML node.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Somebody Want To Explain This
« Reply #2 on: February 28, 2004, 07:11:00 PM »

So what I had would work then, but I could also do it the other way you posted?
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Somebody Want To Explain This
« Reply #3 on: February 28, 2004, 07:23:00 PM »

QUOTE (flattspott @ Feb 29 2004, 12:11 AM)
So what I had would work then, but I could also do it the other way you posted?

Exactly.

I added the query format because it's far superior for tracking dialogs and controls within nodes.

Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Somebody Want To Explain This
« Reply #4 on: February 29, 2004, 09:50:00 AM »

Yes it is superior. No more counting nodes and forgetting to start at 0.  smile.gif
Logged