[flexcoders] Re: working with XML data

2006-06-24 Thread arnold_charming
Hi!

Tnx for all the help...it was very usefull. But still I'm getting some
strange errors when running the application for the first time. 

When I for the first time try to submit blank text fields I get this
error:

Error #1088: The markup in the document following the root element
must be well-formed.

As soon as I type something in the text fields the application starts
to work. Even if I again supply blank fields. What could be the
problem? Below is my XML file and MXML:


XML file

izhod
spremenljivke
spremlogin/sprem
vrednost1/vrednost
/spremenljivke
/izhod

If 1 then user can proceed otherwise wrong password/username.

MXML

?xml version=1.0 encoding=utf-8?
mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml; width=400
height=300
mx:Script
![CDATA[
import mx.rpc.events.ResultEvent;

public function onResult(oEvent:ResultEvent):void {
var xmlResult:XML = new XML(oEvent.result);

tekst.text = 
xmlResult.spremenljivke[0].vrednost;
}
]]
/mx:Script
mx:HTTPService resultFormat=e4x result=onResult(event)
url=http://localhost/~iztok/rokus_v2.com/vstop.php; method=POST
showBusyCursor=true id=reqLogin 
mx:request
uporabnik{txtUporabnik.text}/uporabnik
geslo{txtGeslo.text}/geslo 
/mx:request
/mx:HTTPService

mx:Canvas x=0 y=0 width=400 height=300
mx:VBox x=0 y=0 width=400 height=300
horizontalAlign=center verticalAlign=top verticalGap=0
mx:Text text=[EMAIL PROTECTED] fontSize=30 
width=283
textAlign=center height=57/
mx:Form height=131
mx:FormItem label=Uporabnik: required=true
mx:TextInput id=txtUporabnik/
/mx:FormItem
mx:FormItem label=Geslo: required=true
mx:TextInput displayAsPassword=true 
id=txtGeslo/
/mx:FormItem
mx:FormItem
mx:Button label=Prijava 
click=reqLogin.send();/
/mx:FormItem
/mx:Form

mx:TextArea id=tekst/
/mx:VBox
/mx:Canvas
/mx:Canvas

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 If you are currently binding to the dataGrid's dataProvider property,
 you could intead use a result handler function.
 
 mx:HTTPService result=onResult(event)... resultFormat=e4x /
 
 import mx.rpc.events.ResultEvent;
 Private function onResult(oEvent:ResultEvent):void
 {
   var xmlResult:XML = XML(oEvent.result);
   //traverse the xml as needed to perform desired logic
   myDataGrid.dataProvider = xmlResult;  //same reference as you use in
 the binding expression
 }
 
 Tracy
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Tom Chiverton
 Sent: Thursday, June 22, 2006 10:33 AM
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] Re: working with XML data
 
 On Thursday 22 June 2006 12:29, arnold_charming wrote:
  1. How to transfer XML I got from HTTPService to AS so I can check if
  he/she is allowed to enter the application?
 
 If you are displaying it in a datagrid, it must all ready be in AS.
 You want to read up on E4X etc. from the manual.
 
  2. What is the best way/method to redirect a user to a different
  screen? Is it wise just to turn components from 'visible=true' to
  'visible=false' or should I destroy the component with removeChild()?
 
 Look at changing the selectedIndex of a viewstack.
 
  stupid
 
 We're all new to it :-)
 -- 
 Tom Chiverton
 
 
 
 This email is sent for and on behalf of Halliwells LLP.
 
 Halliwells LLP is a limited liability partnership registered in England
 and Wales under registered number OC307980 whose registered office
 address is at St James's Court Brown Street Manchester M2 2JF.  A list
 of members is available for inspection at the registered office. Any
 reference to a partner in relation to Halliwells LLP means a member of
 Halliwells LLP. Regulated by the Law Society.
 
 CONFIDENTIALITY
 
 This email is intended only for the use of the addressee named above and
 may be confidential or legally privileged.  If you are not the addressee
 you must not read it and must not use any information contained in nor
 copy it nor inform any person other than Halliwells LLP or the addressee
 of its existence or contents.  If you have received this email in error
 please delete it and notify Halliwells LLP IT Department on 0870 365
 8008.
 
 For more

[flexcoders] Re: working with XML data

2006-06-22 Thread arnold_charming
Hi!

I've done almost everything. I'm receiving the XML via
mx:HTTPService and diplaying it in DataGrid. It works great. But I
don't know how to redirect the user to a different screen or even ask
my self if he/she is allowed to enter the application. So here are my
questions:

1. How to transfer XML I got from HTTPService to AS so I can check if
he/she is allowed to enter the application?

2. What is the best way/method to redirect a user to a different
screen? Is it wise just to turn components from 'visible=true' to
'visible=false' or should I destroy the component with removeChild()?

Sorry for asking stupid question but I'm new to Flex 2.0
Thank you in advance.


--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 How far have you gotten? What do you want help with?  We can't build
 your whole app for you.
 
  
 
 Tracy
 
  
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of arnold_charming
 Sent: Wednesday, June 21, 2006 1:14 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] working with XML data
 
  
 
 Hi!
 
 I'm new to Flex 2.0 so please help me out.
 
 I'm trying to build a simple flex application which excepts userpass
 which is then send via mx:httpservice to my php script. If the login
 is OK, then the flex application receives a XML file which states that
 the user can log-in. Now I have to build a checking
 mechanism, which will check if the user can be logged in or not. If yes,
 then it should be forwarded to another screen. 
 Please help me out.
 Thank you.








 Yahoo! Groups Sponsor ~-- 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] Re: working with XML data

2006-06-22 Thread Tom Chiverton
On Thursday 22 June 2006 12:29, arnold_charming wrote:
 1. How to transfer XML I got from HTTPService to AS so I can check if
 he/she is allowed to enter the application?

If you are displaying it in a datagrid, it must all ready be in AS.
You want to read up on E4X etc. from the manual.

 2. What is the best way/method to redirect a user to a different
 screen? Is it wise just to turn components from 'visible=true' to
 'visible=false' or should I destroy the component with removeChild()?

Look at changing the selectedIndex of a viewstack.

 stupid

We're all new to it :-)
-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.

We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the 
Year at the 2005 Growth Company Awards



 Yahoo! Groups Sponsor ~-- 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] Re: working with XML data

2006-06-22 Thread Tracy Spratt
If you are currently binding to the dataGrid's dataProvider property,
you could intead use a result handler function.

mx:HTTPService result=onResult(event)... resultFormat=e4x /

import mx.rpc.events.ResultEvent;
Private function onResult(oEvent:ResultEvent):void
{
  var xmlResult:XML = XML(oEvent.result);
  //traverse the xml as needed to perform desired logic
  myDataGrid.dataProvider = xmlResult;  //same reference as you use in
the binding expression
}

Tracy

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tom Chiverton
Sent: Thursday, June 22, 2006 10:33 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: working with XML data

On Thursday 22 June 2006 12:29, arnold_charming wrote:
 1. How to transfer XML I got from HTTPService to AS so I can check if
 he/she is allowed to enter the application?

If you are displaying it in a datagrid, it must all ready be in AS.
You want to read up on E4X etc. from the manual.

 2. What is the best way/method to redirect a user to a different
 screen? Is it wise just to turn components from 'visible=true' to
 'visible=false' or should I destroy the component with removeChild()?

Look at changing the selectedIndex of a viewstack.

 stupid

We're all new to it :-)
-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England
and Wales under registered number OC307980 whose registered office
address is at St James's Court Brown Street Manchester M2 2JF.  A list
of members is available for inspection at the registered office. Any
reference to a partner in relation to Halliwells LLP means a member of
Halliwells LLP. Regulated by the Law Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and
may be confidential or legally privileged.  If you are not the addressee
you must not read it and must not use any information contained in nor
copy it nor inform any person other than Halliwells LLP or the addressee
of its existence or contents.  If you have received this email in error
please delete it and notify Halliwells LLP IT Department on 0870 365
8008.

For more information about Halliwells LLP visit www.halliwells.com.

We are pleased to announce that Halliwells LLP has been voted AIM Lawyer
of the Year at the 2005 Growth Company Awards




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links



 






 Yahoo! Groups Sponsor ~-- 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
~- 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/