No announcement yet.

ScrollingList doesn't show its content

  • Filter
  • Time
  • Show
Clear All
new posts

    ScrollingList doesn't show its content

    I'm trying to add a scrolling list to my menu, for now only within flash using Clik Components.

    So I copied ScrollingList and ScrollBar from CLIK_Component.fla, I added a very simple AS code, like in ScrollingListDemo.fla but simpler:

    ListTest.dataProvider = ["Take", "Tina", "Michael", "Wendy", "Frank", "Artem", "Dave", "Judy"];
    ListSB.scrollTarget = ListTest;
    The problem is: when I test my menu I have the scrollBar linked to the list (same number of steps as number of entries in the list), but the list doesn't show anything.

    I noticed in the Scaleform "Dos debug box" this error:

    Error: _Level10.instance5.ListTest.container.attachMovie<> failed - export name "ListItemRenderer" is not found.
    Error: CallMethod - 'removeMovieClip' on invalid object.Load: _Level10.instance5.ListTest

    So what am I doing wrong?

    You need a ListItemRenderer in your library as well. Open the scrolling list demo again, and look in the library. Copy and past everything in there to your Flash file.


      Arff...looks like a beginner omission, thanks.


        I thought I could handle the next step by my self but seems I can't...
        So how can I fill the list in myGFxMoviePlayer.uc using a var array?


          Have a look at GFxUDKFrontEnd_MainMenu.uc, line 185:

          function UpdateListDataProvider()
          	local byte i;
          	local GFxObject DataProvider;
          	local GFxObject TempObj;
          	DataProvider = Outer.CreateArray();
          	for (i = 0; i < ListOptions.Length; i++)
          		TempObj = CreateObject("Object");
          		TempObj.SetString("name", ListOptions[i].OptionName);
          		TempObj.SetString("label", ListOptions[i].OptionLabel);
          		TempObj.SetString("desc", ListOptions[i].OptionDesc);
          		DataProvider.SetElementObject(i, TempObj);
          	ListMC.SetObject("dataProvider", DataProvider);   
          	ListDataProvider = ListMC.GetObject("dataProvider");    
          	ListMC.AddEventListener('CLIK_itemPress', OnListItemPress);
          	ListMC.AddEventListener('CLIK_change', OnListChange);


            Hi again.
            With your tutorial and after lot of search into UTGFx classes I achieved what I wanted.
            However I'm trying to make a new list showing player's profiles. Everything is working except the list show elements named: [object Object]
            I tried many variations on my code, but I still have this result.
            Any idea?

            var GFxObject		SelectedProfileTitle;
            var GFxObject		CurrentProfileTitle;
            var GFxClikWidget		PlayerProfileListMC;
            var string		SelectedProfileName;
            struct PlayerProfile
            	var string		PPID;
            	var string		PPName;
            var array<PlayerProfile>		PPList;
            var NE_PlayerProfileSystem		PPSystem;
            function ListProfile()
            	local int i;
                local GFxObject DataProvider;
                local GFxObject TempObj;
            	local array<string>		LocalPPIDList;
            	local array<string>		LocalPPNameList;
            	DataProvider = CreateArray();
            	PPSystem = NE_GameInfo( GetPC().WorldInfo.Game ).PPSystem;
            	LocalPPIDList = PPSystem.CheckProfiles();
            	LocalPPNameList = PPSystem.GetPPNames();
            	for ( i = 0; i < LocalPPIDList.length; i++ )
            		PPList.Add( 1 );
            		PPList[i].PPID = LocalPPIDList[i];
            		//`Log ( "TEST_ID:" @ PPList[i].PPID );
            		PPList[i].PPName = LocalPPNameList[i];
            		//`Log ( "TEST_Name:" @ PPList[i].PPName );
            	for ( i = 0; i < PPList.length; i++ )
            		TempObj = CreateObject("Object");
            		TempObj.SetString("ID", PPList[i].PPID );
            		TempObj.SetString("Name", PPList[i].PPName );
            		DataProvider.SetElementObject( i, TempObj );
            	PlayerProfileListMC.SetObject("dataProvider", DataProvider);


              Could be that you haven't set the label of each row:

              TempObj.SetString("label", PPList[i].PPLabel );

              "label" is what is displayed in the list, not name.


                Yes it works now, I tried with "Label" and of course didn't get result because of the upper-case L...

                Thanks again for your continuous support.

                BTW I noticed if I have less items in my list than the default list length, I have empty items which return out of bounds warning in the log when pressed.
                It's not very important, but it is possible to don't fill the list with these empty items?


                  Not sure about that. I've done a test on my end, with only 3 options, and it displays only the 3. There are no extra options displayed in the list. I'm using a standard CLIK dropdown list. What are you using?


                    I'm using a ScrollingList from CLIK_components.fla.

                    You can see on this pict the empty items.


                      Ah. Dropdown works properly, but yes, I see that scrolling list does not.

                      I notice in (lines 415, 416):
                      if (_dropdown.autoRowCount != null) { _dropdown.autoRowCount = true; }		
                      if (_dropdown.rowCount != null) { _dropdown.rowCount = Math.min(_dataProvider.length, _rowCount); }
                      This is the code that sets the rowCount to be whatever the number of options is.

                      Not sure about Have to investigate how to do the same there.


                        Ok,this is what you'll need to add to your UnrealScript:


                        Of course, you can replace the magic number "3" with a variable holding the total number of rows of your list.


                          Great, I just added a condition to limit the size, else if the number of item was bigger than the default rowCount, my list was growing and overlapping the other flash components in the menu and the scrollbar became useless

                          Now it works perfectly, so thanks again.