Results 1 to 4 of 4

Threaded View

  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2008
    Location
    Paris, France
    Posts
    118

    Default AS3 - Setting up icons on a list item

    Hi,

    I have read this tutorial there : http://forums.epicgames.com/threads/...4#post29304564
    But it appears that it is not up to date anymore. I tried something in AS3. Here is my AS class :

    Code:
    package com.scaleform.coreui
    {	
    	// Import
    	import scaleform.clik.controls.ListItemRenderer;
    	import flash.display.MovieClip;
    	import fl.containers.UILoader;
    	
    	// Class definition
    	public class DVListItem extends ListItemRenderer {
    		
    		/*--- Public attributes ---*/
    		public var imageLoader:UILoader;
    	
    		/*--- Constructor ---*/
    		public function DVListItem()
    		{
    			super();
    			trace("DVIcon ready");
    		}
    		
    		/*--- Set data to the item ---*/
    		public override function setData(data:Object):void 
    		{
    			this.data = data;
    			this.imageLoader.source = data ? data.iconimage : "";
    			trace("DVIcon set");
    		}
    	}
    }
    Now, the funny UScript code :

    Code:
    function UpdateServerList()
    {
    	local byte 			i;
    	local GFxObject 	TempObj;
    	local GFxObject 	DataProvider;
    
    	// Sending data to menu
    	DataProvider = ServerListMC.GetObject("dataProvider");
    	for (i = 0; i < ServerList.Length; i++)
    	{
    		TempObj = CreateObject("Object");
    		TempObj.SetString("label", ServerList[i]);
    		TempObj.SetString("iconimage", "img://IcoThumbs.Textures.TX_THUMBNAIL_Level01");
    		DataProvider.SetElementObject(i, TempObj);
    	}
    	ServerListMC.SetObject("dataProvider", DataProvider);
    	ServerListMC.SetFloat("rowCount", i);
    }
    Now, the fact is that this does not work. The list is behaving really good, the label is correct etc. There is just no image.
    I also get a lot of errors in the Scaleform Console, here is a pic :



    Any help would be appreciated ! I am not really familiar with AS.
    Should UILoader be a problem, is this thread here a solution : http://forums.epicgames.com/threads/...unreal-package ?
    Last edited by Gwen-Haël; 05-13-2012 at 08:53 AM. Reason: indent


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.