Well, it'd be helpful to know what choices are being executed from the DialogEx window (hence the request for the APZ, so we can see specifically where your code is failing).
The DialogEx.Show command will only return the result that is passed to the DialogEx.Close action. This is explained in the manual. If you're just trying to load an image based upon a predetermined set of conditions, then create a table of image-names in Globals which the trigger-event can reference and loop thru. If the trigger-event meets the predetermined conditions, it can then make the appropriate selection from this table.
You really need to explain your problem more clearly. It may be clear to you, but for the rest of us, it exists in a 'vacuum'. And we can only work from the info you give us. Upload an APZ (that's actually commented in the place you're having trouble with) and we can go from there.
Announcement
Collapse
No announcement yet.
Quick question on dynamic object name creation
Collapse
X
-
EDIT: As I typed this, I think I figured it out.... lol
After re-reading my original post, I understand the confusion, lol.
Lets start by saying I have 10 image objects. All named plot1gfx, plot2gfx.... all the way to plot10gfx
When I click on the image (on_click), it will open a dialog, and based upon choices made on that dialog, it will return a number (int) which gets assigned to the "result" variable from the dialog call
Example:
Code:result = DialogEx.Show("Buy Plot", true, nil, nil); --this shows the dialog, and waits for the result
(hmmm.. I think I just figured it out)
how about I build a string first, then use it to reference the image object like this....
Code:imageName = "plot"..result.."gfx"; Image.Load(imageName, "AutoPlay\\Images\\Cow.png");
Hope that made more sense.
Leave a comment:
-
-
Can you try to explain your objective a little more clearly (perhaps with an APZ that reveals what you're trying to achieve). At the moment, I'm having trouble following exactly what it is that you're wanting to do.
In regards the first part of your question ...
Originally posted by Stobe View Post...If I show a dialog with this....
result = DialogEx.Show("Buy Plot", true, nil, nil);
can I now modify an image such as....
plot..result..gfx = "AutoPlay\\Images\\Cow.png";
Code:DialogEx.Show("Dialog1"); Image.Load("Image1", "AutoPlay\\Images\\Cow.png");
Leave a comment:
-
-
Quick question on dynamic object name creation
I'm sure I've done this before, but I just can't remember how...
I'm trying to modify an image upon returning from a dialog. Instead of using a bunch of if/then statements on the dialog return, I thought I could perhaps concatenate that result into the object name.
Here's an example:
If I show a dialog with this....
result = DialogEx.Show("Buy Plot", true, nil, nil);
can I now modify an image such as....
plot..result..gfx = "AutoPlay\\Images\\Cow.png";
(I have several images, all named plot1gfx, plot2gfx, plot3gfx, etc).
how to I use the "result" from the dialog return to modify those images without doing something like...
if (result == 1) then
plot1gfx = ....
else if (result ==2) then
plot2gfx = ....
end
Thanks as always!
-Stobe
Tags: None
-
Leave a comment: