A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: I seem not to be able to show an extra text in this Img gallery ....

  1. #1
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117

    I seem not to be able to show an extra text in this Img gallery ....

    I found this code in one of my databases, and I assume it was taken from the net at some stage just can't recall where & when I got it, but AS IS it is exactly right so I wanted to use it!
    I was trying to get some text with it or the title for example into an extra text field yet could not make it work to show the text or title of the selectedIndex etc.
    It looks all very strait forward and easy yet NO luck ??? could somebody look at it and suggest an answer !!! would be very much appreciated! Thanks in advance regards aktell

    Code:
    	applicationComplete="service.send()">
    
    
    	
    	<mx:HTTPService 
    		id="service"
    		url="photos.xml"
    		resultFormat="e4x"/>
    	
    	<mx:TabNavigator 
    		width="220"
    		creationPolicy="all">
    		
    		<mx:Canvas 
    			label="List View" 
    			width="100%" height="100%">
    			
    			<mx:List 
    				id="photosList" 
    				width="100%" height="100%"
    				labelField="@title"
    				dataProvider="{service.lastResult.photo}" 
    				change="photosTileList.selectedIndex = photosList.selectedIndex"/>
    			
    		</mx:Canvas>
    		
    		<mx:Canvas 
    			label="Tile View" 	
    			width="100%" height="100%">
    			
    			<mx:TileList 
                                   change="photosList.selectedIndex = photosTileList.selectedIndex"
    			       id="photosTileList" 
    			       width="100%" height="100%"
    			       dataProvider="{service.lastResult.photo}">
    				
    				<mx:itemRenderer>
    					
    					<mx:Component>
    						
    						<cacheImg:CachedImage 
    							source="{data.@thumb}"
    							toolTip="{data.@title}"
    							width="100" height="60"/>
    						
    					</mx:Component>
    					
    				</mx:itemRenderer>
    				
    			</mx:TileList>
    			
    		</mx:Canvas>
    		
    	</mx:TabNavigator>
    	
    	<mx:Box
    		width="100%" height="20">
    		
    		<mx:TextArea 
    			text=" ??? "
    			width="200" height="20"
    			color="#ff0000"/>
    		
    	</mx:Box>
    	
    	<mx:Image
    		id="image" 
    		source="{photosList.selectedItem.@image}"/>
    	
    </mx:Application>
    Code:
    XML file: photos.xml
    <photos>
    	
    	<photo
    		title="text" 
    		thumb="pathway"
    		image="pathway"/>
    	
    	<photo
    		title="text" 
    		thumb="pathway"
    		image="pathway"/>
    	
    
    </photos>

  2. #2
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117
    Over night I came across another item which I would like to include yet again tried & did not get unfortunately a result! I'm looking for the idea of showing at creation that the first Image would be included & visible? regards aktell

  3. #3
    Senior Member
    Join Date
    Apr 2008
    Location
    Rotorua / New Zealand
    Posts
    117
    Quote Originally Posted by aktell View Post

    Code:
    	
    	<mx:TabNavigator 
    		width="220"
    		creationPolicy="all">
    		
    		<mx:Canvas 
    			label="List View" 
    			width="100%" height="100%">
    			
    			<mx:List 
    				id="photosList" 
    				width="100%" height="100%"
    				labelField="@title"
    				dataProvider="{service.lastResult.photo}" 
    				change="photosTileList.selectedIndex = photosList.selectedIndex"/>
    			
    		</mx:Canvas>
    		
    		<mx:Canvas 
    			label="Tile View" 	
    			width="100%" height="100%">
    			
    			<mx:TileList 
                                   change="photosList.selectedIndex = photosTileList.selectedIndex"
    			       id="photosTileList" 
    			       width="100%" height="100%"
    			       dataProvider="{service.lastResult.photo}">
    				
    				<mx:itemRenderer>
    					
    					<mx:Component>
    						
    						<cacheImg:CachedImage 
    							source="{data.@thumb}"
    							toolTip="{data.@title}"
    							width="100" height="60"/>
    						
    					</mx:Component>
    					
    				</mx:itemRenderer>
    				
    			</mx:TileList>
    			
    		</mx:Canvas>
    		
    	</mx:TabNavigator>
    	
    	<mx:Box
    		width="100%" height="20">
    		
    		<mx:TextArea 
    			text=" {photosList.selectedItem.@title}"
    			width="200" height="20"
    			color="#ff0000"/>
    		
    	</mx:Box>
    	
    	<mx:Image
    		id="image" 
    		source="{photosList.selectedItem.@image}"/>
    	
    </mx:Application>
    Well, it is only fair enough to admit if once was quiet foolish! I was able to solve the first item mentioned as the answer was actually right there I must have been concentrating on this - photosTileList.selectedIndex = photosList.selectedIndex - so in not seeing what I actually needed. Sorry YET plese I'm still searching about the second item to show an Image at first opening ??? regards aktell

  4. #4
    Registered User
    Join Date
    Aug 2013
    Posts
    1
    I also don't understand

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center