[flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread anuj181
Hi All
I am working on change password option for the user, I am reading
password content from external XML Files and then depending upon the
added value I need to overwrite the external XML's files passsword
entry. I am using following code for changing it but it is not
working, My XML file is in the external folder but withtin the same
project and this is one of the component which i am calling on click
of some button. I need to overwrite data in Login.xml which is stored
in Private folder as the separate folder in my project, Reading from
thh xml file is no problem but writing back is an issue,
Does anyone know where I am screwing things up?

Many Many Thanks for your help
Anuj
//My XML
?xml version=1.0 encoding=utf-8?
Users
user
id1/id
userNameasasasd/userName
passwordasasd123/password
securityQuestionTest Security Question/securityQuestion
answerSecurityQuestion/answerSecurityQuestion
/user
/Users


/CODE***/

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; 
creationComplete=init(); 
 horizontalScrollPolicy=off verticalScrollPolicy=off
public function init():void
{
var getPassword:URLRequest=new 
URLRequest(Private/Login.xml); 
passwordLoader = new URLLoader();  
  
try 
{
passwordLoader.load(getPassword);   
}
catch (error:SecurityError)
{
trace(SecurityError has occurred while loading 
password);
}

passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
}

//ChangePassword

 public function changePassword(evt:MouseEvent):void
 {

if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||

(txt_Security_Question.text==)||(txt_Security_Answer.text==))
{
Alert.show(Please Check the values 
entered. They cannot be
null); 
}
else 
if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
{
Alert.show(Passwords do not match);
}
else
{

externalXMLPassword.user.password=txt_Enter_Password.text;

externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

}
 }

mx:Button x=630 y=402 label=Save click=changePassword(event);/



RE: [flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread Wildbore, Brendon
Im not 100% sure, but I don't believe flex can write to the server directly. 
You will most likely have to employ a server side http service to achieve this.

Also if you are going to be storing sensitive info in an xml file, you should 
encrypt the passwords and security answers


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of anuj181
Sent: Tuesday, 16 December 2008 1:37 p.m.
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How would I Overwrite contents of External XML File


Hi All
I am working on change password option for the user, I am reading
password content from external XML Files and then depending upon the
added value I need to overwrite the external XML's files passsword
entry. I am using following code for changing it but it is not
working, My XML file is in the external folder but withtin the same
project and this is one of the component which i am calling on click
of some button. I need to overwrite data in Login.xml which is stored
in Private folder as the separate folder in my project, Reading from
thh xml file is no problem but writing back is an issue,
Does anyone know where I am screwing things up?

Many Many Thanks for your help
Anuj
//My XML
?xml version=1.0 encoding=utf-8?
Users
user
id1/id
userNameasasasd/userName
passwordasasd123/password
securityQuestionTest Security Question/securityQuestion
answerSecurityQuestion/answerSecurityQuestion
/user
/Users

/CODE***/

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=init();
horizontalScrollPolicy=off verticalScrollPolicy=off
public function init():void
{
var getPassword:URLRequest=new URLRequest(Private/Login.xml);
passwordLoader = new URLLoader();

try
{
passwordLoader.load(getPassword);
}
catch (error:SecurityError)
{
trace(SecurityError has occurred while loading password);
}

passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
}

//ChangePassword

public function changePassword(evt:MouseEvent):void
{
if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||
(txt_Security_Question.text==)||(txt_Security_Answer.text==))
{
Alert.show(Please Check the values entered. They cannot be
null);
}
else if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
{
Alert.show(Passwords do not match);
}
else
{
externalXMLPassword.user.password=txt_Enter_Password.text;

externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

}
}

mx:Button x=630 y=402 label=Save click=changePassword(event);/



Re: [flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread anuj sharma
Hi Brendon
We are working on the encryption part but do you think it is not possible to
overwrite stuff on server with Flex. If thats the case i  have used amfPHP
for tarnsferring data to server, then do you think amfPHP is the only option
i left with I guess right.
Any other guidance will be apprecited too , Also if you have better
links/info about encryption of password on the server that will be helpful
too
Thanks
Anuj

On Mon, Dec 15, 2008 at 4:52 PM, Wildbore, Brendon 
b.j.wildb...@massey.ac.nz wrote:

Im not 100% sure, but I don't believe flex can write to the server
 directly. You will most likely have to employ a server side http service to
 achieve this.



 Also if you are going to be storing sensitive info in an xml file, you
 should encrypt the passwords and security answers


  --

 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *anuj181
 *Sent:* Tuesday, 16 December 2008 1:37 p.m.
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] How would I Overwrite contents of External XML
 File



 Hi All
 I am working on change password option for the user, I am reading
 password content from external XML Files and then depending upon the
 added value I need to overwrite the external XML's files passsword
 entry. I am using following code for changing it but it is not
 working, My XML file is in the external folder but withtin the same
 project and this is one of the component which i am calling on click
 of some button. I need to overwrite data in Login.xml which is stored
 in Private folder as the separate folder in my project, Reading from
 thh xml file is no problem but writing back is an issue,
 Does anyone know where I am screwing things up?

 Many Many Thanks for your help
 Anuj
 //My XML
 ?xml version=1.0 encoding=utf-8?
 Users
 user
 id1/id
 userNameasasasd/userName
 passwordasasd123/password
 securityQuestionTest Security Question/securityQuestion
 answerSecurityQuestion/answerSecurityQuestion
 /user
 /Users

 /CODE***/

 mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=init();
 horizontalScrollPolicy=off verticalScrollPolicy=off
 public function init():void
 {
 var getPassword:URLRequest=new URLRequest(Private/Login.xml);
 passwordLoader = new URLLoader();

 try
 {
 passwordLoader.load(getPassword);
 }
 catch (error:SecurityError)
 {
 trace(SecurityError has occurred while loading password);
 }

 passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
 }

 //ChangePassword

 public function changePassword(evt:MouseEvent):void
 {
 if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||
 (txt_Security_Question.text==)||(txt_Security_Answer.text==))
 {
 Alert.show(Please Check the values entered. They cannot be
 null);
 }
 else if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
 {
 Alert.show(Passwords do not match);
 }
 else
 {
 externalXMLPassword.user.password=txt_Enter_Password.text;

 externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

 externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

 }
 }

 mx:Button x=630 y=402 label=Save click=changePassword(event);/

  



RE: [flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread Wildbore, Brendon
Hi Anuj,

All the investigation I have done points to it not being possible in flex 
(non-air flex). So amfPHP is a logical option for you, especially if you have 
already had experience with it.

Cheers
Brendon


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of anuj sharma
Sent: Tuesday, 16 December 2008 2:01 p.m.
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] How would I Overwrite contents of External XML File


Hi Brendon
We are working on the encryption part but do you think it is not possible to 
overwrite stuff on server with Flex. If thats the case i  have used amfPHP for 
tarnsferring data to server, then do you think amfPHP is the only option i left 
with I guess right.
Any other guidance will be apprecited too , Also if you have better links/info 
about encryption of password on the server that will be helpful too
Thanks
Anuj
On Mon, Dec 15, 2008 at 4:52 PM, Wildbore, Brendon 
b.j.wildb...@massey.ac.nzmailto:b.j.wildb...@massey.ac.nz wrote:

Im not 100% sure, but I don't believe flex can write to the server directly. 
You will most likely have to employ a server side http service to achieve this.



Also if you are going to be storing sensitive info in an xml file, you should 
encrypt the passwords and security answers





From: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com] On 
Behalf Of anuj181
Sent: Tuesday, 16 December 2008 1:37 p.m.
To: flexcoders@yahoogroups.commailto:flexcoders@yahoogroups.com
Subject: [flexcoders] How would I Overwrite contents of External XML File



Hi All
I am working on change password option for the user, I am reading
password content from external XML Files and then depending upon the
added value I need to overwrite the external XML's files passsword
entry. I am using following code for changing it but it is not
working, My XML file is in the external folder but withtin the same
project and this is one of the component which i am calling on click
of some button. I need to overwrite data in Login.xml which is stored
in Private folder as the separate folder in my project, Reading from
thh xml file is no problem but writing back is an issue,
Does anyone know where I am screwing things up?

Many Many Thanks for your help
Anuj
//My XML
?xml version=1.0 encoding=utf-8?
Users
user
id1/id
userNameasasasd/userName
passwordasasd123/password
securityQuestionTest Security Question/securityQuestion
answerSecurityQuestion/answerSecurityQuestion
/user
/Users

/CODE***/

mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=init();
horizontalScrollPolicy=off verticalScrollPolicy=off
public function init():void
{
var getPassword:URLRequest=new URLRequest(Private/Login.xml);
passwordLoader = new URLLoader();

try
{
passwordLoader.load(getPassword);
}
catch (error:SecurityError)
{
trace(SecurityError has occurred while loading password);
}

passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
}

//ChangePassword

public function changePassword(evt:MouseEvent):void
{
if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||
(txt_Security_Question.text==)||(txt_Security_Answer.text==))
{
Alert.show(Please Check the values entered. They cannot be
null);
}
else if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
{
Alert.show(Passwords do not match);
}
else
{
externalXMLPassword.user.password=txt_Enter_Password.text;

externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

}
}

mx:Button x=630 y=402 label=Save click=changePassword(event);/




Re: [flexcoders] How would I Overwrite contents of External XML File

2008-12-15 Thread anuj sharma
HI Brendon
Sounds good to me, And my teamate is working on the encryption part, he
thinks that encryption of the password needs to be done through Javascript
and if thats the case I need to see how my Flex code needs to talk to
JavaScript, i guess using exteralInterface might help me, So do you think
JavaScript is good option for taking care of encryption (on the wire) for
the password or we should try some other technology. I am doubtful that if
Flex can take care of encryption of the password.
Any feedback regardign how to encrypt migh help too,
Thanks Brendon for your help
Anuj

On Mon, Dec 15, 2008 at 5:22 PM, Wildbore, Brendon 
b.j.wildb...@massey.ac.nz wrote:

Hi Anuj,



 All the investigation I have done points to it not being possible in flex
 (non-air flex). So amfPHP is a logical option for you, especially if you
 have already had experience with it.



 Cheers

 Brendon


  --

 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *anuj sharma
 *Sent:* Tuesday, 16 December 2008 2:01 p.m.
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] How would I Overwrite contents of External XML
 File



 Hi Brendon
 We are working on the encryption part but do you think it is not possible
 to overwrite stuff on server with Flex. If thats the case i  have used
 amfPHP for tarnsferring data to server, then do you think amfPHP is the only
 option i left with I guess right.
 Any other guidance will be apprecited too , Also if you have better
 links/info about encryption of password on the server that will be helpful
 too
 Thanks
 Anuj

 On Mon, Dec 15, 2008 at 4:52 PM, Wildbore, Brendon 
 b.j.wildb...@massey.ac.nz wrote:

 Im not 100% sure, but I don't believe flex can write to the server
 directly. You will most likely have to employ a server side http service to
 achieve this.



 Also if you are going to be storing sensitive info in an xml file, you
 should encrypt the passwords and security answers


  --

 *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
 Behalf Of *anuj181
 *Sent:* Tuesday, 16 December 2008 1:37 p.m.
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] How would I Overwrite contents of External XML
 File



 Hi All
 I am working on change password option for the user, I am reading
 password content from external XML Files and then depending upon the
 added value I need to overwrite the external XML's files passsword
 entry. I am using following code for changing it but it is not
 working, My XML file is in the external folder but withtin the same
 project and this is one of the component which i am calling on click
 of some button. I need to overwrite data in Login.xml which is stored
 in Private folder as the separate folder in my project, Reading from
 thh xml file is no problem but writing back is an issue,
 Does anyone know where I am screwing things up?

 Many Many Thanks for your help
 Anuj
 //My XML
 ?xml version=1.0 encoding=utf-8?
 Users
 user
 id1/id
 userNameasasasd/userName
 passwordasasd123/password
 securityQuestionTest Security Question/securityQuestion
 answerSecurityQuestion/answerSecurityQuestion
 /user
 /Users

 /CODE***/

 mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml;
 creationComplete=init();
 horizontalScrollPolicy=off verticalScrollPolicy=off
 public function init():void
 {
 var getPassword:URLRequest=new URLRequest(Private/Login.xml);
 passwordLoader = new URLLoader();

 try
 {
 passwordLoader.load(getPassword);
 }
 catch (error:SecurityError)
 {
 trace(SecurityError has occurred while loading password);
 }

 passwordLoader.addEventListener(Event.COMPLETE,getAlreadySetPassword);
 }

 //ChangePassword

 public function changePassword(evt:MouseEvent):void
 {
 if((txt_Enter_Password.text==)||(txt_ReEnter_Password.text==)||
 (txt_Security_Question.text==)||(txt_Security_Answer.text==))
 {
 Alert.show(Please Check the values entered. They cannot be
 null);
 }
 else if(txt_Enter_Password.text!=txt_ReEnter_Password.text)
 {
 Alert.show(Passwords do not match);
 }
 else
 {
 externalXMLPassword.user.password=txt_Enter_Password.text;

 externalXMLPassword.user.securityQuestion=txt_Security_Question.text;

 externalXMLPassword.user.answerSecurityQuestion=txt_Security_Answer.text;

 }
 }

 mx:Button x=630 y=402 label=Save click=changePassword(event);/