| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Jun 2006
Posts: 54
|
hi everyone
my question i think is simple but i'm really new in flex and ActionScript i have this mxml Code:
<?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"/>
<mx:Script>
<![CDATA[
import mx.styles.StyleManager;
private function filterProduct(item:Object):Boolean
{
return item.name.match(new RegExp("^" + inputText.text, "i\*" + /abc|xyz/));
}
]]>
</mx:Script>
<mx:HTTPService id="srv" url="datos/datos2.xml"
resultFormat="e4x" />
<mx:XMLListCollection id="xlc"
source="{srv.result.*}"
filterFunction="filterProduct"/>
<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:layoutConstraints>
<mx:Anchor top="5" left="5"/>
</mx:layoutConstraints>
<mx:columns>
<mx:Array>
<mx:DataGridColumn columnName="name"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:TextArea width="353" height="291" textAlign="justify" htmlText="{datagrid.selectedItem.desc}"
wordWrap="true" styleName="main.css">
<mx:layoutConstraints>
<mx:Anchor right="25" top="5"/>
</mx:layoutConstraints>
</mx:TextArea>
<mx:Image x="374" y="304" width="164" height="181" source="{datagrid.selectedItem.imagen}"/>
<mx:ControlBar>
<mx:layoutConstraints>
<mx:Anchor bottom="0"/>
</mx:layoutConstraints>
<mx:TextInput id="inputText" width="154"
change="xlc.refresh()" text="Buscar" backgroundColor="#f0eff1"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>
this is part of the xml file Code:
<?xml version="1.0"?> <catalog> <libro> <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> <audio>AUDIO/1.mp3</audio> <video>VIDEOS/lema.flv</video> <otros>OTROS/Discurso por el instituto.pdf</otros> </libro> <libro> <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> <audio>AUDIO/2.mp3</audio> </libro> <libro> <name>Abdo Arias, Williams Alejandro. </name> <desc><![CDATA[Maestro en Derecho Constitucional y Amparo. ]]></desc> <imagen>FOTOS/Abdo Arias, Williams Alejandro. jpg</imagen> <audio>AUDIO/3.mp3</audio> </libro> <libro> <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> </libro> <libro> <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> </libro> when i run the file it gives me an error but if i erase the code of the mx:image it runs perfect thanks |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Jun 2006
Posts: 54
|
any one
helloooooooooooooooo" so nobody has work with e4x before?, or you just to busy to answer? at least answer something like i don't know or stoo asking stupid questions ![]() |
|
|
|
|
|
|
|
|
#3 |
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
|
I don't know... and I don't know why I am responding when I don't know the answer...
![]()
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer http://CyanBlue.FlashVacuum.com http://www.FlashVacuum.com http://tutorials.FlashVacuum.com Do NOT PM, Email or Call me... Your question belongs right in this forum...
|
|
|
|
|
|
#4 |
|
Member
|
i could be wrong, but maybe it is becouse your server does not "understand" spaces in file names ie FOTOS/Abdo Arias, Williams Alejandro. jpg
Tell me does flex plays mp3 or you have similar problem? |
|
|
|
|
|
#5 | |
|
Registered User
Join Date: Jun 2006
Posts: 54
|
Quote:
this project is for cd distribution so i don't think thats the problem the mp3 files are ok i know my problem is cause i'm a noob in ActionScript is there any way i can trace catalog.libro.imagen when clicking on the datagrid and show <imagen>FOTOS/Abdo Andrade, Alberto. jpg</imagen> in the mx:image ![]() if i don't use e4x this is really easy i usually put <mx:Image source="{datagrid.selectedItem.imagen}" /> and thats it |
|
|
|
|
|
|
#6 |
|
Member
|
try this
Code:
<mx:Image source="{datagrid.selectedItem.imagen.text()}" />
|
|
|
|
|
|
#7 | |
|
Registered User
Join Date: Jun 2006
Posts: 54
|
Quote:
sorry for my ignorance (and my english) but isn't that code to display the text? what i want is to display the image in the <mx:image/> if i use <mx:Image source="{datagrid.selectedItem.imagen}" /> everything is ok but the image won't display |
|
|
|
|
|
|
#8 |
|
Member
|
yeah sorry, text does not makes any changes ( it just returns same stuff)
this is probably some issue with data bindings |
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jun 2006
Posts: 54
|
i already figure it out, thanks
|
|
|
|
|
|
#10 |
|
...
Join Date: May 2003
Location: barcelona
Posts: 884
|
hi stonix,
why dont you explain what was wrong in that code...so, this thread might be helpful for someone else... take care |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|