0 Replies Latest reply on Jan 10, 2007 7:03 AM by zaxis

    Javascript > ExternalInterface execution bug

    zaxis
      I am getting some very strange behaviors! It takes a little explaining.

      I have 2 identical SWF's added using swfobject.

      JAVASCRIPT:

      var swf = new SWFObject("controls/MiniCart.swf", "miniCart", "200", "450", "8", "#ffffff");
      swf.write("flashcart");

      var swf = new SWFObject("controls/MiniCart.swf", "miniCart2", "200", "450", "8", "#ffffff");
      swf.write("flashcart2");

      a button on each movie triggers a javascript method "refresh", this JS method will then call the "refresh" callback inside each of the movies to update their display. They are only updated from javascript, so any update at all confirms that the javascript method is getting called.

      JAVASCRIPT:

      function refresh(){
      getShopMovie("miniCart").refresh(); // call actionscript on first movie
      getShopMovie("miniCart2").refresh(); // call actionscript on second movie
      }

      INTENDED RESULT: clicking the button in either movie should make both SWF's update

      RESULT:

      1. when I click the button in the first movie, only the first movie updates.
      2. when I click the button in the second movie, only the second movie updates.

      QUESTION:

      Can anyone explain this strange behavior? and a possible workaround?