Scripting xml panel with javascript ( E4X)

Home Forums General Programming Scripting xml panel with javascript ( E4X)

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #374
    netchose
    Participant
      • Topics: 15
      • Replies: 70
      • Total: 85

      this is a very simple exemple :

      [code:1t98f2uo]<html>
      <body>
      <script>

      var Panel= new XML();
      Panel =<panel name=[/code:1t98f2uo]

      copy and paste the xml content of you panel

      [code:1t98f2uo]var txtArea = document.createElement(‘XMP’)

      var mods=Panel["modulator"].(component.@uiType =="uiButton");[/code:1t98f2uo]

      create an html tag which will contain your xml code and a filter wich will select all your buttons

      [code:1t98f2uo]for (var i = 0; i < mods.length(); i++) {

      if(mods[i].component.@componentGroupName!=""){

      var modulNom=new String(mods[i].@name);
      var link=modulNom.replace("button","slider");

      mods[i].@modulatorLinkedToModulatorProperty="modulatorValue"
      mods[i].@modulatorLinkedToModulator=link;

      }
      }
      txtArea.innerHTML=Panel.toString();

      document.getElementsByTagName("body")[0].appendChild(txtArea);
      </script>

      </body>
      </html>[/code:1t98f2uo]

      loop through your buttons and change their attributes : here i have changed 512 links

      E4X is an xml javascript extension for Firefox. you just need FF and a note pad

    Viewing 1 post (of 1 total)
    • The forum ‘Programming’ is closed to new topics and replies.
    There is currently 0 users and 57 guests online
    No users are currently active
    Forum Statistics
    Threads: 2,495, Posts: 17,374, Members: 77,605
    Most users ever online was 12 on January 22, 2019 3:47 pm
    Ctrlr