[flexcoders] Re: flex selecting combobox httpservice

2008-05-28 Thread Daniel Fernandes Credidio
i had the same problema while ago, i solved it likle this:

thy changing the if for this

comboboxname.dataProvider.source[i][abbrev]


--- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote:


 Try:

 state.dataProvider.state[i].abbrev

 -TH

 --- In flexcoders@yahoogroups.com, Jason B nospam@ wrote:
 
  looks like var in this line has the data NY
  var val : String = result.DATARESULTS.STATE;
 
 
 
  in the loop i see this line showing OBJECT something? weird its like
  the state.dataprovider is not working
 
  state.dataProvider[i].abbrev ---NOTWORKING showing OBJECT(@
 





[flexcoders] help with Images loaded from MSSQL Server

2007-10-04 Thread Daniel Fernandes Credidio
Hello everyone.

I'm back with another question, but this time its about images.

I saved a bunch of image files(all  jpeg,jpg) in the bank, there they
become binary. when i get them from the bank i change them into images
again and take them to flex. at least that's what it was suposed to
happen, but it doesen't seem to work. altough it does seem to be sending
something to the Flex App it doese'nt shows nothing to the user :(

here's a sample of my MXML:

public function PegaImg():void{
 Grid_Amostra.selectedIndex = -1;
 Grid_Amostra.dataProvider =
dadosGrid.lastResult.SelectItem;
 ArrayTree.removeAll();
 for each(var campo:Object in Grid_Amostra.dataProvider){
 var u:URLRequest = new
URLRequest('pegaitem.asp?cd_img='+campo.Cd_Img);
 Carrega.load(u);

 ArrayTree.addItem({display:, Desc:campo.Desc,
Dt_validade:campo.Dt_validade, Cd_Item:campo.Cd_Item,
Cd_Img:campo.Cd_Img})
 //ArrayTree.getItemAt(Cont).display = ;
 Cont++;
 }
 Grid_Amostra.dataProvider = ArrayTree;
 }

public function CompleteEventHandler(evento:Event):void{
 ArrayTree.getItemAt(Cont).display = Carrega;
 }

i Saw some topics telling to use ByteArray but even after looking in the
other topics and the Livedocs. i still cant get how this thing works and
how is it gona help me

any help would be apreciated




[flexcoders] problem with Tree

2007-10-03 Thread Daniel Fernandes Credidio
Hi all,

I'm starting to work with trees using an Httpservice to connect to the
bank and return me this XML: 

Root
node label='Bla1'
node label='Bla2'
node label='Bla3'
node label=Bla4/
/node
/node
/node
/Root


I set the property resultformat as XML and its returning Ok the XML.
the problem is when i use it as a dataprovider. the tree doesen't
shows the right thing, it shows de XMLcode inteasted of the
name(Bla1,BLa2,BLa3 and bla4)

My Mxml is like this:

mx:HTTPService id=dadosTree url=criatree.asp method=POST
showBusyCursor=true result=CriaTree(); resultFormat=xml/

mx:Tree left=0 top=0 bottom=0 right=0 id=TreeArtes
dataProvider={dadosTree.lastResult}/

Please help me a i dont know wath i'm doing wrong




[flexcoders] Re: How to add a component in the field with AS3

2007-02-26 Thread Daniel Fernandes Credidio
c'mon guys i'm still stuck no one has any ideas on how to loop trough
the XML?? i need it to finish my work here. can't anyone help me with
this. and also, i dont know if it chages anything but the XMl is not
default its created dinamically to and i already verified and its ok

--- In flexcoders@yahoogroups.com, Daniel Fernandes Credidio
[EMAIL PROTECTED] wrote:

 Thanks for the help troy.
 
 but i'm still having some problems, The XML is still the same, and i
 made the change in the for just as you said, but it gets worse, if i
 do that it doesn't even enters the For, it goes through it.
 
 --- In flexcoders@yahoogroups.com, Troy Gilbert troy.gilbert@
 wrote:
 
  I've tripped on all of those at one time or another, so I'm happy to
 oblige
  with an answer as best I can:
  
  1. It threw me a bit at first, but it makes sense once you look at
 the types
  returned by XML class. If an element of the XML has complex
 content (i.e.
  its not just straight text, but rather has additional XML elements or
  structure), then referring to that XML element will always return an
  XMLList. Thus, when you say for each (var s:XML in
 data.lastResult.Tipos)
  the XML class is returning an XMLList for all elements named
 Tipos, which
  in your sample data there is only one. If you want to iterate for
 each of a
  certain element, you specify that element in the for each like this:
 for
  each (var s:XML in data.lastResult.Tipos.Tipo). And to access them
 directly
  with an index, you'd use var s:XML = data.lastResult.Tipos.Tipo[0];.
  
  2. To dynamically create UI components just new them (var
 txt:TextInput =
  new TextInput();) and then add them to the container
 (addChild(txt);).
  For dynamically creating forms the Form and FormItem components are a
  lifesaver as they'll save you from having to do any formating
work. Your
  code will end up looking something like this:
  
  var form:Form = new Form();
  var formItem:FormItem = new FormItem();
  formItem.label = Some Field:;
  var txtField:TextInput = new TextInput();
  formItem.addChild(txtField);
  form.addChild(formItem);
  addChild(form);
  
  3. You can load data from a ByteArray into things like the image
 component.
  Assuming you've already got the binary data pulled from the
 database, and
  assuming its in a format that Flash understands directly (SWF,
PNG, JPG,
  GIF, etc.), you can use the loadBytes() method of the
  flash.display.Loaderclass. This will give you a DisplayObject that you
  can then use elsewhere as
  you would traditionally use a dynamically loaded image.
  
  Troy.
  
  
  
  On 2/22/07, Daniel Fernandes Credidio lienwein@ wrote:
  
 Hi,
  
   I'm quite new to Flex and I need help with Three things.
  
   I have an file thats sending me an XML based on data i got from
 the DB,
  
   I have to loop trough the XML and i saw in another thread that
we can
   do it by using the code:
   //the XML
   Tipos
   Tipo
   Situa0/Situa
   Imagem Conteudo=''/
   QtdComputador: 11/Qtd
   /Tipo
   Tipo
   Situa0/Situa
   Imagem Conteudo=''/
   QtdMonitor: 9/Qtd
   /Tipo
   Tipo
   Situa0/Situa
   Imagem Conteudo=''/
   QtdNo break: 3/Qtd
   /Tipo
   Tipo
   Situa0/Situa
   Imagem Conteudo=''/
   QtdNotebook: 3/Qtd
   /Tipo
   /Tipos
  
   for each (var s:XML in data.lastResult.Tipos){
   //some code here
   }
  
   the first problem is that it only loops once even tough there are 3.
  
   the second is that i need to add components(TextArea, Image, Label,
   etc.)on a Panel, but i must do it Using AS3 since its going to be
   created based on the XML(i searched livedocs AND flex help but
didn't
   find it).
  
   the third one is the most tricky of the three, I an getting the
image
   from the DB and its binary i need to send it into flex and use
it as a
   kind of source to the Image component
  
   PS: its not an URL its the data itself.
  
   i know it can be rather confusing but please answer me even if
its to
   say its impossible to do this.
  
   Gratefull for your help,
   Daniel Fernandes Credidio
  

  
 





[flexcoders] Re: How to add a component in the field with AS3

2007-02-23 Thread Daniel Fernandes Credidio
Thanks for the help troy.

but i'm still having some problems, The XML is still the same, and i
made the change in the for just as you said, but it gets worse, if i
do that it doesn't even enters the For, it goes through it.

--- In flexcoders@yahoogroups.com, Troy Gilbert [EMAIL PROTECTED]
wrote:

 I've tripped on all of those at one time or another, so I'm happy to
oblige
 with an answer as best I can:
 
 1. It threw me a bit at first, but it makes sense once you look at
the types
 returned by XML class. If an element of the XML has complex
content (i.e.
 its not just straight text, but rather has additional XML elements or
 structure), then referring to that XML element will always return an
 XMLList. Thus, when you say for each (var s:XML in
data.lastResult.Tipos)
 the XML class is returning an XMLList for all elements named
Tipos, which
 in your sample data there is only one. If you want to iterate for
each of a
 certain element, you specify that element in the for each like this:
for
 each (var s:XML in data.lastResult.Tipos.Tipo). And to access them
directly
 with an index, you'd use var s:XML = data.lastResult.Tipos.Tipo[0];.
 
 2. To dynamically create UI components just new them (var
txt:TextInput =
 new TextInput();) and then add them to the container
(addChild(txt);).
 For dynamically creating forms the Form and FormItem components are a
 lifesaver as they'll save you from having to do any formating work. Your
 code will end up looking something like this:
 
 var form:Form = new Form();
 var formItem:FormItem = new FormItem();
 formItem.label = Some Field:;
 var txtField:TextInput = new TextInput();
 formItem.addChild(txtField);
 form.addChild(formItem);
 addChild(form);
 
 3. You can load data from a ByteArray into things like the image
component.
 Assuming you've already got the binary data pulled from the
database, and
 assuming its in a format that Flash understands directly (SWF, PNG, JPG,
 GIF, etc.), you can use the loadBytes() method of the
 flash.display.Loaderclass. This will give you a DisplayObject that you
 can then use elsewhere as
 you would traditionally use a dynamically loaded image.
 
 Troy.
 
 
 
 On 2/22/07, Daniel Fernandes Credidio [EMAIL PROTECTED] wrote:
 
Hi,
 
  I'm quite new to Flex and I need help with Three things.
 
  I have an file thats sending me an XML based on data i got from
the DB,
 
  I have to loop trough the XML and i saw in another thread that we can
  do it by using the code:
  //the XML
  Tipos
  Tipo
  Situa0/Situa
  Imagem Conteudo=''/
  QtdComputador: 11/Qtd
  /Tipo
  Tipo
  Situa0/Situa
  Imagem Conteudo=''/
  QtdMonitor: 9/Qtd
  /Tipo
  Tipo
  Situa0/Situa
  Imagem Conteudo=''/
  QtdNo break: 3/Qtd
  /Tipo
  Tipo
  Situa0/Situa
  Imagem Conteudo=''/
  QtdNotebook: 3/Qtd
  /Tipo
  /Tipos
 
  for each (var s:XML in data.lastResult.Tipos){
  //some code here
  }
 
  the first problem is that it only loops once even tough there are 3.
 
  the second is that i need to add components(TextArea, Image, Label,
  etc.)on a Panel, but i must do it Using AS3 since its going to be
  created based on the XML(i searched livedocs AND flex help but didn't
  find it).
 
  the third one is the most tricky of the three, I an getting the image
  from the DB and its binary i need to send it into flex and use it as a
  kind of source to the Image component
 
  PS: its not an URL its the data itself.
 
  i know it can be rather confusing but please answer me even if its to
  say its impossible to do this.
 
  Gratefull for your help,
  Daniel Fernandes Credidio
 
   
 





[flexcoders] How to add a component in the field with AS3

2007-02-22 Thread Daniel Fernandes Credidio
Hi, 

I'm quite new to Flex and I need help with Three things.

I have an file thats sending me an XML based on data i got from the DB,

I have to loop trough the XML and i saw in another thread that we can
do it by using the code:
//the XML
Tipos
  Tipo
Situa0/Situa
Imagem Conteudo=''/
QtdComputador: 11/Qtd
  /Tipo
  Tipo
Situa0/Situa
Imagem Conteudo=''/
QtdMonitor: 9/Qtd
  /Tipo
  Tipo
Situa0/Situa
Imagem Conteudo=''/
QtdNo break: 3/Qtd
  /Tipo
  Tipo
Situa0/Situa
Imagem Conteudo=''/
QtdNotebook: 3/Qtd
  /Tipo
/Tipos


for each (var s:XML in data.lastResult.Tipos){
//some code here
}

the first problem is that it only loops once even tough there are 3.

the second is that i need to add components(TextArea, Image, Label,
etc.)on a Panel, but i must do it Using AS3 since its going to be
created based on the XML(i searched livedocs AND flex help but didn't
find it).

the third one is the most tricky of the three, I an getting the image
from the DB and its binary i need to send it into flex and use it as a
kind of source to the Image component

PS: its not an URL its the data itself.

i know it can be rather confusing but please answer me even if its to
say its impossible to do this.

Gratefull for your help,
  Daniel Fernandes Credidio