![]() |
Variable question
Is it possible to use a variable inside of a location string?
ie: Code:
Parent.Parent.(OBJECT).visible=true OBJECT=nameSo far I've managed to crash the UIBuilder, or have nothing happen :) *edit* My workaround for now, which works fine, is to just use a slightly different method. Original Info Center uses a slew of buttons that each hide every related page, and then unhide the appropriate one. This is just way too many lines of script. So, I decided to just make a hidden button that does this same thing, which when activated hides all the pages, then deactivates itself. This way, all buttons only need to set a variable with the correct name, and then activate the hidden button. |
Anything is 'possible' if you put your mind to it, Drum! ;)
|
1 Attachment(s)
Quote:
Here's an example where a visible page gets hidden when another page is shown.. I'm not sure if thats what you're trying to accomplish but I'm pretty sure this is what you're looking for: Code:
<?xml version="1.0" encoding="utf-8"?> |
I've been trying to mess with your example Talyns, but I can't seem to get it to work.
I tried a simple: OnActivate=('Parent.')##(name)##('.visible=false') ... in attempt for an object to hide itself, but it wouldn't work. I was trying at first to set a variable in another object, but thought I'd first see if I can do something basic. Is my syntax incorrect? I have a feeling you can only set a property using a variable, but not navigate the XML tree with a variable. I may have a work-around to what I'm currently working on, but it's no big deal. Looking at the code again, I see how I could set where I want to go in the tree as the variable in an object, and then execute it using the onActivate. Ugh, so many steps just to do something with a variable ;) |
Yeah, I definitely over complicated what I was trying to do, but your example may still be able to help in some other ideas I have :rolleyes:
|
Quote:
The first step is to resolve your (name). Once you have that done, you can then resolve the XML path and address the visible parameter. As an example an excerpt from my curing code which pulls the cure spell name from a file based on several variables. This is a three step process where I first "build" the correct location in the XML tree for the name, then create a script to pull the name into another variable and finally execute that script: <Button Name="Configure"/> |
Indeed. I totally overlooked the basis of it. I understand it now, and got it working. But in the end, I didn't need to use it. But I'm sure I'll use this new knowledge soon enough :nana:
|
| All times are GMT -5. The time now is 09:24 AM. |
vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI