Display text as password in a TextInput control.

January 7, 2008

Here we have to use the property called displayAsPassword of the Textinput control..

The following example shows it.

<mx:TextInput id=”txt1″ text=”kumargandhi” displayAsPassword=”true” />

This will display the text as password in the TextInput.


To join Array elements into a String in PHP.

January 7, 2008

Here its the paradox of explode() function and the function name is implode().

using the function:

$str=array(’kumar’,'gandhi’,'flexonblog’);

now i want to join the array elements into one string with’-’ as separated ,so to do this we have to write the line..

$newstr=implode(”-” ,$str);

Now if we print the string string ..

echo $newstr;

The Ouput: kumar-gandhi-flexonblog

its the reverse of the function explode().


split a string into array of strings formed by the string delimiter.

January 7, 2008

If i have a string like :

$str=”D:/newfolder/kumar/gandhi”;

Then to seperate the string $str with ‘/’ as delemiter we have to use the function available explode() in PHP.

Its very usefull when we are sending group of data from Flex and splitting it using the function in PHP explode().For our calculation.

using the function :

$str1=explode(”/”,$str);

now using the string $str1 as array which contains the splitted string..

for($i=0;$i<=$str1.length;$i++)

{

echo $str1[$i].”</br>”;

}

Now this will print the string as –>

D:

newfolder

kumar

gandhi

Hence the usage of explode() function..


Reading data in to ComboBox from PHP page.

January 7, 2008

First the PHP page looks like this:

echo “<search>”;
echo “<type name=’kumar’ />” ;
echo “<type name=’gandhi’ />” ;
echo “</search>”;

here we have to send data from PHP page in this format.Then to take data in to ComboBox we have to use a HTTPService and dataProvider Property of the ComboBox control.

<mx:HttpService id=”search” useproxy=”false” url=”first.php”/>

<mx:ComboBox id=”searchbox” dataProvider=”{search.lastResult.search.type}” dataField=”name” />

Here in the dataField property specifies which attribute value you wanted from the list.

Here name is the attribute of the <type> tag in PHP and that data i wanted it in the ComboBox list.thats it its simple and small try it..

Leave any comments for suggestions..