9 Replies Latest reply on Jul 7, 2006 5:43 PM by Flex harUI

    Even easier example won't work

    djsodom
      As I've mentioned previously, my app was working fine. then overnight things stopped working. In another post I showed a simple xml example that was not parsing.

      Here is an even simpler example that doesn't use XML.

      Why does this not work?

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

      <mx:Script>
      <![CDATA[
      import flash.external.ExternalInterface;
      public function initText():void {

      ExternalInterface.call("alert", "wtf");

      }

      ]]>
      </mx:Script>

      <mx:Text width="100" id="question" htmlText = "hi" initialize="initText();"/>

      </mx:Application>

      It compiles fine. The "hi" shows up.

      If I put a question.html="hello" in front of the Exernal.interface call like:
      public function initText():void {
      question.htmlText="hello";
      ExternalInterface.call("alert", "wtf");
      }

      Then the text changes to "hello".

      If I put question.htmlText="hello" after the Externalinterface call then it stays at "hi"

      It is like my flash libraries are not being loaded. I've changed nothing. I'm getting no error messages (though I can't seem to find a mac flash 9 debugger.

      I'm using a macbook intel, sdk only install.

      any ideas before I move to laszlo?

      steve

        • 1. Re: Even easier example won't work
          Flex harUI Adobe Employee
          I'm not going to investigate the ExternalInterface issue and help with the other post instead unless you need this to be solved as well.
          • 2. Re: Even easier example won't work
            djsodom Level 1
            Flex harUI,

            Ignore my xml parsing problem post and please postulate why this example is not working.

            Thanks,

            Steve
            • 3. Re: Even easier example won't work
              Flex harUI Adobe Employee
              Hmm. Works fine in Windows IE. I'll see if someone can try it on a mac. My guess is that you are getting some sort of exception from the player and it is not executing the script beyond the externalInteface call. Put two externalInterface calls back to back and see if the second one gets hit. Double check your player versions, and try different browser if you can.
              • 4. Re: Even easier example won't work
                djsodom Level 1
                I've tried it in both safari and firefox. I tried the back to back externalinterface calls - none of them trigger the alert.

                I also compiled some of the sample apps that are included. The restaurant seems to work fine, but the flexstore sample only shows the first page (ie. the product page doesn't work).

                I would be curious if any other intel macs have the same problem. (though everything was working fine 2 days ago)
                • 5. Re: Even easier example won't work
                  jtan Level 1
                  Steve,

                  I've tried out your code on my Intel based iMac that has the Public Beta version Flash Player 9, 0, 18, 0 installed. Your code where you have the question.htmlText statement after the ExternalInterface call works fine for me on Firefox. It doesn't seem to work on Safari. My safari browser actually crashes after I dismiss the alert.

                  I also tried out your code on a non intel based Mac with the released Mac Flash Player 9, 0, 16, 0 and the code works fine on both Firefox and Safari outputting the "hello" message.

                  I'm not sure how our findings are so different. I will report the Safari bug crash to the player team, but if you can provide more details about that code not working on Firefox, that would be great. Are you getting the same result on both browsers. Can you check for sure what version of the player you are running?

                  Thanks,
                  Joan
                  Flex SDK QA
                  • 6. Re: Even easier example won't work
                    djsodom Level 1
                    Hi Joan,

                    I'm also using flash player 9,0,18,0.

                    First, does the flexstore example that was included in the download work on your intel mac? By working I mean if you click on the product tab and the product page comes up? Mine only shows the first page - clicking on the product tab does nothing.

                    Second, if I run this code below;
                    <?xml version="1.0" encoding="utf-8"?>
                    <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
                    <mx:Script>
                    <![CDATA[
                    import flash.external.ExternalInterface;
                    public function initText():void {
                    question.htmlText = "hello"
                    ExternalInterface.call("alert", "wtf");
                    question.htmlText = "hello, again."
                    }
                    ]]>
                    </mx:Script>
                    <mx:Text width="100" id="question" htmlText = "hi" initialize="initText();"/>
                    </mx:Application>

                    Only "hello" shows up. It seems to die on the externalinterface call. "hello again" should show up, but doesnt. Does it on your machine?

                    As I mentioned, this only started happening yesterday morning. Everything was working earlier in the week.

                    Steve
                    • 7. Re: Even easier example won't work
                      jtan Level 1
                      Steve,

                      Some weird findings. If I put the flexstore code up on a webserver and run it from there, then everything works fine (both Firefox and Safari). However, if I run in locally, I see the problem you described where you click on the Products tab and nothing happens. You can do things like click on the "Login" button and see an Alert, but the Products and Support tab don't work.

                      As for your ExternalInterface code, I see it working on my machine (Firefox only). I get the "hello, again" to show up rather than just the "hello"

                      I'll look into this samples issue some more to see if it is a problem on the Mactel machines only or if its Mac in general. It works on Windows.

                      Joan
                      • 8. Re: Even easier example won't work
                        djsodom Level 1
                        Joan,

                        I've migrated over to my windows machine (argh) and everything works fine.

                        I guess I'll keep an eye out for new releases.

                        But since it was originally was working fine then 2 days ago, things broke, if something changes at http://www.adobe.com/2006/mxml, I'm assuming it effects me locally when I compile. If so, I can I be aware of changes there so I can try again on my mac?

                        Thanks for your help.

                        Steve
                        • 9. Re: Even easier example won't work
                          Flex harUI Adobe Employee
                          The http://www.adobe.com/2006/mxml is not a valid web location, it is essentially a URI that we know won't collide with anything else out there, so nothing outside your computer can be affecting this situation.

                          It appears to be some sort of a player/browser interaction problem. Have you tried different Mac browsers?

                          If it is a bug in the player and involves uninitialized memory you can see things that work start to fail suddenly.

                          You can try the 'ol uninstall/reinstall if you want.