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>
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...