header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
nannu
Points:0
Posts:0

5/25/2010 12:46:13 AM

Title: how to repeat the images in a horizontal list


hi all,

i have a horizontal list in which images are displayed from a xml file .say there are 5 images ,after completion of 5th image the 1st image and so on should display.

in simple i want the horizontal list to scroll the images in a clockwise direction and anti-clockwise direction based on mouse movement.

thanks in advance,if u have sample code ,i will be greatfull to u


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="imgService.send()" 
	xmlns:v="components.*" >
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.ResultEvent;
			import mx.rpc.events.FaultEvent;
			/* public var imgdata:Object = parent.document.MyComp; */
			private function imgresultHandler(event:ResultEvent):void{
					var imgdata:Object=event.result as XML;
				}
		    private function imghandleFault(event:FaultEvent):void{
		        	trace(event.fault.faultCode+":"+event.fault.faultString);
				}  
		]]>
	</mx:Script>
	<mx:HTTPService id="imgService" url="imagescrolldata.xml" resultFormat="e4x" result="imgresultHandler(event)" 
							fault="imghandleFault(event)" />
	<mx:XMLListCollection id="imgList" source="{imgService.lastResult.spotdetails}"/>
	<mx:HorizontalList id="imghlist" columnWidth="125" rowHeight="125" columnCount="3" 
			dataProvider="{imgList}" itemRenderer="components.ImageAndDesc"/>
</mx:Application>
-------------------------------------------component code
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
		[Bindable]	
		//private var myarray:Array = new Array(); wanted to pass the array of images
		private function scrollimage():void{
		 	if(img.x<500){
            		img.x+=5;
            	}else{
            		img.x=0;
            	}
            }     
		]]>
	</mx:Script>
	<mx:Image id="img" source="{data.@mediahubthumbnail}" mouseMove="scrollimage()"/>
</mx:VBox>



1
Cyprus
Points: 0
Posts:0
5/25/2010 1:15:18 AM



check this link:
http://joelhooks.com/2009/12/24/continuous-scrolling-thumbnail-component-for-flex/


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+7 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions