This is my PHP:

<?php
header('Content-type: application/xml');
//config included
include_once ("config.php");
//this line selects the city
$result = mysql_query ("SELECT * FROM filmer");
// and output a XML document
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
echo '<helakatalog>';
//fitching all the entries
while ($row=mysql_fetch_assoc($result)) {
$line = '<id>'.$row['id'].'</id>';
$line1 = '<title>'.$row['title'].'</title>';
$line2 = '<year>'.$row['year'].'</year>';
$line3 = '<publisher>'.$row['publisher'].'</publisher>';
$line4 = '<genres>'.$row['genres'].'</genres>';
$line5 = '<image>'.$row['image'].'</image>';
$line6 = '<info>'.$row['info'].'</info>';
$line7 = '<link>'.$row['link'].'</link>';
$line8 = '<internet>'.$row['internet'].'</internet>';
$line9 = '<trailer>'.$row['trailer'].'</trailer>';
echo '<katalog>';
echo $line;
echo $line1;
echo $line2;
echo $line3;
echo $line4;
echo $line5;
echo $line6;
echo $line7;
echo $line8;
echo $line9;
echo '</katalog>';

}
echo '</helakatalog>';
?>

This is my mxml (it's the one i saved last without the
arrayutil.toarray function):

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
xmlns="*" backgroundImage="@Embed('assets/images/Aqua_Blue.png')"
backgroundSize="100%">
<!-- <mx:Model id="katModel"
source="http://192.168.0.200:8080/flex/katalog/katalog.xml"/> -->

<mx:HTTPService id="katSrv"
url="http://192.168.0.200:8080/flex/katalog/katalog.xml";
resultFormat="xml"></mx:HTTPService>
<!--<mx:Model id="katModel"
source="http://192.168.0.200:8080/flex/katalog/katalog.xml"/>-->

<!-- The ActionScript code for this class is externalized in a
separate .as file for better readability -->
<mx:Script source="katalog_script.as"/>

<!-- Style sheet used in this application -->
<mx:Style source="katalog.css"/>
<!-- Design begins -->
<mx:VBox>

<mx:Label text="SerenadServer Film Katalog"
styleName="appTitle"/>

<mx:HBox id="hb" horizontalGap="4" height="555">

<mx:Panel id="main" title="Film Katalog" width="512"
height="100%">

<mx:ViewStack id="bodyStack" changeEffect="Fade"
width="100%" height="100%">

<!-- A custom component (ThumbnailView.mxml)
that displays the list of products in a Thumbnail view:
This is the view displayed when you start
the application. When the user clicks a product
(change event), we store the selected item
in the selectedItem instance variable of this application -->
<ThumbnailView id="thumbView"
label="Product Catalog"

dataObject="{katSrv.result.helakatalog.katalog}"

change="selectedItem=event.target.selectedItem"/>

<!-- A custom component (GridView.mxml)
providing another way (DataGrid) to look at the same data -->
<GridView id="gridView"
dataObject="{katSrv.result}"

change="selectedItem=event.target.selectedItem"/>

</mx:ViewStack>

<mx:ControlBar height="50">
<mx:ViewStack
id="controlStack">
<mx:HBox horizontalGap="0"
horizontalAlign="right">
<mx:Image source="{currentView=='thumb'?
thumbOn:thumbOff}" mouseDown="changeView('thumb')"

mouseOver="event.target.source=thumbRoll"
mouseOut="event.target.source=currentView=='thumb'?
thumbOn:thumbOff"/>
<mx:Image source="{currentView=='grid'?
listOn:listOff}" mouseDown="changeView('grid')"
mouseOver="event.target.source=listRoll"
mouseOut="event.target.source=currentView=='grid'?listOn:listOff"/>
</mx:HBox>
</mx:ViewStack>
</mx:ControlBar>

</mx:Panel>

<mx:VBox width="100%" height="100%">

<mx:Canvas id="topCanvas" width="370" height="355"
vScrollPolicy="off">
<MovieDetail id="movieDetail"
dataObject="{selectedItem}" width="100%" height="100%"
vScrollPolicy="off"/>
<PanelControl id="statusTop" width="100%"
resizeEvent="slide(event)"/>
</mx:Canvas>
<mx:Canvas id="bottomCanvas"
width="370" height="100%" vScrollPolicy="off">
<FindView id="findView" width="100%"
height="100%" itemSelected="selectedItem=event.target.selectedItem"
vScrollPolicy="off"/>
<PanelControl id="statusBottom" width="100%"
resizeEvent="slide(event)"/>
</mx:Canvas>
</mx:VBox>
</mx:HBox>
</mx:VBox>

</mx:Application>



--- In flexcoders@yahoogroups.com, Abdul Qabiz <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Can you post your code here, so that we can see whats wrong in 
that?
> 
> You can also post your php code, I can look at it ?
> 
> -abdul 
> 
> -----Original Message-----
> From: pioplacz [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 04, 2005 4:11 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: dynamic xml in flex
> 
> 
> 
> Maybe it sounds king of noobish but i'm a noob... but cannot get 
it to
> work... i tryed just passing the data from httpservice to datagrid 
but the
> right data won't show... I'm getting all confused.... maybe is 
something
> wrong with my php xml output... :S 
> 
> 
> --- In flexcoders@yahoogroups.com, Matt Chotin <[EMAIL PROTECTED]> 
wrote:
> > You might need to use mx.utils.ArrayUtil.toArray() depending on
> which part
> > of the data you're looking for. Search for that in the docs to
> see if it
> > makes sense for you.
> > 
> > 
> > 
> > Matt
> > 
> > 
> > 
> > _____
> > 
> > From: pioplacz [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 03, 2005 9:45 AM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Re: dynamic xml in flex
> > 
> > 
> > 
> > 
> > I've tryed to this is my php... 
> > http://serenadserver.mine.nu:8080/katalog.php
> > <http://serenadserver.mine.nu:8080/katalog.php> it won't 
work... 
> don't 
> > know really why... my app works the same way like the flex
> store... 
> > 
> > --- In flexcoders@yahoogroups.com, Manish Jethani 
> > <[EMAIL PROTECTED]> wrote:
> > > pioplacz wrote:
> > > 
> > > > would be nice is something like webservice used in the flex
> > store.. 
> > > > cuase my application works the same way.. but how can i make
> it 
> > > > happen i have mysql database and i run iis so i have both php
> > and
> > > > asp... 
> > > 
> > > Write some PHP to output your data in XML format, and then Flex
> > can
> > > access it from the URL using HTTPService. See the blog reader
> > example.
> > > 
> > > Manish
> > 
> > 
> > 
> > 
> > 
> > 
> > _____
> > 
> > Yahoo! Groups Links
> > 
> > *   To visit your group on the web, go to:
> > http://groups.yahoo.com/group/flexcoders/
> > <http://groups.yahoo.com/group/flexcoders/>
> > 
> > *   To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]
> subject=Unsubscribe> 
> > 
> > *   Your use of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/> Terms of Service.
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links





Reply via email to