...

View Full Version : Image not showing on 'Details' page? Where am i going wrong?



loki421
02-23-2009, 05:19 PM
Hi again all!

I have an application with two states, one is a tile view of my pictures, and the other is a detail view. When a user clicks on a button (that should apear on rollover but doesn't, see this thread: http://www.codingforums.com/showthread.php?t=159418), it then goes to the 'Details' state where all the other data is displayed along with a nice big image of the selected image.

Problem is i can't get the image to show in the function. I can access the image from the database in the <mx:Tile> container using this code:



<mx:Tile x="10" y="10"
width="100%" height="100%"
paddingBottom="10"
paddingTop="10"
paddingLeft="10"
paddingRight="10"
id="tileView"
horizontalScrollPolicy="off">

<mx:Repeater dataProvider="{myService.getMyData.lastResult}" id="myRepeater">


<mx:Box id="box1"
name="box1"
width="150" height="150"
paddingBottom="5"
paddingTop="5"
paddingLeft="5"
paddingRight="5"
cornerRadius="4"
borderColor="#CCCCCC"
borderStyle="solid"
borderThickness="1"
dropShadowEnabled="true"
direction="vertical">
<mx:Image source="assets/{myRepeater.currentItem.image}" width="100%" height="100%"/>
<mx:HBox horizontalAlign="center" width="100%">
<mx:Button id="button1" label="Details" icon="@Embed(source='assets/enlarge.png')" click="displayData(event)" themeColor="#E5E5E5" borderColor="#FFFFFF" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#FFFFFF, #EEEEEE, #FFFFFF, #CCCCCC]"/>
</mx:HBox>
</mx:Box>


</mx:Repeater>

</mx:Tile>


and he's the remote object


<mx:RemoteObject id="myService" destination="ColdFusion" source="data.myCFC"/>


Now when a user clicks the button for more details it calls this event


private function displayData(event:MouseEvent):void
{
var myService:Object = event.target.getRepeaterItem();
currentState='Details';
description.text = myService.description;
price.text = myService.price;
largeImage.source = myService.image;
}


This is where it's failing, i can't seem to get the image to display using the following code


<mx:Image id="largeImage" source="assets/{myService.getMyData.image}" width="358" height="287"/>


Anybody got any ideas why the image won't display? Any guidence would be gratefully recieved :D

MAny thanks in advance all :D :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum