0 Replies Latest reply on May 5, 2010 12:44 AM by snkd

    Introduction to Flex Resource Bundles

    snkd Level 1
      When you are creating handrads of components in your project,you have to hard code the URL as endpoint in each an every component file.If we want to change URL we have to change handrands of files....I think you can understand the situation like I am telling you...
      In other case locale option for different languages in your app....Ok ok lets get down to simple cool wrok.

      • You have to create resource.properties file in your src folder.(resource mean-->your file name)

      resource.properties file is as following

      #locale/en_US/resource.properties
      message=Welcome to resouce file message
      message-size=10

         

      • MainApp.mxml file can call it as following

      If you want to call it from RemoteObject Control
        
      <mx:RemoteObject id="myro"  destination="myService"  showBusyCursor="true" endpoint="@Resource(key='url', bundle='resource')">

      If you want to call it from Label Control
      following is the code for getting value from properties file

      <mx:Label text="@Resource(key='url', bundle='resource')"/>


      in simply @Resource(key='url', bundle='resource') is the code segment for getting value

      it's cool.....
      Happy cording....