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




1
Hunter
Points: 0
Posts:0
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

2
nannu
Points: 0
Posts:0
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 ...


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+1 



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