Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-28-2010, 08:32 AM   PM User | #1
baubai
New to the CF scene

 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
baubai is an unknown quantity at this point
mess with viewstack

hi,

situation: i have php file wich generates xlm data, wthen i have repeater in viewstack to generate viewstack elements, and I need to make links in first element of viewstack to other viewstack elements, here is my code:

Code:
	 <mx:Script>
	 	<![CDATA[
	 		[Bindable]
            public var st:Object;
            
	 		public function chId(st:Object):void {
	 			var num:int=st.toString();
	 			stack.selectedIndex=num;
	 		}
	 		public function init():void {
	 			question.send()
	 			fin.play([d]);
				fin.play([box]);
	 		}
	 	]]>
	 </mx:Script>
	<mx:Fade alphaFrom="0" alphaTo="1" id="fin" />
	<mx:HTTPService url="data/kolekcijos.php" id="question"  useProxy="false" resultFormat="e4x"/>
	<mx:XMLListCollection id="myXC"
            source="{question.lastResult.q}"/>
	
	 <mx:Canvas width="99.9%" height="100%" horizontalScrollPolicy="off">	
	 <mx:ViewStack id="stack" selectedIndex="0" height="100%" width="100%" x="10"  y="5">
	  	<mx:VBox label="id0" id="box" width="100%" height="100%"  horizontalScrollPolicy="off" >
	 	<mx:Repeater id="d" dataProvider="{myXC}">
   	 		<mx:Canvas>
   	 		<mx:Image source="{d.currentItem.img}"  verticalCenter="0" width="120" height="90" 
   	 			useHandCursor="true" buttonMode="true" mouseChildren="false" click="chId([d.currentItem.idd])"/>
   	 		<mx:Text text="{d.currentItem.info}"  color="#AE917C" styleName="Labelrec" width="433" x="147" verticalCenter="0"/>
   	 	</mx:Canvas>
   	 	<mx:Image source="img/stroke.jpg"/>
   	 	</mx:Repeater>
	 	</mx:VBox>
	 	<mx:Repeater id="f" dataProvider="{myXC}">
	 		<mx:VBox label="id{f.currentItem.idd}" width="100%" height="100%">
	 		
	 		<mx:Label text="{f.currentItem.info} {f.currentItem.id}" color="#F1FDFF"/>
	 		</mx:VBox>
	 	</mx:Repeater>
	</mx:ViewStack>
</mx:Canvas>
so how to make work links, talking about click="chId([d.currentItem.idd]),
d.currentItem.idd is the number, how must look function to change viewstac k vbox?
baubai is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:20 PM.


Advertisement
Log in to turn off these ads.