EXCELLENT! works like a champ!
thank you so much.
I had to change one line
if(peopleDg.selectedItem.photo != ""){
to
if(peopleDg.selectedItem.photo != null){
thanks again.
On 2/23/07, Clint Tredway <[EMAIL PROTECTED]> wrote:
ok, what you need to do is create a function that looks at the
selectedItem of that datagrid and sets the image tag to the image from
the grid or a missing image, image. You will also need to give the
image tag and id. I am going to use personImg_img as the id in the
function.
for example:
public function setImage():void{
if(peopleDg.selectedItem.photo != ""){
personImg_img.source = "i/employees"+peopleDg.selectedItem.photo;
} else {
personImg_img.source = "i/employees/missing.jpg";
}
}
now set the change attribute of the datagrid to setImage(), and that
should do what you want.
On 2/23/07, John Ivanoff <[EMAIL PROTECTED]> wrote:
> here's the code
> ---------------------------------------------
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
> creationComplete="feedRequest.send()">
>
> <mx:HTTPService
> id="feedRequest"
> url="flex-lookup.asp"
> useProxy="false"/>
>
> <mx:Panel width="350" layout="absolute" title="employee sarch"
> bottom="10" top="10" left="10">
> <mx:DataGrid bottom="10" top="50" x="10"
> dataProvider="{feedRequest.lastResult.people.person}" id="peopleDg">
> <mx:columns>
> <mx:DataGridColumn headerText="first name"
dataField="firstName"/>
> <mx:DataGridColumn headerText="lastname"
dataField="lastName"/>
> <mx:DataGridColumn headerText="phone"
dataField="phone"/>
> </mx:columns>
> </mx:DataGrid>
> </mx:Panel>
> <mx:Panel layout="absolute" title="information" right="10" left="368"
> top="10" bottom="10">
> <mx:Image x="10" y="10"
source="i/employees/{peopleDg.selectedItem.photo}"/>
> </mx:Panel>
>
> </mx:Application>
> ---------------------------------------------
>
> On 2/23/07, Clint Tredway <[EMAIL PROTECTED]> wrote:
> > what component are you loading with this data?
> >
> > On 2/23/07, John Ivanoff <[EMAIL PROTECTED]> wrote:
> > > disclaimer - this is my first real flex app.
> > > I am working on an app that will display an image.
> > > the xml i am reading has a photo node.
> > > what i want to do is
> > > if the node is empty (null) display a generic image (gen.jpg) but if
> > > the node has a value (john.jpg) display that image.
> > >
> > > I'm famiar with AS but I don't know where to put the code and alll that
stuff.
> > > right now when I run the program I get a "missing image" icon
> > > displayed on empty nodes but if the is a vaule in the photo node it
> > > will display that image.
> > >
> > > i've appended tet to text in a data grid by using the labelfunction,
> > > but i've looked for an imagefunction and a buch of other thing all
> > > morning and I'm stumped.
> > >
> > > thanks
> > > john
> > >
> > > _______________________________________________
> > > Reply to DFWCFUG:
> > > [email protected]
> > > Subscribe/Unsubscribe:
> > > http://lists1.safesecureweb.com/mailman/listinfo/list
> > > List Archives:
> > > http://www.mail-archive.com/list%40list.dfwcfug.org/
> > > http://www.mail-archive.com/list%40dfwcfug.org/
> > > DFWCFUG Sponsors:
> > > www.HostMySite.com
> > > www.teksystems.com/
> > >
> >
> >
> > --
> > http://indeegrumpee.spaces.live.com/
> >
> > _______________________________________________
> > Reply to DFWCFUG:
> > [email protected]
> > Subscribe/Unsubscribe:
> > http://lists1.safesecureweb.com/mailman/listinfo/list
> > List Archives:
> > http://www.mail-archive.com/list%40list.dfwcfug.org/
> > http://www.mail-archive.com/list%40dfwcfug.org/
> > DFWCFUG Sponsors:
> > www.HostMySite.com
> > www.teksystems.com/
> >
>
> _______________________________________________
> Reply to DFWCFUG:
> [email protected]
> Subscribe/Unsubscribe:
> http://lists1.safesecureweb.com/mailman/listinfo/list
> List Archives:
> http://www.mail-archive.com/list%40list.dfwcfug.org/
> http://www.mail-archive.com/list%40dfwcfug.org/
> DFWCFUG Sponsors:
> www.HostMySite.com
> www.teksystems.com/
>
--
http://indeegrumpee.spaces.live.com/
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.HostMySite.com
www.teksystems.com/
_______________________________________________
Reply to DFWCFUG:
[email protected]
Subscribe/Unsubscribe:
http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
http://www.mail-archive.com/list%40list.dfwcfug.org/
http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
www.HostMySite.com
www.teksystems.com/