Loading ...
Sorry, an error occurred while loading the content.

Flex widget inside layout manager cannot be called from javascript in IE

Expand Messages
  • aniad
    Hello, I m having a real problem with Layout Manager hosting a flex widget in the center pane in IE. Specifically the problem has to do with javascript
    Message 1 of 9 , Sep 2, 2008
    • 0 Attachment
      Hello,

      I'm having a real problem with Layout Manager hosting a flex widget in
      the center pane in IE. Specifically the problem has to do with
      javascript calling flex. The flex widget registers javascript
      callbacks which work fine in Firefox. However they do not in IE. The
      problem is directly related to the Layout Manager, as eliminating the
      Layout, ie putting the flex widget just in a simple <div>, solves the
      problem.

      My code looks something like:

      function initLayout()
      {
      layout = new YAHOO.widget.Layout('layoutDiv',
      {
      height: 500,//800,
      units: [
      { position: 'center', height: 490, scroll: false,
      resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse: true,
      collapseSize: 50, maxWidth: 1000 }
      ]
      });

      }

      Function callFlex()
      {
      Document.getElementById("myFlexWidget").Flex_SetView(); //
      "Flex_SetView" is a registered callback in action script
      }

      YAHOO.util.Event.onDOMReady(initLayout);

      <body class=" yui-skin-sam">

      <button onclick="callFlex();">show flex problem</button>

      <div id="selectorDiv" style="display:none">
      <OBJECT
      classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="myFlexWidget"
      Flex widgetÂ….
      </OBJECT>
      </div>
      </div>

      </body

      The error in IE is "Unspecified Error" in some IE javascript code:

      function __flash__addCallback(instance, name) {
      instance[name] = function () {
      return eval(instance.CallFunction("<invoke name=\""+name+"\"
      returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
      "</invoke>"));
      }
      }

      Both params, instance and name are valid. We found this article on
      the subject, http://www.airtightinteractive.com/news/?p=71, and we are
      already doing everything suggested in this article. Again, as stated
      above, eliminating the layout manager allows the flex callbacks to
      work again.

      Please advise, thank you!

      Ania.
    • Dav Glass
      aniad -- Please post a link so I can see it, the code doesn t help me if I can t see the issue :D Thanks Dav Dav Glass dav.glass@yahoo.com blog.davglass.com +
      Message 2 of 9 , Sep 2, 2008
      • 0 Attachment
        aniad --

        Please post a link so I can see it, the code doesn't help me if I can't see the issue :D

        Thanks
        Dav

        Dav Glass
        dav.glass@...
        blog.davglass.com




        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +



        ----- Original Message ----
        > From: aniad <aniad@...>
        > To: ydn-javascript@yahoogroups.com
        > Sent: Tuesday, September 2, 2008 10:54:42 AM
        > Subject: [ydn-javascript] Flex widget inside layout manager cannot be called from javascript in IE
        >
        > Hello,
        >
        > I'm having a real problem with Layout Manager hosting a flex widget in
        > the center pane in IE. Specifically the problem has to do with
        > javascript calling flex. The flex widget registers javascript
        > callbacks which work fine in Firefox. However they do not in IE. The
        > problem is directly related to the Layout Manager, as eliminating the
        > Layout, ie putting the flex widget just in a simple
        , solves the
        > problem.
        >
        > My code looks something like:
        >
        > function initLayout()
        > {
        > layout = new YAHOO.widget.Layout('layoutDiv',
        > {
        > height: 500,//800,
        > units: [
        > { position: 'center', height: 490, scroll: false,
        > resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse: true,
        > collapseSize: 50, maxWidth: 1000 }
        > ]
        > });
        >
        > }
        >
        > Function callFlex()
        > {
        > Document.getElementById("myFlexWidget").Flex_SetView(); //
        > "Flex_SetView" is a registered callback in action script
        > }
        >
        > YAHOO.util.Event.onDOMReady(initLayout);
        >
        >
        >
        > show flex problem
        >
        >

        >
        >
        >
        >
        >
        >
        > The error in IE is "Unspecified Error" in some IE javascript code:
        >
        > function __flash__addCallback(instance, name) {
        > instance[name] = function () {
        > return eval(instance.CallFunction("> returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
        > ""));
        > }
        > }
        >
        > Both params, instance and name are valid. We found this article on
        > the subject, http://www.airtightinteractive.com/news/?p=71, and we are
        > already doing everything suggested in this article. Again, as stated
        > above, eliminating the layout manager allows the flex callbacks to
        > work again.
        >
        > Please advise, thank you!
        >
        > Ania.
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
      • aniad
        Hello Dav, I don t really have a site available that is outside of a firewall, so I have a zip file for you here:
        Message 3 of 9 , Sep 3, 2008
        • 0 Attachment
          Hello Dav,

          I don't really have a site available that is outside of a firewall, so
          I have a zip file for you here:

          https://download.amberpoint.com/forYahoo/forYUI.zip
          Username: Yahoo
          Password: bug4yahoo

          Please put these files on some server and then access
          flexInLayoutProblem.html (it has to be accessed via some server,
          localhost for example, not local file system, otherwise flex runs into
          security problems)

          As I've commented in that .html file, if you create the flex widget
          outside of the layout manager then calling it in IE is not a problem.
          However, putting the flex widget inside the layout prevents it from
          being able to be called in IE. It works fine in Firefox.

          I've also included TestExternalInterface.zip which is the source for
          the simple flex widget.

          Please advise.
          Ania.



          --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
          >
          > aniad --
          >
          > Please post a link so I can see it, the code doesn't help me if I
          can't see the issue :D
          >
          > Thanks
          > Dav
          >
          > Dav Glass
          > dav.glass@...
          > blog.davglass.com
          >
          >
          >
          >
          > + Windows: n. - The most successful computer virus, ever. +
          > + A computer without a Microsoft operating system is like a dog
          > without bricks tied to its head +
          > + A Microsoft Certified Systems Engineer is to computing what a
          > McDonalds Certified Food Specialist is to fine cuisine +
          >
          >
          >
          > ----- Original Message ----
          > > From: aniad <aniad@...>
          > > To: ydn-javascript@yahoogroups.com
          > > Sent: Tuesday, September 2, 2008 10:54:42 AM
          > > Subject: [ydn-javascript] Flex widget inside layout manager cannot
          be called from javascript in IE
          > >
          > > Hello,
          > >
          > > I'm having a real problem with Layout Manager hosting a flex widget in
          > > the center pane in IE. Specifically the problem has to do with
          > > javascript calling flex. The flex widget registers javascript
          > > callbacks which work fine in Firefox. However they do not in IE. The
          > > problem is directly related to the Layout Manager, as eliminating the
          > > Layout, ie putting the flex widget just in a simple
          > , solves the
          > > problem.
          > >
          > > My code looks something like:
          > >
          > > function initLayout()
          > > {
          > > layout = new YAHOO.widget.Layout('layoutDiv',
          > > {
          > > height: 500,//800,
          > > units: [
          > > { position: 'center', height: 490, scroll: false,
          > > resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse: true,
          > > collapseSize: 50, maxWidth: 1000 }
          > > ]
          > > });
          > >
          > > }
          > >
          > > Function callFlex()
          > > {
          > > Document.getElementById("myFlexWidget").Flex_SetView(); //
          > > "Flex_SetView" is a registered callback in action script
          > > }
          > >
          > > YAHOO.util.Event.onDOMReady(initLayout);
          > >
          > >
          > >
          > > show flex problem
          > >
          > >
          >
          > >
          > >
          > >
          > >
          > >
          > >
          > > The error in IE is "Unspecified Error" in some IE javascript code:
          > >
          > > function __flash__addCallback(instance, name) {
          > > instance[name] = function () {
          > > return eval(instance.CallFunction(">
          returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
          > > ""));
          > > }
          > > }
          > >
          > > Both params, instance and name are valid. We found this article on
          > > the subject, http://www.airtightinteractive.com/news/?p=71, and we are
          > > already doing everything suggested in this article. Again, as stated
          > > above, eliminating the layout manager allows the flex callbacks to
          > > work again.
          > >
          > > Please advise, thank you!
          > >
          > > Ania.
          > >
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          >
        • aniad
          Hi Dav, I don t mean to come off impatient, but w/o some insight into this problem our app will not work in IE. I will very much appreciate any
          Message 4 of 9 , Sep 5, 2008
          • 0 Attachment
            Hi Dav,

            I don't mean to come off impatient, but w/o some insight into this
            problem our app will not work in IE. I will very much appreciate any
            advise/observations you might have.
            a.

            --- In ydn-javascript@yahoogroups.com, "aniad" <aniad@...> wrote:
            >
            > Hello Dav,
            >
            > I don't really have a site available that is outside of a firewall, so
            > I have a zip file for you here:
            >
            > https://download.amberpoint.com/forYahoo/forYUI.zip
            > Username: Yahoo
            > Password: bug4yahoo
            >
            > Please put these files on some server and then access
            > flexInLayoutProblem.html (it has to be accessed via some server,
            > localhost for example, not local file system, otherwise flex runs into
            > security problems)
            >
            > As I've commented in that .html file, if you create the flex widget
            > outside of the layout manager then calling it in IE is not a problem.
            > However, putting the flex widget inside the layout prevents it from
            > being able to be called in IE. It works fine in Firefox.
            >
            > I've also included TestExternalInterface.zip which is the source for
            > the simple flex widget.
            >
            > Please advise.
            > Ania.
            >
            >
            >
            > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
            > >
            > > aniad --
            > >
            > > Please post a link so I can see it, the code doesn't help me if I
            > can't see the issue :D
            > >
            > > Thanks
            > > Dav
            > >
            > > Dav Glass
            > > dav.glass@
            > > blog.davglass.com
            > >
            > >
            > >
            > >
            > > + Windows: n. - The most successful computer virus, ever. +
            > > + A computer without a Microsoft operating system is like a dog
            > > without bricks tied to its head +
            > > + A Microsoft Certified Systems Engineer is to computing what a
            > > McDonalds Certified Food Specialist is to fine cuisine +
            > >
            > >
            > >
            > > ----- Original Message ----
            > > > From: aniad <aniad@>
            > > > To: ydn-javascript@yahoogroups.com
            > > > Sent: Tuesday, September 2, 2008 10:54:42 AM
            > > > Subject: [ydn-javascript] Flex widget inside layout manager cannot
            > be called from javascript in IE
            > > >
            > > > Hello,
            > > >
            > > > I'm having a real problem with Layout Manager hosting a flex
            widget in
            > > > the center pane in IE. Specifically the problem has to do with
            > > > javascript calling flex. The flex widget registers javascript
            > > > callbacks which work fine in Firefox. However they do not in
            IE. The
            > > > problem is directly related to the Layout Manager, as
            eliminating the
            > > > Layout, ie putting the flex widget just in a simple
            > > , solves the
            > > > problem.
            > > >
            > > > My code looks something like:
            > > >
            > > > function initLayout()
            > > > {
            > > > layout = new YAHOO.widget.Layout('layoutDiv',
            > > > {
            > > > height: 500,//800,
            > > > units: [
            > > > { position: 'center', height: 490, scroll: false,
            > > > resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse:
            true,
            > > > collapseSize: 50, maxWidth: 1000 }
            > > > ]
            > > > });
            > > >
            > > > }
            > > >
            > > > Function callFlex()
            > > > {
            > > > Document.getElementById("myFlexWidget").Flex_SetView(); //
            > > > "Flex_SetView" is a registered callback in action script
            > > > }
            > > >
            > > > YAHOO.util.Event.onDOMReady(initLayout);
            > > >
            > > >
            > > >
            > > > show flex problem
            > > >
            > > >
            > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > >
            > > > The error in IE is "Unspecified Error" in some IE javascript code:
            > > >
            > > > function __flash__addCallback(instance, name) {
            > > > instance[name] = function () {
            > > > return eval(instance.CallFunction(">
            > returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
            > > > ""));
            > > > }
            > > > }
            > > >
            > > > Both params, instance and name are valid. We found this article on
            > > > the subject, http://www.airtightinteractive.com/news/?p=71, and
            we are
            > > > already doing everything suggested in this article. Again, as
            stated
            > > > above, eliminating the layout manager allows the flex callbacks to
            > > > work again.
            > > >
            > > > Please advise, thank you!
            > > >
            > > > Ania.
            > > >
            > > >
            > > >
            > > >
            > > > ------------------------------------
            > > >
            > > > Yahoo! Groups Links
            > > >
            > > >
            > > >
            > >
            >
          • Dav Glass
            aniad -- The issue is that your script is doing a document.write of the embed tags into the div centerDivWithFlex . Then when the Layout is rendered, it s
            Message 5 of 9 , Sep 5, 2008
            • 0 Attachment
              aniad --

              The issue is that your script is doing a document.write of the embed tags into the div "centerDivWithFlex".
              Then when the Layout is rendered, it's moving it in the DOM.
              IE (and most browsers) don't like it when you do that..

              What you need to do, it remove the use of document.write and use DOM to add the embed info to the div
              AFTER the layout is rendered by listening to the Layout's render event..

              layout.on('render', initFlex);

              Does that make sense?
              Dav

              Dav Glass
              dav.glass@...
              blog.davglass.com




              + Windows: n. - The most successful computer virus, ever. +
              + A computer without a Microsoft operating system is like a dog
              without bricks tied to its head +
              + A Microsoft Certified Systems Engineer is to computing what a
              McDonalds Certified Food Specialist is to fine cuisine +



              ----- Original Message ----
              > From: aniad <aniad@...>
              > To: ydn-javascript@yahoogroups.com
              > Sent: Friday, September 5, 2008 11:14:27 AM
              > Subject: [ydn-javascript] Re: Flex widget inside layout manager cannot be called from javascript in IE
              >
              > Hi Dav,
              >
              > I don't mean to come off impatient, but w/o some insight into this
              > problem our app will not work in IE. I will very much appreciate any
              > advise/observations you might have.
              > a.
              >
              > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
              > >
              > > Hello Dav,
              > >
              > > I don't really have a site available that is outside of a firewall, so
              > > I have a zip file for you here:
              > >
              > > https://download.amberpoint.com/forYahoo/forYUI.zip
              > > Username: Yahoo
              > > Password: bug4yahoo
              > >
              > > Please put these files on some server and then access
              > > flexInLayoutProblem.html (it has to be accessed via some server,
              > > localhost for example, not local file system, otherwise flex runs into
              > > security problems)
              > >
              > > As I've commented in that .html file, if you create the flex widget
              > > outside of the layout manager then calling it in IE is not a problem.
              > > However, putting the flex widget inside the layout prevents it from
              > > being able to be called in IE. It works fine in Firefox.
              > >
              > > I've also included TestExternalInterface.zip which is the source for
              > > the simple flex widget.
              > >
              > > Please advise.
              > > Ania.
              > >
              > >
              > >
              > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
              > > >
              > > > aniad --
              > > >
              > > > Please post a link so I can see it, the code doesn't help me if I
              > > can't see the issue :D
              > > >
              > > > Thanks
              > > > Dav
              > > >
              > > > Dav Glass
              > > > dav.glass@
              > > > blog.davglass.com
              > > >
              > > >
              > > >
              > > >
              > > > + Windows: n. - The most successful computer virus, ever. +
              > > > + A computer without a Microsoft operating system is like a dog
              > > > without bricks tied to its head +
              > > > + A Microsoft Certified Systems Engineer is to computing what a
              > > > McDonalds Certified Food Specialist is to fine cuisine +
              > > >
              > > >
              > > >
              > > > ----- Original Message ----
              > > > > From: aniad
              > > > > To: ydn-javascript@yahoogroups.com
              > > > > Sent: Tuesday, September 2, 2008 10:54:42 AM
              > > > > Subject: [ydn-javascript] Flex widget inside layout manager cannot
              > > be called from javascript in IE
              > > > >
              > > > > Hello,
              > > > >
              > > > > I'm having a real problem with Layout Manager hosting a flex
              > widget in
              > > > > the center pane in IE. Specifically the problem has to do with
              > > > > javascript calling flex. The flex widget registers javascript
              > > > > callbacks which work fine in Firefox. However they do not in
              > IE. The
              > > > > problem is directly related to the Layout Manager, as
              > eliminating the
              > > > > Layout, ie putting the flex widget just in a simple
              > > > , solves the
              > > > > problem.
              > > > >
              > > > > My code looks something like:
              > > > >
              > > > > function initLayout()
              > > > > {
              > > > > layout = new YAHOO.widget.Layout('layoutDiv',
              > > > > {
              > > > > height: 500,//800,
              > > > > units: [
              > > > > { position: 'center', height: 490, scroll: false,
              > > > > resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse:
              > true,
              > > > > collapseSize: 50, maxWidth: 1000 }
              > > > > ]
              > > > > });
              > > > >
              > > > > }
              > > > >
              > > > > Function callFlex()
              > > > > {
              > > > > Document.getElementById("myFlexWidget").Flex_SetView(); //
              > > > > "Flex_SetView" is a registered callback in action script
              > > > > }
              > > > >
              > > > > YAHOO.util.Event.onDOMReady(initLayout);
              > > > >
              > > > >
              > > > >
              > > > > show flex problem
              > > > >
              > > > >
              > > >
              > > > >
              > > > >
              > > > >
              > > > >
              > > > >
              > > > >
              > > > > The error in IE is "Unspecified Error" in some IE javascript code:
              > > > >
              > > > > function __flash__addCallback(instance, name) {
              > > > > instance[name] = function () {
              > > > > return eval(instance.CallFunction(">
              > > returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
              > > > > ""));
              > > > > }
              > > > > }
              > > > >
              > > > > Both params, instance and name are valid. We found this article on
              > > > > the subject, http://www.airtightinteractive.com/news/?p=71, and
              > we are
              > > > > already doing everything suggested in this article. Again, as
              > stated
              > > > > above, eliminating the layout manager allows the flex callbacks to
              > > > > work again.
              > > > >
              > > > > Please advise, thank you!
              > > > >
              > > > > Ania.
              > > > >
              > > > >
              > > > >
              > > > >
              > > > > ------------------------------------
              > > > >
              > > > > Yahoo! Groups Links
              > > > >
              > > > >
              > > > >
              > > >
              > >
              >
              >
              >
              > ------------------------------------
              >
              > Yahoo! Groups Links
              >
              >
              >
            • aniad
              Dav, Thank you for your reply. Unfortunately, changing the code does not solve this issue. I ve changed the code to use object/embed tags instead of doing
              Message 6 of 9 , Sep 5, 2008
              • 0 Attachment
                Dav,

                Thank you for your reply. Unfortunately, changing the code does not
                solve this issue.
                I've changed the code to use object/embed tags instead of doing
                document.write, and I continue to have the same problem.
                My code looks like this now:

                <script>
                var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

                function callFlex()
                {
                var widgetId = "flexIdgetIE";
                if ( isIE )
                widgetId = "flexWidgetIE";

                // This will not work if layout was created and the Flex widget is
                hosted inside it.

                document.getElementById(widgetId).Flex_TestExternalInterface("one","two");
                }

                function initLayout()
                {
                layout = new YAHOO.widget.Layout('layoutDiv',
                {
                height: 500,//800,
                //minWidth: 1000,
                units: [
                // Switching these two lines shows the problem. If
                the div with flex is shown inside the layout then it cannot be called
                (callFlex() fails)
                // if it is shown outside of layout then it works
                properly.
                { position: 'center', header: "I do not work", height:
                490, scroll: false, resize: true, body: 'centerDivWithFlex', gutter:
                '2px 5px', collapse: true, collapseSize: 50, maxWidth: 1000 }
                //{ position: 'center', header: "I do work", height:
                490, scroll: false, resize: true, body: 'centerDivWithoutFlex',
                gutter: '2px 5px', collapse: true, collapseSize: 50, maxWidth: 1000 }
                ]
                });

                layout.render();

                }

                YAHOO.util.Event.onDOMReady(initLayout);

                </script>
                <body class=" yui-skin-sam">
                <div id="layoutDiv" height="100%" width="99%"></div>
                <div id="centerDivWithoutFlex" height="100%" width="99%">I am center</div>

                <div id="centerDivWithFlex" style="height:500px;width:100%">

                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                id="flexWidgetIE" width="100%" height="100%"

                codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                <param name="movie" value="TestExternalInterface.swf" />
                <param name="quality" value="high" />
                <param name="bgcolor" value="#869ca7" />
                <param name="allowScriptAccess" value="always" />
                <comment>
                <embed src="TestExternalInterface.swf" quality="high"
                bgcolor="#869ca7"
                width="100%" height="100%" id="flexWidget" name="flexWidget"
                align="middle"
                play="true"
                loop="false"
                quality="high"
                allowScriptAccess="always"
                type="application/x-shockwave-flash"
                pluginspage="http://www.adobe.com/go/getflashplayer">
                </embed>
                </comment>
                </object>

                </div>

                <button onclick="callFlex();">Click me</button>
                </body>


                Ania.



                --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                >
                > aniad --
                >
                > The issue is that your script is doing a document.write of the embed
                tags into the div "centerDivWithFlex".
                > Then when the Layout is rendered, it's moving it in the DOM.
                > IE (and most browsers) don't like it when you do that..
                >
                > What you need to do, it remove the use of document.write and use DOM
                to add the embed info to the div
                > AFTER the layout is rendered by listening to the Layout's render event..
                >
                > layout.on('render', initFlex);
                >
                > Does that make sense?
                > Dav
                >
                > Dav Glass
                > dav.glass@...
                > blog.davglass.com
                >
                >
                >
                >
                > + Windows: n. - The most successful computer virus, ever. +
                > + A computer without a Microsoft operating system is like a dog
                > without bricks tied to its head +
                > + A Microsoft Certified Systems Engineer is to computing what a
                > McDonalds Certified Food Specialist is to fine cuisine +
                >
                >
                >
                > ----- Original Message ----
                > > From: aniad <aniad@...>
                > > To: ydn-javascript@yahoogroups.com
                > > Sent: Friday, September 5, 2008 11:14:27 AM
                > > Subject: [ydn-javascript] Re: Flex widget inside layout manager
                cannot be called from javascript in IE
                > >
                > > Hi Dav,
                > >
                > > I don't mean to come off impatient, but w/o some insight into this
                > > problem our app will not work in IE. I will very much appreciate any
                > > advise/observations you might have.
                > > a.
                > >
                > > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                > > >
                > > > Hello Dav,
                > > >
                > > > I don't really have a site available that is outside of a
                firewall, so
                > > > I have a zip file for you here:
                > > >
                > > > https://download.amberpoint.com/forYahoo/forYUI.zip
                > > > Username: Yahoo
                > > > Password: bug4yahoo
                > > >
                > > > Please put these files on some server and then access
                > > > flexInLayoutProblem.html (it has to be accessed via some server,
                > > > localhost for example, not local file system, otherwise flex
                runs into
                > > > security problems)
                > > >
                > > > As I've commented in that .html file, if you create the flex widget
                > > > outside of the layout manager then calling it in IE is not a
                problem.
                > > > However, putting the flex widget inside the layout prevents it from
                > > > being able to be called in IE. It works fine in Firefox.
                > > >
                > > > I've also included TestExternalInterface.zip which is the source for
                > > > the simple flex widget.
                > > >
                > > > Please advise.
                > > > Ania.
                > > >
                > > >
                > > >
                > > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                > > > >
                > > > > aniad --
                > > > >
                > > > > Please post a link so I can see it, the code doesn't help me if I
                > > > can't see the issue :D
                > > > >
                > > > > Thanks
                > > > > Dav
                > > > >
                > > > > Dav Glass
                > > > > dav.glass@
                > > > > blog.davglass.com
                > > > >
                > > > >
                > > > >
                > > > >
                > > > > + Windows: n. - The most successful computer virus, ever. +
                > > > > + A computer without a Microsoft operating system is like a dog
                > > > > without bricks tied to its head +
                > > > > + A Microsoft Certified Systems Engineer is to computing what a
                > > > > McDonalds Certified Food Specialist is to fine cuisine +
                > > > >
                > > > >
                > > > >
                > > > > ----- Original Message ----
                > > > > > From: aniad
                > > > > > To: ydn-javascript@yahoogroups.com
                > > > > > Sent: Tuesday, September 2, 2008 10:54:42 AM
                > > > > > Subject: [ydn-javascript] Flex widget inside layout manager
                cannot
                > > > be called from javascript in IE
                > > > > >
                > > > > > Hello,
                > > > > >
                > > > > > I'm having a real problem with Layout Manager hosting a flex
                > > widget in
                > > > > > the center pane in IE. Specifically the problem has to do with
                > > > > > javascript calling flex. The flex widget registers javascript
                > > > > > callbacks which work fine in Firefox. However they do not in
                > > IE. The
                > > > > > problem is directly related to the Layout Manager, as
                > > eliminating the
                > > > > > Layout, ie putting the flex widget just in a simple
                > > > > , solves the
                > > > > > problem.
                > > > > >
                > > > > > My code looks something like:
                > > > > >
                > > > > > function initLayout()
                > > > > > {
                > > > > > layout = new YAHOO.widget.Layout('layoutDiv',
                > > > > > {
                > > > > > height: 500,//800,
                > > > > > units: [
                > > > > > { position: 'center', height: 490, scroll:
                false,
                > > > > > resize: true, body: 'selectorDiv', gutter: '2px 5px', collapse:
                > > true,
                > > > > > collapseSize: 50, maxWidth: 1000 }
                > > > > > ]
                > > > > > });
                > > > > >
                > > > > > }
                > > > > >
                > > > > > Function callFlex()
                > > > > > {
                > > > > > Document.getElementById("myFlexWidget").Flex_SetView(); //
                > > > > > "Flex_SetView" is a registered callback in action script
                > > > > > }
                > > > > >
                > > > > > YAHOO.util.Event.onDOMReady(initLayout);
                > > > > >
                > > > > >
                > > > > >
                > > > > > show flex problem
                > > > > >
                > > > > >
                > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > > The error in IE is "Unspecified Error" in some IE javascript
                code:
                > > > > >
                > > > > > function __flash__addCallback(instance, name) {
                > > > > > instance[name] = function () {
                > > > > > return eval(instance.CallFunction(">
                > > > returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) +
                > > > > > ""));
                > > > > > }
                > > > > > }
                > > > > >
                > > > > > Both params, instance and name are valid. We found this
                article on
                > > > > > the subject, http://www.airtightinteractive.com/news/?p=71, and
                > > we are
                > > > > > already doing everything suggested in this article. Again, as
                > > stated
                > > > > > above, eliminating the layout manager allows the flex
                callbacks to
                > > > > > work again.
                > > > > >
                > > > > > Please advise, thank you!
                > > > > >
                > > > > > Ania.
                > > > > >
                > > > > >
                > > > > >
                > > > > >
                > > > > > ------------------------------------
                > > > > >
                > > > > > Yahoo! Groups Links
                > > > > >
                > > > > >
                > > > > >
                > > > >
                > > >
                > >
                > >
                > >
                > > ------------------------------------
                > >
                > > Yahoo! Groups Links
                > >
                > >
                > >
                >
              • aniad
                One typo in my previous reply: in callFlex() the widgetId should be initialized to flexWidget (not flexWidgetIE ), so that function looks like this:
                Message 7 of 9 , Sep 5, 2008
                • 0 Attachment
                  One typo in my previous reply:

                  in callFlex() the 'widgetId' should be initialized to 'flexWidget'
                  (not 'flexWidgetIE'), so that function looks like this:

                  function callFlex()
                  {
                  var widgetId = "flexWidget";
                  if ( isIE )
                  widgetId = "flexWidgetIE";

                  // This will not work if layout was created and the Flex widget is
                  hosted inside it.

                  document.getElementById(widgetId).Flex_TestExternalInterface("one","two");
                  }

                  --- In ydn-javascript@yahoogroups.com, "aniad" <aniad@...> wrote:
                  >
                  > Dav,
                  >
                  > Thank you for your reply. Unfortunately, changing the code does not
                  > solve this issue.
                  > I've changed the code to use object/embed tags instead of doing
                  > document.write, and I continue to have the same problem.
                  > My code looks like this now:
                  >
                  > <script>
                  > var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
                  >
                  > function callFlex()
                  > {
                  > var widgetId = "flexIdgetIE";
                  > if ( isIE )
                  > widgetId = "flexWidgetIE";
                  >
                  > // This will not work if layout was created and the Flex widget is
                  > hosted inside it.
                  >
                  >
                  document.getElementById(widgetId).Flex_TestExternalInterface("one","two");
                  > }
                  >
                  > function initLayout()
                  > {
                  > layout = new YAHOO.widget.Layout('layoutDiv',
                  > {
                  > height: 500,//800,
                  > //minWidth: 1000,
                  > units: [
                  > // Switching these two lines shows the problem. If
                  > the div with flex is shown inside the layout then it cannot be called
                  > (callFlex() fails)
                  > // if it is shown outside of layout then it works
                  > properly.
                  > { position: 'center', header: "I do not work", height:
                  > 490, scroll: false, resize: true, body: 'centerDivWithFlex', gutter:
                  > '2px 5px', collapse: true, collapseSize: 50, maxWidth: 1000 }
                  > //{ position: 'center', header: "I do work", height:
                  > 490, scroll: false, resize: true, body: 'centerDivWithoutFlex',
                  > gutter: '2px 5px', collapse: true, collapseSize: 50, maxWidth: 1000 }
                  > ]
                  > });
                  >
                  > layout.render();
                  >
                  > }
                  >
                  > YAHOO.util.Event.onDOMReady(initLayout);
                  >
                  > </script>
                  > <body class=" yui-skin-sam">
                  > <div id="layoutDiv" height="100%" width="99%"></div>
                  > <div id="centerDivWithoutFlex" height="100%" width="99%">I am
                  center</div>
                  >
                  > <div id="centerDivWithFlex" style="height:500px;width:100%">
                  >
                  > <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                  > id="flexWidgetIE" width="100%" height="100%"
                  >
                  >
                  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                  > <param name="movie" value="TestExternalInterface.swf" />
                  > <param name="quality" value="high" />
                  > <param name="bgcolor" value="#869ca7" />
                  > <param name="allowScriptAccess" value="always" />
                  > <comment>
                  > <embed src="TestExternalInterface.swf" quality="high"
                  > bgcolor="#869ca7"
                  > width="100%" height="100%" id="flexWidget" name="flexWidget"
                  > align="middle"
                  > play="true"
                  > loop="false"
                  > quality="high"
                  > allowScriptAccess="always"
                  > type="application/x-shockwave-flash"
                  > pluginspage="http://www.adobe.com/go/getflashplayer">
                  > </embed>
                  > </comment>
                  > </object>
                  >
                  > </div>
                  >
                  > <button onclick="callFlex();">Click me</button>
                  > </body>
                  >
                  >
                  > Ania.
                  >
                  >
                  >
                  > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                  > >
                  > > aniad --
                  > >
                  > > The issue is that your script is doing a document.write of the embed
                  > tags into the div "centerDivWithFlex".
                  > > Then when the Layout is rendered, it's moving it in the DOM.
                  > > IE (and most browsers) don't like it when you do that..
                  > >
                  > > What you need to do, it remove the use of document.write and use DOM
                  > to add the embed info to the div
                  > > AFTER the layout is rendered by listening to the Layout's render
                  event..
                  > >
                  > > layout.on('render', initFlex);
                  > >
                  > > Does that make sense?
                  > > Dav
                  > >
                  > > Dav Glass
                  > > dav.glass@
                  > > blog.davglass.com
                  > >
                  > >
                  > >
                  > >
                  > > + Windows: n. - The most successful computer virus, ever. +
                  > > + A computer without a Microsoft operating system is like a dog
                  > > without bricks tied to its head +
                  > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > McDonalds Certified Food Specialist is to fine cuisine +
                  > >
                  > >
                  > >
                  > > ----- Original Message ----
                  > > > From: aniad <aniad@>
                  > > > To: ydn-javascript@yahoogroups.com
                  > > > Sent: Friday, September 5, 2008 11:14:27 AM
                  > > > Subject: [ydn-javascript] Re: Flex widget inside layout manager
                  > cannot be called from javascript in IE
                  > > >
                  > > > Hi Dav,
                  > > >
                  > > > I don't mean to come off impatient, but w/o some insight into this
                  > > > problem our app will not work in IE. I will very much
                  appreciate any
                  > > > advise/observations you might have.
                  > > > a.
                  > > >
                  > > > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                  > > > >
                  > > > > Hello Dav,
                  > > > >
                  > > > > I don't really have a site available that is outside of a
                  > firewall, so
                  > > > > I have a zip file for you here:
                  > > > >
                  > > > > https://download.amberpoint.com/forYahoo/forYUI.zip
                  > > > > Username: Yahoo
                  > > > > Password: bug4yahoo
                  > > > >
                  > > > > Please put these files on some server and then access
                  > > > > flexInLayoutProblem.html (it has to be accessed via some server,
                  > > > > localhost for example, not local file system, otherwise flex
                  > runs into
                  > > > > security problems)
                  > > > >
                  > > > > As I've commented in that .html file, if you create the flex
                  widget
                  > > > > outside of the layout manager then calling it in IE is not a
                  > problem.
                  > > > > However, putting the flex widget inside the layout prevents
                  it from
                  > > > > being able to be called in IE. It works fine in Firefox.
                  > > > >
                  > > > > I've also included TestExternalInterface.zip which is the
                  source for
                  > > > > the simple flex widget.
                  > > > >
                  > > > > Please advise.
                  > > > > Ania.
                  > > > >
                  > > > >
                  > > > >
                  > > > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                  > > > > >
                  > > > > > aniad --
                  > > > > >
                  > > > > > Please post a link so I can see it, the code doesn't help me
                  if I
                  > > > > can't see the issue :D
                  > > > > >
                  > > > > > Thanks
                  > > > > > Dav
                  > > > > >
                  > > > > > Dav Glass
                  > > > > > dav.glass@
                  > > > > > blog.davglass.com
                  > > > > >
                  > > > > >
                  > > > > >
                  > > > > >
                  > > > > > + Windows: n. - The most successful computer virus, ever. +
                  > > > > > + A computer without a Microsoft operating system is like a dog
                  > > > > > without bricks tied to its head +
                  > > > > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > > > > McDonalds Certified Food Specialist is to fine cuisine +
                  > > > > >
                  > > > > >
                  > > > > >
                  > > > > > ----- Original Message ----
                  > > > > > > From: aniad
                  > > > > > > To: ydn-javascript@yahoogroups.com
                  > > > > > > Sent: Tuesday, September 2, 2008 10:54:42 AM
                  > > > > > > Subject: [ydn-javascript] Flex widget inside layout manager
                  > cannot
                  > > > > be called from javascript in IE
                  > > > > > >
                  > > > > > > Hello,
                  > > > > > >
                  > > > > > > I'm having a real problem with Layout Manager hosting a flex
                  > > > widget in
                  > > > > > > the center pane in IE. Specifically the problem has to do
                  with
                  > > > > > > javascript calling flex. The flex widget registers javascript
                  > > > > > > callbacks which work fine in Firefox. However they do not in
                  > > > IE. The
                  > > > > > > problem is directly related to the Layout Manager, as
                  > > > eliminating the
                  > > > > > > Layout, ie putting the flex widget just in a simple
                  > > > > > , solves the
                  > > > > > > problem.
                  > > > > > >
                  > > > > > > My code looks something like:
                  > > > > > >
                  > > > > > > function initLayout()
                  > > > > > > {
                  > > > > > > layout = new YAHOO.widget.Layout('layoutDiv',
                  > > > > > > {
                  > > > > > > height: 500,//800,
                  > > > > > > units: [
                  > > > > > > { position: 'center', height: 490, scroll:
                  > false,
                  > > > > > > resize: true, body: 'selectorDiv', gutter: '2px 5px',
                  collapse:
                  > > > true,
                  > > > > > > collapseSize: 50, maxWidth: 1000 }
                  > > > > > > ]
                  > > > > > > });
                  > > > > > >
                  > > > > > > }
                  > > > > > >
                  > > > > > > Function callFlex()
                  > > > > > > {
                  > > > > > >
                  Document.getElementById("myFlexWidget").Flex_SetView(); //
                  > > > > > > "Flex_SetView" is a registered callback in action script
                  > > > > > > }
                  > > > > > >
                  > > > > > > YAHOO.util.Event.onDOMReady(initLayout);
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > show flex problem
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > The error in IE is "Unspecified Error" in some IE javascript
                  > code:
                  > > > > > >
                  > > > > > > function __flash__addCallback(instance, name) {
                  > > > > > > instance[name] = function () {
                  > > > > > > return eval(instance.CallFunction(">
                  > > > > returntype=\"javascript\">" +
                  __flash__argumentsToXML(arguments,0) +
                  > > > > > > ""));
                  > > > > > > }
                  > > > > > > }
                  > > > > > >
                  > > > > > > Both params, instance and name are valid. We found this
                  > article on
                  > > > > > > the subject,
                  http://www.airtightinteractive.com/news/?p=71, and
                  > > > we are
                  > > > > > > already doing everything suggested in this article. Again, as
                  > > > stated
                  > > > > > > above, eliminating the layout manager allows the flex
                  > callbacks to
                  > > > > > > work again.
                  > > > > > >
                  > > > > > > Please advise, thank you!
                  > > > > > >
                  > > > > > > Ania.
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > > > ------------------------------------
                  > > > > > >
                  > > > > > > Yahoo! Groups Links
                  > > > > > >
                  > > > > > >
                  > > > > > >
                  > > > > >
                  > > > >
                  > > >
                  > > >
                  > > >
                  > > > ------------------------------------
                  > > >
                  > > > Yahoo! Groups Links
                  > > >
                  > > >
                  > > >
                  > >
                  >
                • Dav Glass
                  Again, the issue is you are creating the Flex object before the layout is rendered.. It needs to be created after , since Layout will move the node around
                  Message 8 of 9 , Sep 5, 2008
                  • 0 Attachment
                    Again, the issue is you are creating the Flex object "before" the layout is rendered..

                    It needs to be created "after", since Layout will move the node around in the dom to position it correctly.

                    Moving the node after it has been built is where the issue is..

                    Does that make sense?
                    Dav
                     
                    Dav Glass
                    dav.glass@...
                    blog.davglass.com



                    + Windows: n. - The most successful computer virus, ever. +
                    + A computer without a Microsoft operating system is like a dog
                    without bricks tied to its head +
                    + A Microsoft Certified Systems Engineer is to computing what a
                    McDonalds Certified Food Specialist is to fine cuisine +


                    ----- Original Message ----
                    > From: aniad <aniad@...>
                    > To: ydn-javascript@yahoogroups.com
                    > Sent: Friday, September 5, 2008 12:32:34 PM
                    > Subject: [ydn-javascript] Re: Flex widget inside layout manager cannot be called from javascript in IE
                    >
                    > One typo in my previous reply:
                    >
                    > in callFlex() the 'widgetId' should be initialized to 'flexWidget'
                    > (not 'flexWidgetIE'), so that function looks like this:
                    >
                    > function callFlex()
                    > { 
                    >     var widgetId = "flexWidget";
                    >     if ( isIE )
                    >         widgetId = "flexWidgetIE";
                    >        
                    >     // This will not work if layout was created and the Flex widget is
                    > hosted inside it.
                    >  
                    > document.getElementById(widgetId).Flex_TestExternalInterface("one","two");
                    >
                    }
                    >
                    > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                    > >
                    > > Dav,
                    > >
                    > > Thank you for your reply.  Unfortunately, changing the code does not
                    > > solve this issue. 
                    > > I've changed the code to use object/embed tags instead of doing
                    > > document.write, and I continue to have the same problem.
                    > > My code looks like this now:
                    > >
                    > >
                    > >
                    > >

                    > >
                    I am
                    > center

                    > >
                    > >

                    > >
                    > >     
                    > >             id="flexWidgetIE" width="100%" height="100%"
                    > >        
                    > >
                    >
                    codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                    > >            
                    > >            
                    > >            
                    > >            
                    > >            
                    > >                
                    > > bgcolor="#869ca7"
                    > >                     width="100%" height="100%" id="flexWidget"
                    >
                    name="flexWidget"
                    > > align="middle"
                    > >                     play="true"
                    > >                     loop="false"
                    > >                     quality="high"
                    > >                     allowScriptAccess="always"
                    > >                     type="application/x-shockwave-flash"
                    > >                     pluginspage="http://www.adobe.com/go/getflashplayer">
                    > >                
                    > >        
                       
                    > >    
                    > >
                    > >

                    > >
                    > >
                    > >
                    > >
                    > >
                    > > Ania.
                    > >
                    > >
                    > >
                    > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                    > > >
                    > > > aniad --
                    > > >
                    > > > The issue is that your script is doing a document.write of the embed
                    > > tags into the div "centerDivWithFlex".
                    > > > Then when the Layout is rendered, it's moving it in the DOM.
                    > > > IE (and most browsers) don't like it when you do that..
                    > > >
                    > > > What you need to do, it remove the use of document.write and use DOM
                    > > to add the embed info to the div
                    > > > AFTER the layout is rendered by listening to the Layout's render
                    > event..
                    > > >
                    > > > layout.on('render', initFlex);
                    > > >
                    > > > Does that make sense?
                    > > > Dav
                    > > >
                    > > >  Dav Glass
                    > > > dav.glass@
                    > > > blog.davglass.com
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > + Windows: n. - The most successful computer virus, ever. +
                    > > > + A computer without a Microsoft operating system is like a dog
                    > > > without bricks tied to its head +
                    > > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > > McDonalds Certified Food Specialist is to fine cuisine  +
                    > > >
                    > > >
                    > > >
                    > > > ----- Original Message ----
                    > > > > From: aniad
                    > > > > To: ydn-javascript@yahoogroups.com
                    > > > > Sent: Friday,
                    September 5, 2008 11:14:27 AM
                    > > > > Subject: [ydn-javascript] Re: Flex widget inside layout manager
                    > > cannot be called from javascript in IE
                    > > > >
                    > > > > Hi Dav,
                    > > > >
                    > > > > I don't mean to come off impatient, but w/o some insight into this
                    > > > > problem our app will not work in IE.  I will very much
                    > appreciate any
                    > > > > advise/observations you might have.
                    > > > > a.
                    > > > >
                    > > > > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                    > > > > >
                    > > > > > Hello Dav,
                    > > > > >
                    > > > > > I don't really have a site available that is outside of a
                    > > firewall, so
                    > > > > > I have a zip file for you here:
                    > > > > >
                    > > > > >
                    https://download.amberpoint.com/forYahoo/forYUI.zip
                    > > > > > Username: Yahoo
                    > > > > > Password: bug4yahoo
                    > > > > >
                    > > > > > Please put these files on some server and then access
                    > > > > > flexInLayoutProblem.html (it has to be accessed via some server,
                    > > > > > localhost for example, not local file system, otherwise flex
                    > > runs into
                    > > > > > security problems)
                    > > > > >
                    > > > > > As I've commented in that .html file, if you create the flex
                    > widget
                    > > > > > outside of the layout manager then calling it in IE is not a
                    > > problem.
                    > > > > >  However, putting the flex widget inside the layout prevents
                    > it from
                    > > > > > being able to be called in IE.  It works fine in Firefox.
                    > > > > >
                    > > > > > I've also included TestExternalInterface.zip which is the
                    > source for
                    > > > > > the simple flex widget.
                    > > > > >
                    > > > > > Please advise.
                    > > > > > Ania.
                    > > > > >
                    > > > > >
                    > > > > >
                    > > > > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                    > > > > > >
                    > > > > > > aniad --
                    > > > > > >
                    > > > > > > Please post a link so I can see it, the code doesn't help me
                    > if I
                    > > > > > can't see the issue :D
                    > > > > > >
                    > > > > > > Thanks
                    > > > > > > Dav
                    > > > > > >
                    > > > > > >  Dav Glass
                    > > > > > > dav.glass@
                    > > > > > > blog.davglass.com
                    > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > > > + Windows: n. - The most successful computer virus, ever. +
                    > > > > > > + A computer without a Microsoft operating system is like a dog
                    > > > > > > without bricks tied to its head +
                    > > > > > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > > > > > McDonalds Certified Food Specialist is to fine cuisine  +
                    > > > > > >
                    > > > > > >
                    > > > > > >
                    > > > > > > ----- Original Message ----
                    > > > > > > > From: aniad
                    > > > > > > > To: ydn-javascript@yahoogroups.com
                    > > > > > > > Sent: Tuesday,
                    September 2, 2008 10:54:42 AM
                    > > > > > > > Subject: [ydn-javascript] Flex widget inside layout manager
                    > > cannot
                    > > > > > be called from javascript in IE
                    > > > > > > >
                    > > > > > > > Hello,
                    > > > > > > >
                    > > > > > > > I'm having a real problem with Layout Manager hosting a flex
                    > > > > widget in
                    > > > > > > > the center pane in IE.  Specifically the problem has to do
                    > with
                    > > > > > > > javascript calling flex.  The flex widget registers javascript
                    > > > > > > > callbacks which work fine in Firefox.  However they do not in
                    > > > > IE.  The
                    > > > > > > > problem is directly related to the Layout Manager, as
                    > > > > eliminating the
                    > > > > > > > Layout, ie putting the flex widget just in a simple
                    > > > > > > , solves the
                    > > > > > > > problem.
                    > > > > > > >
                    > > > > > > > My code looks something like:
                    > > > > > > >
                    > > > > > > >    function initLayout()
                    > > > > > > >    {
                    > > > > > > >        layout = new YAHOO.widget.Layout('layoutDiv',
                    > > > > > > >        {
                    > > > > > > >            height: 500,//800,
                    > > > > > > >            units: [
                    > > > > > > >                { position: 'center', height: 490, scroll:
                    > > false,
                    > > > > > > > resize: true, body: 'selectorDiv', gutter: '2px 5px',
                    > collapse:
                    > > > > true,
                    > > > > > > > collapseSize: 50, maxWidth: 1000 }
                    > > > > > > >            ]
                    > > > > > > >        });
                    > > > > > > >
                    > > > > > > >    }
                    > > > > > > >
                    > > > > > > >      Function callFlex()
                    > > > > > > >      {
                    > > > > > > >   
                    > Document.getElementById("myFlexWidget").Flex_SetView();  //
                    > > > > > > > "Flex_SetView" is a registered callback in action script
                    > > > > > > >      }
                    > > > > > > >
                    > > > > > > >    YAHOO.util.Event.onDOMReady(initLayout);
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >        show flex problem
                    > > > > > > >   
                    > > > > > > >       
                    > > > > > >
                    > > > > > > >                           
                    > > > > > > >         
                    > > > > > > >       
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > The error in IE is "Unspecified Error" in some IE javascript
                    > > code:
                    > > > > > > >
                    > > > > > > > function __flash__addCallback(instance, name) {
                    > > > > > > >  instance[name] = function () {
                    > > > > > > >    return eval(instance.CallFunction(">
                    > > > > > returntype=\"javascript\">" +
                    > __flash__argumentsToXML(arguments,0) +
                    > > > > > > > ""));
                    > > > > > > >  }
                    > > > > > > > }
                    > > > > > > >
                    > > > > > > > Both params, instance and name are valid.  We found this
                    > > article on
                    > > > > > > > the subject,
                    > http://www.airtightinteractive.com/news/?p=71, and
                    > > > > we are
                    > > > > > > > already doing everything suggested in this article.  Again, as
                    > > > >
                    stated
                    > > > > > > > above, eliminating the layout manager allows the flex
                    > > callbacks to
                    > > > > > > > work again.
                    > > > > > > >
                    > > > > > > > Please advise, thank you!
                    > > > > > > >
                    > > > > > > > Ania.
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > > > ------------------------------------
                    > > > > > > >
                    > > > > > > > Yahoo! Groups Links
                    > > > > > > >
                    > > > > > > >
                    > > > > > > >
                    > > > > > >
                    > > > > >
                    > > > >
                    > > > >
                    > > > >
                    > > > >
                    ------------------------------------
                    > > > >
                    > > > > Yahoo! Groups Links
                    > > > >
                    > > > >
                    > > > >
                    > > >
                    > >
                    >
                    >
                    >
                    > ------------------------------------
                    >
                    > Yahoo! Groups Links
                    >
                    > <*> To visit your group on the web, go to:
                    >     http://groups.yahoo.com/group/ydn-javascript/
                    >
                    > <*> Your email settings:
                    >     Individual Email | Traditional
                    >
                    > <*> To change settings online go to:
                    >     http://groups.yahoo.com/group/ydn-javascript/join
                    >     (Yahoo! ID required)
                    >
                    > <*> To change settings via email:
                    >     mailto:ydn-javascript-digest@yahoogroups.com
                    >     mailto:ydn-javascript-fullfeatured@yahoogroups.com
                    >
                    > <*> To unsubscribe
                    from this group, send an email to:
                    >     ydn-javascript-unsubscribe@yahoogroups.com
                    >
                    > <*> Your use of Yahoo! Groups is subject to:
                    >     http://docs.yahoo.com/info/terms/
                  • aniad
                    Hi Dav, Thank you! That did the trick, ie creating flex after layout is rendered. Thanks again! Any chance my other posting/problem can be looked at:
                    Message 9 of 9 , Sep 5, 2008
                    • 0 Attachment
                      Hi Dav,

                      Thank you! That did the trick, ie creating flex after layout is
                      rendered. Thanks again!

                      Any chance my other posting/problem can be looked at:
                      http://tech.groups.yahoo.com/group/ydn-javascript/message/37191

                      Much obliged,
                      Ania.

                      --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                      >
                      > Again, the issue is you are creating the Flex object "before" the
                      layout is rendered..
                      >
                      > It needs to be created "after", since Layout will move the node
                      around in the dom to position it correctly.
                      >
                      > Moving the node after it has been built is where the issue is..
                      >
                      > Does that make sense?
                      > Dav
                      >
                      > Dav Glass
                      > dav.glass@...
                      > blog.davglass.com
                      >
                      >
                      >
                      >
                      > + Windows: n. - The most successful computer virus, ever. +
                      > + A computer without a Microsoft operating system is like a dog
                      > without bricks tied to its head +
                      > + A Microsoft Certified Systems Engineer is to computing what a
                      > McDonalds Certified Food Specialist is to fine cuisine +
                      >
                      >
                      >
                      > ----- Original Message ----
                      > > From: aniad <aniad@...>
                      > > To: ydn-javascript@yahoogroups.com
                      > > Sent: Friday, September 5, 2008 12:32:34 PM
                      > > Subject: [ydn-javascript] Re: Flex widget inside layout manager
                      cannot be called from javascript in IE
                      > >
                      > > One typo in my previous reply:
                      > >
                      > > in callFlex() the 'widgetId' should be initialized to 'flexWidget'
                      > > (not 'flexWidgetIE'), so that function looks like this:
                      > >
                      > > function callFlex()
                      > > {
                      > > var widgetId = "flexWidget";
                      > > if ( isIE )
                      > > widgetId = "flexWidgetIE";
                      > >
                      > > // This will not work if layout was created and the Flex widget is
                      > > hosted inside it.
                      > >
                      > >
                      document.getElementById(widgetId).Flex_TestExternalInterface("one","two");
                      > > }
                      > >
                      > > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                      > > >
                      > > > Dav,
                      > > >
                      > > > Thank you for your reply. Unfortunately, changing the code does not
                      > > > solve this issue.
                      > > > I've changed the code to use object/embed tags instead of doing
                      > > > document.write, and I continue to have the same problem.
                      > > > My code looks like this now:
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > I am
                      > > center
                      > > >
                      > > >
                      >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > >
                      > > > Click me
                      > > >
                      > > >
                      > > >
                      > > > Ania.
                      > > >
                      > > >
                      > > >
                      > > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                      > > > >
                      > > > > aniad --
                      > > > >
                      > > > > The issue is that your script is doing a document.write of the
                      embed
                      > > > tags into the div "centerDivWithFlex".
                      > > > > Then when the Layout is rendered, it's moving it in the DOM.
                      > > > > IE (and most browsers) don't like it when you do that..
                      > > > >
                      > > > > What you need to do, it remove the use of document.write and
                      use DOM
                      > > > to add the embed info to the div
                      > > > > AFTER the layout is rendered by listening to the Layout's render
                      > > event..
                      > > > >
                      > > > > layout.on('render', initFlex);
                      > > > >
                      > > > > Does that make sense?
                      > > > > Dav
                      > > > >
                      > > > > Dav Glass
                      > > > > dav.glass@
                      > > > > blog.davglass.com
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > > + Windows: n. - The most successful computer virus, ever. +
                      > > > > + A computer without a Microsoft operating system is like a dog
                      > > > > without bricks tied to its head +
                      > > > > + A Microsoft Certified Systems Engineer is to computing what a
                      > > > > McDonalds Certified Food Specialist is to fine cuisine +
                      > > > >
                      > > > >
                      > > > >
                      > > > > ----- Original Message ----
                      > > > > > From: aniad
                      > > > > > To: ydn-javascript@yahoogroups.com
                      > > > > > Sent: Friday, September 5, 2008 11:14:27 AM
                      > > > > > Subject: [ydn-javascript] Re: Flex widget inside layout manager
                      > > > cannot be called from javascript in IE
                      > > > > >
                      > > > > > Hi Dav,
                      > > > > >
                      > > > > > I don't mean to come off impatient, but w/o some insight
                      into this
                      > > > > > problem our app will not work in IE. I will very much
                      > > appreciate any
                      > > > > > advise/observations you might have.
                      > > > > > a.
                      > > > > >
                      > > > > > --- In ydn-javascript@yahoogroups.com, "aniad" wrote:
                      > > > > > >
                      > > > > > > Hello Dav,
                      > > > > > >
                      > > > > > > I don't really have a site available that is outside of a
                      > > > firewall, so
                      > > > > > > I have a zip file for you here:
                      > > > > > >
                      > > > > > > https://download.amberpoint.com/forYahoo/forYUI.zip
                      > > > > > > Username: Yahoo
                      > > > > > > Password: bug4yahoo
                      > > > > > >
                      > > > > > > Please put these files on some server and then access
                      > > > > > > flexInLayoutProblem.html (it has to be accessed via some
                      server,
                      > > > > > > localhost for example, not local file system, otherwise flex
                      > > > runs into
                      > > > > > > security problems)
                      > > > > > >
                      > > > > > > As I've commented in that .html file, if you create the flex
                      > > widget
                      > > > > > > outside of the layout manager then calling it in IE is not a
                      > > > problem.
                      > > > > > > However, putting the flex widget inside the layout prevents
                      > > it from
                      > > > > > > being able to be called in IE. It works fine in Firefox.
                      > > > > > >
                      > > > > > > I've also included TestExternalInterface.zip which is the
                      > > source for
                      > > > > > > the simple flex widget.
                      > > > > > >
                      > > > > > > Please advise.
                      > > > > > > Ania.
                      > > > > > >
                      > > > > > >
                      > > > > > >
                      > > > > > > --- In ydn-javascript@yahoogroups.com, Dav Glass wrote:
                      > > > > > > >
                      > > > > > > > aniad --
                      > > > > > > >
                      > > > > > > > Please post a link so I can see it, the code doesn't help me
                      > > if I
                      > > > > > > can't see the issue :D
                      > > > > > > >
                      > > > > > > > Thanks
                      > > > > > > > Dav
                      > > > > > > >
                      > > > > > > > Dav Glass
                      > > > > > > > dav.glass@
                      > > > > > > > blog.davglass.com
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > > + Windows: n. - The most successful computer virus, ever. +
                      > > > > > > > + A computer without a Microsoft operating system is
                      like a dog
                      > > > > > > > without bricks tied to its head +
                      > > > > > > > + A Microsoft Certified Systems Engineer is to computing
                      what a
                      > > > > > > > McDonalds Certified Food Specialist is to fine cuisine +
                      > > > > > > >
                      > > > > > > >
                      > > > > > > >
                      > > > > > > > ----- Original Message ----
                      > > > > > > > > From: aniad
                      > > > > > > > > To: ydn-javascript@yahoogroups.com
                      > > > > > > > > Sent: Tuesday, September 2, 2008 10:54:42 AM
                      > > > > > > > > Subject: [ydn-javascript] Flex widget inside layout
                      manager
                      > > > cannot
                      > > > > > > be called from javascript in IE
                      > > > > > > > >
                      > > > > > > > > Hello,
                      > > > > > > > >
                      > > > > > > > > I'm having a real problem with Layout Manager hosting
                      a flex
                      > > > > > widget in
                      > > > > > > > > the center pane in IE. Specifically the problem has to do
                      > > with
                      > > > > > > > > javascript calling flex. The flex widget registers
                      javascript
                      > > > > > > > > callbacks which work fine in Firefox. However they do
                      not in
                      > > > > > IE. The
                      > > > > > > > > problem is directly related to the Layout Manager, as
                      > > > > > eliminating the
                      > > > > > > > > Layout, ie putting the flex widget just in a simple
                      > > > > > > > , solves the
                      > > > > > > > > problem.
                      > > > > > > > >
                      > > > > > > > > My code looks something like:
                      > > > > > > > >
                      > > > > > > > > function initLayout()
                      > > > > > > > > {
                      > > > > > > > > layout = new YAHOO.widget.Layout('layoutDiv',
                      > > > > > > > > {
                      > > > > > > > > height: 500,//800,
                      > > > > > > > > units: [
                      > > > > > > > > { position: 'center', height: 490, scroll:
                      > > > false,
                      > > > > > > > > resize: true, body: 'selectorDiv', gutter: '2px 5px',
                      > > collapse:
                      > > > > > true,
                      > > > > > > > > collapseSize: 50, maxWidth: 1000 }
                      > > > > > > > > ]
                      > > > > > > > > });
                      > > > > > > > >
                      > > > > > > > > }
                      > > > > > > > >
                      > > > > > > > > Function callFlex()
                      > > > > > > > > {
                      > > > > > > > >
                      > > Document.getElementById("myFlexWidget").Flex_SetView(); //
                      > > > > > > > > "Flex_SetView" is a registered callback in action script
                      > > > > > > > > }
                      > > > > > > > >
                      > > > > > > > > YAHOO.util.Event.onDOMReady(initLayout);
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > > show flex problem
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > > The error in IE is "Unspecified Error" in some IE
                      javascript
                      > > > code:
                      > > > > > > > >
                      > > > > > > > > function __flash__addCallback(instance, name) {
                      > > > > > > > > instance[name] = function () {
                      > > > > > > > > return eval(instance.CallFunction(">
                      > > > > > > returntype=\"javascript\">" +
                      > > __flash__argumentsToXML(arguments,0) +
                      > > > > > > > > ""));
                      > > > > > > > > }
                      > > > > > > > > }
                      > > > > > > > >
                      > > > > > > > > Both params, instance and name are valid. We found this
                      > > > article on
                      > > > > > > > > the subject,
                      > > http://www.airtightinteractive.com/news/?p=71, and
                      > > > > > we are
                      > > > > > > > > already doing everything suggested in this article.
                      Again, as
                      > > > > > stated
                      > > > > > > > > above, eliminating the layout manager allows the flex
                      > > > callbacks to
                      > > > > > > > > work again.
                      > > > > > > > >
                      > > > > > > > > Please advise, thank you!
                      > > > > > > > >
                      > > > > > > > > Ania.
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > > ------------------------------------
                      > > > > > > > >
                      > > > > > > > > Yahoo! Groups Links
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > > >
                      > > > > > > >
                      > > > > > >
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > > > ------------------------------------
                      > > > > >
                      > > > > > Yahoo! Groups Links
                      > > > > >
                      > > > > >
                      > > > > >
                      > > > >
                      > > >
                      > >
                      > >
                      > >
                      > > ------------------------------------
                      > >
                      > > Yahoo! Groups Links
                      > >
                      > >
                      > >
                      >
                    Your message has been successfully submitted and would be delivered to recipients shortly.