'Comment Out' Interactions?


#1

Hi Everyone!
I’m hoping someone can help me, is there a way to ‘comment out’ () an interaction in Axure like you would in a html file?
I would like to preview certain pages with or without different interactions or even work for the entire day while certain interactions are hidden and then unhide them at the end of the day. (I guess without having to delete them and then re-instate them later) Hoping this makes sense! hahahaha
Thank you to anyone in advance :slight_smile:


#2

Hi @muellie, unfortunately, right now, there is no way to ‘comment out’ interactions in Axure. The good news is that it is on our roadmap. Please let us know if you have other suggestions; we’d love to see them!


#3

would be very very useful


#4

If I want to disable an interaction or conditional case, I add this condition: If "1" equals "2" or If "true" equals "false" so it always equates to false. I find it very helpful for debugging and testing.

If you want to turn this on/off easily from one place, and/or have it apply in many places, you could use a global variable, text value, or really any testable state of a widget (like shown/hidden, selected/unselected, etc.) The advantage of a global variable is it can be used across multiple pages, but also limited to just one or a few pages if needed.

First, set up conditional cases for all your “blockable” interactions that include a test of a global variable, let’s say one named, “CommentOut”. For example, if you have a button that links to Page 2, an interaction would look like:

Click or Tap
Case 1
If value of CommentOut does not equal “true”
Open Link
Page 2

…Then to “comment out” this interaction (and any others which include this conditional case) just set CommentOut to “true”. You could do this in the Project > Global Variables > Default Value to apply to all pages from one place. Note that you’ll need to reinitiate the Preview (and/or republish HTML) in order to apply the new default value. In other words, if you preview a prototype in a browser, then change the default value of a global variable in the Axure RP app, then go back to the browser, it won’t recognize the new default–just as it would not recognize a newly added global variable or page. You’d need to close the prototype tab in the browser, then Preview again from Axure RP.

If you want to limit this “comment out” behavior to a specific page or pages, then you could keep the default variable value as blank or “false”, then use the Page Loaded event to Set Variable Value CommentOut to "true". Conversely, if you want it to apply by default to all pages except Page 1, then on Page 1 you could set CommentOut to “false” and then be sure to set it to “true” just before opening any other page. You could also limit this to only some interactions on the same page by applying similar logic to a group or dynamic panel.

Another extension of this would be to assign a Page Key Up event to enable keyboard shortcuts to turn on/off this “comment out” behavior. For example, to use the key combo Alt+C as a “comment out” toggle, use something like,

Page Key Up
Case 1
If key pressed equals “Alt+C”
Set Variable Value
CommentOut to “[[!CommentOut]]”
Open Link
Reload

You could add a Page Loaded case that tests the current time. Let’s say you want the blockable interactions to work only after 5:30 pm, you could include on each page:

Page Loaded
Case 1
If “[[Now.getHours()]]” is greater than or equals “17” and “[[Now.getMinutes()]]” is greater than or equals “30”
Set Variable Value
CommentOut to “false”
Open Link
Reload

…and if you wanted this to happen automatically in real time, without reloading the page, you can test the current time continuously, like every minute, by setting up a dynamic panel as a timer. Let’s say the panel is named, “Timer” and has two blank states. Include code like:

Page Loaded
Set Panel State
Timer to Next wrap repeat every 60000 ms

…then for the dynamic panel, “Timer”:

Panel State Changed
Case 1
If “[[Now.getHours()]]” is greater than or equals “17” and “[[Now.getMinutes()]]” is greater than or equals “30”
Set Variable Value
CommentOut to “false”


Here’s another approach I just thought of… Sometimes I’ll just drag in a hotspot to cover a button or area with other interactions, in order to temporarily block those interactions. Or, I’ll make a rectangle with no border and partial opacity to match the background, like a white box set to 50% opacity. This can make whatever widgets that are behind it look disabled and also block all of their interactions. So, you could build your pages with this kind of widget that is sent to back and/or hidden by default. Include a Loaded or Page Loaded event that tests the value of the CommentOut global variable. If “true” show “This” and bring to front, else if “false” hide and/or send to back. This approach would be useful if you want to block all interactions for widget(s) instead of just one event, and you don’t want to edit all the events to add in conditional cases to test the value of CommentOut.

…And another! (cue DJ Khaled)
You could have each widget enable/disable itself based on the value of the CommentOut variable. This would block all of its interactions. It wouldn’t work for commenting out only one event or case. Use my first approach for that.