Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-26-2006, 08:55 PM   #1
Registered User
stonyx's Avatar
Join Date: Jun 2006
Posts: 54
Default e4x and images

hi everyone
my question i think is simple but i'm really new in flex and ActionScript

i have this mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*"
	creationComplete="srv.send()" viewSourceURL="srcview/index.html">
<mx:Style source="main.css"/>

import mx.styles.StyleManager;
			private function filterProduct(item:Object):Boolean
				return item.name.match(new RegExp("^" + inputText.text, "i\*" + /abc|xyz/));

	<mx:HTTPService id="srv" url="datos/datos2.xml"
		resultFormat="e4x" />
	<mx:XMLListCollection id="xlc"
	<mx:Panel width="568" height="569" layout="absolute" backgroundColor="#800000">
		<mx:DataGrid dataProvider="{xlc}" height="485"
			editable="false" width="150" id="datagrid" scroll="true" change="xlc.refresh()">
				<mx:Anchor top="5" left="5"/>
			<mx:DataGridColumn columnName="name"/>
		<mx:TextArea width="353" height="291" textAlign="justify"  htmlText="{datagrid.selectedItem.desc}" 
			 wordWrap="true" styleName="main.css">
				<mx:Anchor right="25" top="5"/>
		<mx:Image x="374" y="304" width="164" height="181" source="{datagrid.selectedItem.imagen}"/>
				<mx:Anchor bottom="0"/>
			<mx:TextInput id="inputText" width="154"
				change="xlc.refresh()"  text="Buscar" backgroundColor="#f0eff1"/>

this is part of the xml file
<?xml version="1.0"?>
		<name>A orillas de una laguna.</name>
		<desc><![CDATA[Libro de Edmundo Batres Ledón, Roque ]]> Ballinas Ballinas, Francisco Fonz Chan,</desc>
		<imagen>A orillas de una laguna.jpg</imagen>
		<otros>OTROS/Discurso por el instituto.pdf</otros>
		<name>Abdo Andrade, Alberto. </name>
		<desc><![CDATA[Médico cirujano. Nació el 13 de mayo de 1957, originario de Tabasco. ]]></desc>
		<imagen>FOTOS/Abdo Andrade, Alberto. jpg</imagen>
		<name>Abdo Arias, Williams Alejandro. </name>
		<desc><![CDATA[Maestro en Derecho Constitucional y Amparo. ]]></desc>
		<imagen>FOTOS/Abdo Arias, Williams Alejandro. jpg</imagen>
		<name>Abdo Francis, Jorge.</name>
		<desc><![CDATA[10 de abril de 1958. Licenciado y doctorado en Derecho por la UNAM. Ha sido profesor en la ]]></desc>
		<imagen>FOTOS/Abdó, Jorge.jpg</imagen>
		<name>Abogado General. </name>
		<desc><![CDATA[Área que depende directamente de la Rectoría de la <B>UJAT</B>; tiene como objetivo representar ]]></desc>
		<imagen>Abogado General. </imagen>
what i want to do is to show the image when i click on any name on the datagrid
when i run the file it gives me an error but if i erase the code of the mx:image it runs perfect

stonyx is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:29 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.