Expand my Community achievements bar.

SOLVED

Variable from an array for Presence property

Avatar

Level 3

I would like my case statement to get the name of an image from the array and use that to unhide itself. The rest of the script works fine but the image name is not getting passed to the presence property. Can anyone help?

var a01 = Array("project title"  ,  "projectsubtitle"  ,  "nameofImage"  ,  "blurbtext");

switch(this.rawValue){
  case "0":
    projecttTitle.rawValue = a01[0];
    projectSubTitle.rawValue = a01[1];
    a01[2].presence = "visible";
    projectText.rawValue = a01[3];
    break;

etc.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi Maliki,

When you use brackets in a reference syntax in Javascript, you must use the resolveNode() method.

And, in your array assignment statement, I believe you may need to use the Ref() method for a form object as an array element.

Stephen

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

Hi Maliki,

When you use brackets in a reference syntax in Javascript, you must use the resolveNode() method.

And, in your array assignment statement, I believe you may need to use the Ref() method for a form object as an array element.

Stephen

Avatar

Level 3

Great! That did it:

resolveNode(a01[2]).presence = "visible";