title: Flash player control from javascript outside?
body: <p>I am making flash player that suppose to be controlled from outside, from javascript.</p>
  
  <p>I need those methods:
  Play/Pause and Volume level</p>
  
  <p>I am stuck with volume level... I tried to add this code:</p>
  
  <pre><code>flashMovie.volume = 10;
  </code></pre>
  
  <p>Where flashMovie is flash instance... And it's show <strong>NO ERROR</strong> but it's <strong>NOT WORKING</strong></p>
  
  <p>I try to make inner AddCall(); and then when it's called to call() from javascript to return sound level.</p>
  
  <p>AS 3:</p>
  
  <pre><code>function setthisvolume()
  {
          var vlm = ExternalInterface.call('giveMeVolume()');
          this.soundTransform.volume = vlm;
  }
  
  ExternalInterface.addCallback("setthisvolume", setthisvolume);
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var soundlevel = 10;
  
  function soundlevelset()
  {
      var flashMovie=getFlashMovieObject("objswf");
      flashMovie.setthisvolume();
  
  }
  
  function giveMeVolume()
  {
      return parseInt(soundlevel);
  }
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <p><strong>Error calling method on NPObject!</strong></p>
  
  <p>I even tried with setInterval():</p>
  
  <p>AS 3:</p>
  
  <pre><code>function setthisvolume()
  {
          var vlm = ExternalInterface.call('giveMeVolume()');
          this.soundTransform.volume = vlm;
  }
  
  setInterval(setthisvolume, 1000);
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>var soundlevel = 10;
  
  function giveMeVolume()
  {
      return parseInt(soundlevel);
  }
  </code></pre>
  
  <p>And it doesn't show any error, but it doesn't work neither...</p>
  
  <p>Did someone work with stuffs like this?</p>
  
  <p>Can someone help me what I am doing wrong here...</p>
  
  <p>Thank you!</p>