1) compile the application with the following compiler options
-locale= -resource-bundle-list myres.txt
Now myres.txt will be created in the bin directory.
2) Create the resource swf file using the following command.
mxmlc -locale=en_US -source-path+=locale/{locale} -include-resource-bundles={contents of myres.txt} -output en_US_ResourceModule.swf
The output swf should have the format {locale string}_ResourceModule.swf.
Wednesday, August 13, 2008
Tuesday, August 12, 2008
Calling PHP page in Flex and binding to combobox
using HTTPService components, you can call php page. The php page response to flex, sends the result in the form of xml.
E.g.,
1) Use this code to call a php page
mx:httpservice id="xmlRPC" url="http://localhost/PHP/GetCountry.php" />
2) Use this code to bind the result to combobox:
mx:combobox id="Country" prompt="Select" width="210" y="177" x="125" dataprovider="{xmlRPC.lastResult.Country.CountryDetails}" labelfield="CountryCode"/>
The GetCountry.php response should be like this:
country>
countrydetails>
countrycode>US
/countrydetails>
countrydetails>
countrycode>IN
/countrydetails>
/country>
E.g.,
1) Use this code to call a php page
mx:httpservice id="xmlRPC" url="http://localhost/PHP/GetCountry.php" />
2) Use this code to bind the result to combobox:
mx:combobox id="Country" prompt="Select" width="210" y="177" x="125" dataprovider="{xmlRPC.lastResult.Country.CountryDetails}" labelfield="CountryCode"/>
The GetCountry.php response should be like this:
country>
countrydetails>
countrycode>US
/countrydetails>
countrydetails>
countrycode>IN
/countrydetails>
/country>
TypeError: Error #1009: Cannot access a property or method of a null object reference.
This error usually gets, when some changes had made to project properties.
for e.g., changing compiler settings from locale en-US to locale.
When applying localization like this validation controls will not work in flex.
To make this work, do not change any settings in project properties.
for e.g., changing compiler settings from locale en-US to locale.
When applying localization like this validation controls will not work in flex.
To make this work, do not change any settings in project properties.
Passing data with URL in flex
1) Include creationComplete="init(event);" in mx:Application
2) Include this script in mx:script tag
import mx.managers.BrowserManager;
import mx.managers.IBrowserManager;
import mx.utils.URLUtil;
private var bm:IBrowserManager;
[Bindable]
private var fName:String;
[Bindable]
private var lName:String;
private function init(e:Event):void {
bm = BrowserManager.getInstance();
bm.init("", "Welcome!");
/* The following code will parse a URL that passes firstName and lastName as
query string parameters after the "#" sign; for example:
http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */
var o:Object = URLUtil.stringToObject(bm.fragment, "&");
fName = o.firstName;
lName = o.lastName;
}
]]>
3) use fName and lName with the text property of any control. for e.g.,
mx:Label text ={fName}
2) Include this script in mx:script tag
import mx.managers.BrowserManager;
import mx.managers.IBrowserManager;
import mx.utils.URLUtil;
private var bm:IBrowserManager;
[Bindable]
private var fName:String;
[Bindable]
private var lName:String;
private function init(e:Event):void {
bm = BrowserManager.getInstance();
bm.init("", "Welcome!");
/* The following code will parse a URL that passes firstName and lastName as
query string parameters after the "#" sign; for example:
http://www.mydomain.com/MyApp.html#firstName=Nick&lastName=Danger */
var o:Object = URLUtil.stringToObject(bm.fragment, "&");
fName = o.firstName;
lName = o.lastName;
}
]]>
3) use fName and lName with the text property of any control. for e.g.,
mx:Label text ={fName}
Thursday, August 7, 2008
Corner radius property in flex
To make the corner radius property for any layput control to work, first you need to set the borderstyle property to solid then,
it is possible to see the rounded corners for a layout.
it is possible to see the rounded corners for a layout.
Subscribe to:
Comments (Atom)