Announcement

Collapse
No announcement yet.

My scrolling list doesn't work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    My scrolling list doesn't work

    Hi!

    Does anyone knows about a scrolling list tutorial?

    I have been investigating about scrolling lists in scaleform, but I can't get it functioning. I have developed my as3 class and a fla file, but the scrolling list doesn't work.

    I don't know how to make it work, so if anyone knows how to do that or knows about a tutorial of scrolling lists in Scaleform, I would be grateful.

    Regards!

    EDIT: This the AS3 script I have done:

    Code:
    package scripts {
    
    	import flash.events.Event;
    	import flash.external.ExternalInterface;
    
    	import scaleform.clik.core.UIComponent;
    	import scaleform.clik.controls.ListItemRenderer;
    	import scaleform.clik.controls.ScrollBar;
    	import scaleform.clik.controls.ScrollingList;
    	import scaleform.clik.data.DataProvider;
    	import scaleform.clik.events.ListEvent;
    
    	public class ConversationMenu_16_9 extends UIComponent {
    	
    		// Public Attributes //
    		public var questionsAnswersList:ScrollingList;
    		public var roundId:String;
    	
    		// Initialization //
    		public function ConversationMenu_16_9() {
    			super();
    		}
    		
    		// Protected Methods //
    		override protected function configUI():void {
    			super.configUI();
    			
    			var itemsData:Array = new Array();
    			for(var indexArray:int = 0; indexArray < 3; indexArray++) {
    				itemsData.push({label:"Item: " + indexArray, index:indexArray, roundId:indexArray});
    			}
    			questionsAnswersList.dataProvider = new DataProvider(itemsData);
    		
    			questionsAnswersList.selectedIndex = 0;
    			questionsAnswersList.validateNow();
    		
    			questionsAnswersList.addEventListener(ListEvent.INDEX_CHANGE, HandleListIndexChange, false, 0, true);
    			questionsAnswersList.addEventListener(ListEvent.ITEM_CLICK, HandleListItemClick, false, 0, true);
    		}
    	
    		function HandleListIndexChange(event:Event):void {
    			var selectedIndex:int = questionsAnswersList.selectedIndex;
    		
    			if(selectedIndex >= 0 && selectedIndex < questionsAnswersList.dataProvider.length) {
    				roundId = questionsAnswersList.dataProvider[selectedIndex].roundId;
    			}
    		}
    	
    		function HandleListItemClick(event:ListEvent):void {
    			ExternalInterface.call("SetRound, " + roundId);
    			trace("Parameter: " + roundId);
    		}
    	
    	}
    
    }
Working...
X