No announcement yet.

AS3 - Setting up icons on a list item

  • Filter
  • Time
  • Show
Clear All
new posts

    AS3 - Setting up icons on a list item


    I have read this tutorial there :
    But it appears that it is not up to date anymore. I tried something in AS3. Here is my AS class :

    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()
    			trace("DVIcon ready");
    		/*--- Set data to the item ---*/
    		public override function setData(data:Object):void 
    		{ = data;
    			this.imageLoader.source = data ? data.iconimage : "";
    			trace("DVIcon set");
    Now, the funny UScript 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 : ?

    I also noticed that simply putting an UILoader on my movie, then setting up its "source" property (img://package.image) does not seem to do anything.

    Please, how is this supposed to work ?


      Okay, so here are my progresses :
      - The UILoader with a default setting and a image (img:// works perfectly when used alone in Scaleform without CLIK
      - When used with CLIK, it breaks the whole frame, shutting down every CLIK component AND not showing up anymore

      Still no one ? :3


        I am going back to basis.

        I put an UILoader on stage with an image link, and nothing else. I click on publish.
        - When using Flash, it works
        - When using Scaleform player, it does not, no image and same error as above
        Why ?