How to use the contents of an array to move nodes in the scene?

Hi,

See the below code:

   properties: 
{
 Node0 : cc.Node,
 Node1 : cc.Node,
 Node2 : cc.Node,
},

onLoad () 
{
    
},

start () {
  var Nodes = ["Node0", "Node1", "Node2",];
  var action = cc.moveTo(2, 500, 300);
  this.Nodes[1].runAction(action);  
},

I have created an array called ‘Nodes’ which consits of 3 components “Node0”, “Node1”, “Node2”. These also correspond to the names of cc.Nodes which have been defined in properties. Nodes[1] takes the component in slot 1 of the array which is “Node1”. I have then put this into an action to move the Node1. However the values taken from the array do not work in the .runAction line. It crashes the game.

If I was to put this.label.string = Nodes[1]; this does make the label display the correct line from the array. Does this mean you can’t use values from inside an array as components in the node tree? Or is there a way of making it understand that I want to use them as Nodes from the Node tree, not just the literal word?

Sorry if that is a confusing explanation. Any help/ suggestions would be great! :slight_smile: