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 11:30:02 PM

Title: repeating the same images multiple times


hi all,

i want to repeat the images which are available in list based on mouse movement.presently i am able to scroll the images but when the list of images are completed the hbox is blank.
this is code.thanks

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" 
	horizontalScrollPolicy="off" verticalScrollPolicy="off" height="156" width="527" layout="absolute">
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.FaultEvent;
			import flash.events.MouseEvent;
			
			private var goLeft:Boolean = false;
			private var goRight:Boolean = false;
			
			private function init():void {
				getData.send();
				createTimer();
			}
			private function createTimer():void {
	            var myTimer:Timer = new Timer(30);
	            myTimer.addEventListener("timer", timerHandler);
	            myTimer.start();
	        }
			private function timerHandler(event:TimerEvent):void {
	            if(goLeft){
	            	moveRight();
	        	}
	        	if(goRight){
	            	moveLeft();
	        	}
	        }
			private function moveLeft():void{
				gallery.x = gallery.x - 10;
				
			}
			private function moveRight():void{
				gallery.x = gallery.x + 10;
			}
			private function httpfault(event:FaultEvent):void{
	    		
	    	}
	    ]]>
    </mx:Script>
	<mx:HTTPService id="getData" url="imagescrolldata.xml" fault="httpfault(event)"/>
    <mx:HBox id="gallery" verticalAlign="middle" height="124" width="100%" horizontalAlign="center" 
    	horizontalGap="0" y="31">
		<mx:Repeater id="pageItems" dataProvider="{getData.lastResult.pectab.spotdetails}">
			<mx:Image id="imagePops" source="{pageItems.currentItem.mediahubthumbnail}"/>
		</mx:Repeater>
	</mx:HBox>
	<mx:VBox id="leftbox" left="0" top="49" height="91" width="25" verticalAlign="middle"
		mouseOver="goLeft=true;" mouseOut="goLeft=false;"  backgroundColor="#B7BABC" backgroundAlpha="0.25">
		<mx:Image source="assets/leftArrow.gif"/>
	</mx:VBox>
	<mx:VBox id="rightbox" right="0" top="49" height="91" width="25" verticalAlign="middle" 
		mouseOver="goRight=true;" mouseOut="goRight=false;"  backgroundColor="#B7BABC" backgroundAlpha="0.25">	
		<mx:Image source="assets/rightArrow.gif"/>
	</mx:VBox>
</mx:Application>




1
nannu
Points: 0
Posts:0
5/25/2010 11:51:08 PM



hi all,

shall i use two hboxes if one is completed displaying all the images ,set the visible property to false or else is there any there any better way to repeat the same array of images in the same hbox.
plz guide me...


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+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