5/27/2010 5:58:38 AM
Title:
plzz Fix it...
hi all,
i have problem in repeating the images in hbox.i mean ,only one time images list is repeating in hbox whereas i want to repeat it multiple times in both directions.
guy plz fix it
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
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(TimerEvent.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;
}
[Bindable]
private var imgName:String;
private function getImageName(event:MouseEvent):void{
var bx:VBox = event.currentTarget as VBox;
bx.getChildAt(1).visible = true;
}
private function onmouseOut(event:MouseEvent):void{
var bx:VBox = event.currentTarget as VBox;
bx.getChildAt(1).visible = false;
}
]]>
</mx:Script>
<mx:HTTPService id="getData" url="imagescrolldata.xml"/>
<mx:HBox id="gallery">
<mx:Repeater id="imgrp" dataProvider="{getData.lastResult.pectab.spotdetails}">
<mx:VBox mouseOver="getImageName(event)" mouseOut="onmouseOut(event)">
<mx:Image id="imageList" source="{imgrp.currentItem.mediahubthumbnail}"/>
<mx:Button label="{imgrp.currentItem.spotname}" visible="false"/>
</mx:VBox>
<mx:Spacer width="0"/>
</mx:Repeater>
</mx:HBox>
<mx:VBox id="leftbox" left="0" top="0" height="95" width="25" verticalAlign="middle"
mouseOver="goLeft=true;" mouseOut="goLeft=false;">
<mx:Image source="assets/leftArrow.gif"/>
</mx:VBox>
<mx:VBox id="rightbox" right="0" top="0" height="95" width="25" verticalAlign="middle"
mouseOver="goRight=true;" mouseOut="goRight=false;">
<mx:Image source="assets/rightArrow.gif"/>
</mx:VBox>
</mx:Canvas>
5/27/2010 6:53:41 AM
you should use two imageList components for this.
gallery1 gallery2 both should be placed adjacent to each other
say initially
gallery1.x=0
gallery2.x=gallery1.width+gallery1.x
Code should be like this
gallery1.x = gallery.x + 10;
gallery2.x = gallery.x + 10;
private function moveRight():void{
if(gallery2.x<0){
//place to right of gallery 2
gallery2.x=gallery1.x+gallery1.width
}
// this will place the gallery 2 towards left if gallery1 moves right
if(gallery1.x>0){
gallery2.x=gallery1.x-gallery2.width
}
}
I hope you got some idea
5/27/2010 11:23:41 PM
hi all,
thanku hunter tried it but problem still exits the gallery is not running after the gallery one ends.
any one plz help us ...