title: Uncaught TypeError: Cannot read property 'add' of undefined tinymce version 4.x
body: <p>I am  using tiny mce 4.x version, this is the code I wrote in html file</p>
  
  <pre><code> &lt;script type="text/javascript" src="tinymce/tinymce.min.js"&gt;&lt;/script&gt;
   &lt;script&gt;
     tinymce.init({
      selector: "textarea#elm1",
      theme: "modern",
      width: 500,
      height: 300,
      plugins: [
           "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
           "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
           "save table contextmenu directionality emoticons template paste textcolor"
     ],
        content_css: "css/content.css",
        toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons", 
         style_formats: [
             {title: 'Bold text', inline: 'b'},
             {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
             {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
             {title: 'Example 1', inline: 'span', classes: 'example1'},
             {title: 'Example 2', inline: 'span', classes: 'example2'},
             {title: 'Table styles'},
             {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
        ],
       setup : function(ed) {
          ed.onBeforeRenderUI.add(function(ed, cm) {
           console.log('add function called');
         });
         ed.onLoadContent.add(function(ed, o) {
             console.log('add function called');
        });
  }
  
  
  }); 
  </code></pre>
  
  <p>  </p>
  
  <pre><code>&lt;body&gt;
      &lt;textarea id="elm1" name="area"&gt;&lt;/textarea&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I am getting the error </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'add' of undefined when
    calling onBeforeRenderUI.add() method</p>
  </blockquote>
  
  <p>.  Please help me as how to resolve this issue.  Thank You.</p>