7 Replies Latest reply on Jan 12, 2010 3:48 PM by eliza_doolittle

    Getting compilation date

    Erxar
      Hi,

      Do you know if it's possible to get compilation date programmatically? What i would like to do is to show to user, via label, the date this application was build.

      Thanks.
        • 1. Re: Getting compilation date
          Gregory Lafrance Level 6
          Just create a label somewhere in the app, and everytime compilation either starts or finishes, set the text of the label to that date/time. See the FB help system on Date.
          • 2. Getting compilation date
            Erxar Level 1
            I'm sorry but to me, a lemon, this answer looks like this:

            - How do i do X?
            - Just do X and you'll have X.

            Well .. thanks ;)

            I don't know if you got me correctly. I don't want to set this label to the date application starts (i'd assign date to the label's text in creationComplete or something), but when it's compiled into swf. Do you mean i should set this label manual before each release? Could you please be more precise?

            • 3. Re: Getting compilation date
              Level 7

              "Erxar" <webforumsuser@macromedia.com> wrote in message
              news:gls2i6$lqs$1@forums.macromedia.com...
              > I'm sorry but to me, a lemon, this answer looks like this:
              >
              > - How do i do X?
              > - Just do X and you'll have X.
              >
              > Well .. thanks ;)
              >
              > I don't know if you got me correctly. I don't want to set this label to
              > the
              > date application starts (i'd assign date to the label's text in
              > creationComplete or something), but when it's compiled into swf. Do you
              > mean i
              > should set this label manual before each relese? Could you please be more
              > precise?

              I couldn't see the answer you're referring to, but it seems to me you'll
              need to use some kind of server side technology to read the file date, then
              pass the value in to Flex, probably through using flashVars.

              HTH;

              Amy


              • 4. Re: Getting compilation date
                Erxar Level 1
                Well .. it's not as simple as makro could have been if it existed but it works.
                • 5. Getting compilation date
                  Erxar Level 1
                  Edit: Double post
                  • 6. Re: Getting compilation date
                    levancho Level 3
                    IMHO: correct way to have that achived = use Ant (like apache ant) to compile the project. then you can show not only date but whole lot more information to user if you prefer.

                    • 7. Re: Getting compilation date
                      eliza_doolittle

                      This can also be done entirely in Flex / Javascript in the following way:

                       

                      1. Add a flashVars parameter in index.template.html:

                       

                      var lastMod = document.lastModified; // get last modified date of this document - reset every time the application is compiled

                          AC_FL_RunContent(
                                  "src", "${swf}",
                                  "flashVars", "lastModified="+lastMod+"",
                                  "width", "${width}",
                                  "height", "${height}",
                                  "align", "middle",
                                  "id", "${application}",
                                  "quality", "high",
                                  "bgcolor", "${bgcolor}",
                                  "name", "${application}",
                                  "type", "application/x-shockwave-flash",
                                  "pluginspage", "http://www.adobe.com/go/getflashplayer"
                          );

                       

                      2. Reference the parameter in ActionScript as:

                       

                      Application.application.parameters.lastModified

                       

                      Hope this helps anyone else looking for an entirely client-side solution to this issue, without using Ant.