2 Replies Latest reply on Jul 6, 2016 10:54 AM by jessed10125909

    Bug when modifying Html canvas publishing settings?

    jessed10125909

      I was recently tasked with creating a tool to help our designers publish content more efficiently, part of that required running a JSFL to modify the publication folder of the FLA (That was in html5  canvas mode).

       

      However whenever the jsfl would run the changes would not be there. I even tried exporting publish profiles, modifying it by hand and then reimporting them to have the changes occasionally ignored. I would seem to find a solution only to try and reproduce it on another file and have it fail forcing me to go through different attempts all over again.

       

      The Code below seems to be the only reliable way to change the publication options  ( by setting default to true first, then making the changes and setting it to false)

       

      The parts labelled Line A and Line B MUST be included if either one isn't there the FLA rejects any changes made.

       

      My question is , is this a bug , or is there something about the settings i am failing to understand?

       

       

      var doc = fl.openDocument("%flaUri%");

       

      var test = new XML(doc.exportPublishProfileString());

       

      if(test.PublishProperties[1].Property[i].@name == "default"

      {

        test.PublishProperties[1].Property[i] = "true";                                   // LINE A

      }

       

      doc.importPublishProfileString(test);

       

      var profile = new XML(doc.exportPublishProfileString());

      for(var i=0; i < profile.PublishProperties[1].Property.length(); i++ )

      {

             if(profile.PublishProperties[1].Property[i].@name == "filename")

             {

                  profile.PublishProperties[1].Property[i] = "%swfUri%";

             }

             if(profile.PublishProperties[1].Property[i].@name == "loop")

             {

                  profile.PublishProperties[1].Property[i] = "false";

              }

             if(profile.PublishProperties[1].Property[i].@name == "default")                                             //Line B

             {

                  profile.PublishProperties[1].Property[i] = "false";

              }

      }

      doc.importPublishProfileString(profile);

      doc.save();

      doc.publish();

       

      fl.closeDocument(fl.documents[0], true);