urgent help with 'if' statement!

Discuss Interactive Design & Flash® (SWF) Export inside QuarkXPress 7, 8 & 9.
Exchange ideas, share helpful tips and get started with your first interactive design.
Please note that Flash (SWF) authoring is not supported in QuarkXPress 10 anymore.
Locked
MarkyBoy
Posts: 175
Joined: 22 Feb 2010, 10:58

urgent help with 'if' statement!

Post by MarkyBoy » 04 Nov 2012, 23:22

Hi all, I'm really close to fixing this one but I just can't seem to get it!
I have a list of values and for each value selected I want to show a particular image, so I can do it for the first item like this:
If "TextBox3" Is First Item Selected
Show Objet "image1"
But there are no options to then have for example:
If "TextBox3" Is Second Item Selected
Show Object "image2"
I tried to use an expression but got a message sayine 'Seledted variable not defined'
How do I do this simple action?!

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

urgent help with 'if' statement!

Post by Matthias Guenther (Quark) » 05 Nov 2012, 01:31

Hi mark,
if you get the error "variable not defined" then you used a name that is not known elsewhere. E.g. a typo in a text box name.
Thanks
Matthias

MarkyBoy
Posts: 175
Joined: 22 Feb 2010, 10:58

urgent help with 'if' statement!

Post by MarkyBoy » 05 Nov 2012, 03:28

Thanks MatthiasIt's the 'selected' variable that Quark says is not defined, so I enter an expression that says:If"TextBox3" Is Second Item SelectedI immediately get a message saying the 'selected' variable is not defined.What do you think?

Matthias Guenther (Quark)
Quarkian
Quarkian
Posts: 2490
Joined: 04 Jun 2004, 15:06
Contact:

urgent help with 'if' statement!

Post by Matthias Guenther (Quark) » 06 Nov 2012, 22:23

Hi Mark,
when you use expressions you need to use the methods that are supported, so only the ones that are listed in the Expression Editor.
To find out what text is selected, the expression "TextBoxName.GetSelectedText()" should work.
Thanks
Matthias

MarkyBoy
Posts: 175
Joined: 22 Feb 2010, 10:58

urgent help with 'if' statement!

Post by MarkyBoy » 07 Nov 2012, 00:19

Thanks Matthias
I do not see the GetSelectedText command in the list in the expression editor, so I typed it in and it was accepted, however I have something wrong in the script, that I can't figure out why it does not work, I have the following:
Select Text "TextBox7", All
If Textbox7.GetSelectedText()="K"
Show Object "Test"
End If
Then assigned this script to an object with an event to run the script, but nothing happens! Any suggestions?

MarkyBoy
Posts: 175
Joined: 22 Feb 2010, 10:58

urgent help with 'if' statement!

Post by MarkyBoy » 07 Nov 2012, 05:18

Okay, I got it working by using the following:
Select Text "TextBox7", All
TextBox6.GetSelectedText()==="K"
Show Object "Test"
End If
My next question is whether I can add letters to the if statement so that if TextBox7 shows "J" then also show object "Test" or do I need to make a separate statement for each one?

Locked

Return to “General authoring questions”