Skip navigation
Currently Being Moderated

Extension Builder and CS6 - read version at runtime

Aug 22, 2012 1:12 PM

I want to check the version of my CS extension at main .mxml init time.

 

How does one find this version info from the manifest.xml?

 

Thanks,

 

pjb

 
Replies
  • Currently Being Moderated
    Sep 10, 2012 6:02 AM   in reply to PeteBaumgartner

    Hi,

     

    Try "Gathering environment information" topic.

     

    I hope it helps !

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 10, 2012 9:21 AM   in reply to PeteBaumgartner

    AFAIK there is no API exposed by CSXS to get the bundle version. You can read the XML of the manifest and pull out the version though:

     

    private function getExtensionVersion(manifestFile:File):String

    {

         var fileStream:FileStream = new FileStream();

         fileStream.open(manifestFile, FileMode.READ);

         var manifestXml:XML = XML(fileStream.readUTFBytes(fileStream.bytesAvailable));

         fileStream.close();

         return manifestXml.@ExtensionBundleVersion;

    }

     

    ...

     

    var version:String = getExtensionVersion(basePath.resolvePath('CSXS/manifest.xml'));

     

    Note that basePath is a property on CSExtension.

     

    Hope that helps,

     

    --Louis

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 19, 2013 5:52 AM   in reply to lomorgan

    I seem to be having probelm getting the basePath I've looked everywhere I could to fine it.

    Could give me a example of how to get the basePath? or what import needs to be used?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 19, 2013 6:17 AM   in reply to kc2scy

    In your MXML file, CSExtension should be the root class. Then you can use "this.basePath":

     

    <csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:csxs="com.adobe.csxs.core.*" applicationComplete="appComplete()">

     

    <fx:Script>

                        <![CDATA[

     

          public function appComplete():void

         {

            trace(this.basePath);

          }

                        ]]>

              </fx:Script>

     

    ...

    </csxs:CSExtension>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 19, 2013 6:48 AM   in reply to lesavage

    Thank You!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points