3 Replies Latest reply on Aug 2, 2006 4:26 PM by Newsgroup_User

    Major JFSL Bug with addNewText

    StevenBlitz
      If I make a JSFL file with this in it and run it using Run Command..., it works:

      fl.getDocumentDOM().addNewText({left:10, top:10, right: 100, bottom:30}); fl.getDocumentDOM().setTextString("Hello World");


      If I make a WindowSWF panel with the same thing in it, wrapped in MMExecute, it doesn't:

      MMExecute("fl.getDocumentDOM().addNewText({left:10 , top:10, right: 100, bottom:30})"); MMExecute("fl.getDocumentDOM().setTextString(\"Hel lo World\")");

      It will addNewRectangle, it will addNewOval, etc. It WILL NOT addNewText no matter what I do, no matter how many ways I tried it.

      This looks totally broken to me. Can anyone verify it?
        • 1. Re: Major JFSL Bug with addNewText
          Level 7
          StevenBlitz,

          > If I make a WindowSWF panel with the same thing in it,
          > wrapped in MMExecute, it doesn't [work]:
          >
          > MMExecute("fl.getDocumentDOM().addNewText({left:10,
          > top:10, right: 100, bottom:30})");
          > MMExecute("fl.getDocumentDOM().setTextString(\"Hel lo
          > World\")");

          Works for me, bro. I hate using MMExecute, because it's always so
          tedious to format the strings -- but this works just fine for me.

          > It WILL NOT addNewText no matter what I do,
          > no matter how many ways I tried it.

          I get the text.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Major JFSL Bug with addNewText
            StevenBlitz Level 1
            I figured it out, too.

            You must have the panel docked. If the panel isn't docked and is free floating, addNewText doesn't work.

            That's a bug no matter how you cut it.
            • 3. Re: Major JFSL Bug with addNewText
              Level 7
              StevenBlitz.

              > I figured it out, too.
              >
              > You must have the panel docked. If the panel isn't
              > docked and is free floating, addNewText doesn't
              > work.

              I hate to sound disagreeable, but I have to disagree. That's not it.
              ;) It works in both cases.

              > That's a bug no matter how you cut it.

              It's *seems* like a bug, I agree, but I believe what has happened here
              is that you haven't grasped how WindowSWF content works. When you go to
              Window > Other Panels > [name of custom WindowSWF], you load the SWF in
              question into memory. When it is first loaded into memory, the MMexecute()
              content in that SWF's timeline runs -- once. If you close that window again
              and open it in a single sitting (one "session," as it were), you're not
              actually reloading it, but only showing and hiding it. Make sense?

              If you trigger that MMexecute() content with a button, it'll work every
              time -- docked or undocked.


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."