Results 1 to 5 of 5
  1. #1

    Question Scrolling List difference between AS2 and AS3

    Hey guys,

    I'm really new to this whole scaleform stuff. I try to setup a menu for our game but at the moment I'm stuck at the scrolling list component.
    For some tests and for a better understanding I built a really simple flashfile with just a scrolling list in it. I built one file for each AS version. The AS2 list works fine and showed all expected items, but in the AS3 file my scrolling list remains blank.
    This is the uc code I used for both lists:
    Code:
    class MyMenu extends GFxMoviePlayer
        config(ScaleformMenu);
    
    struct Option
    {
        var string OptionName;
        var string OptionLabel;
        var string OptionDesc;
    };
    
    var config array<Option> ListOptions;
    
    var GFxClikWidget ScrollingList;
    
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {    
        switch(WidgetName)
        {                 
    		case ('sl'): // this assumes your Scrolling List has an instance name of 'sl' in Flash.
    			ScrollingList = GFxClikWidget(Widget);
    			SetUpDataProvider(ScrollingList);
    			break;
    		default:
                break;
        }
        return true;
    }
    
    function SetUpDataProvider(GFxClikWidget Widget)
    {
        local byte i;
        local GFxObject DataProvider;
        local GFxObject TempObj;
    
        DataProvider = CreateArray();
    	
        switch(Widget)
        {
    	case (ScrollingList):
    	    for (i = 0; i < ListOptions.Length; i++)
    	    {        
    			TempObj = CreateObject("Object");
    			TempObj.SetString("name", ListOptions[i].OptionName);
    			TempObj.SetString("label", ListOptions[i].OptionLabel); // this will be displayed in the list
    			TempObj.SetString("desc", ListOptions[i].OptionDesc);
    			DataProvider.SetElementObject(i, TempObj);
    	    }
    	    Widget.SetFloat("rowCount", ListOptions.Length);   // you must specify the row count of scrolling lists manually 
    	    break;
    	default:
    	    break;
        }  
        Widget.SetObject("dataProvider", DataProvider);  	
    }
    
    defaultproperties
    {    
        WidgetBindings.Add((WidgetName="sl",WidgetClass=class'GFxClikWidget'))  // this assumes your Scrolling List has an instance name of 'sl' in Flash.
    }
    and the code from the ScaleformMenu.ini file:
    Code:
    [Configuration]
    BasedOn=..\Engine\Config\BaseUI.ini
    
    [UTGame.MyMenu]
    +ListOptions=(OptionName="Option 1",OptionLabel="Tame",OptionDesc="Easy")
    +ListOptions=(OptionName="Option 2",OptionLabel="Wild",OptionDesc="Medium")
    +ListOptions=(OptionName="Option 3",OptionLabel="Crazy",OptionDesc="Hard")
    +ListOptions=(OptionName="Option 4",OptionLabel="Insane",OptionDesc="Very hard")
    My two flashfiles are really simple - two layers. One for the actionscript with just "stop();" in it and one layer with the content (just a scrolling list).
    I use the newest udk version.

    Here two pictures with the problem:



    I definitely miss something. Hopefully one of you can help me out with this. I'm getting crazy...

  2. #2
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Posts
    312

    Default

    You are not crazy, I have the exact same problem. I don't have a solution either. I have debugged everything to the point where the only point of failure is getting the desired string to show up in the list itself. I'm using different code, but the principal is the same. I am starting to think there is an issue using SetString as that is what is failing.
    Last edited by John J; 07-10-2012 at 12:06 PM.

  3. #3
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Posts
    312

    Default

    I can't believe that no one has tried to populate a scrolling list with AS3.

  4. #4

    Default

    having the same problem here with scrollinglist in as3
    Is there anyone to help?

  5. #5
    The Sacrifice
    Join Date
    Aug 2013
    Posts
    144

    Default

    Is there a specific reason why you are using this approach ?
    I built my CLIK scrolling list in AS3 and populate through setters and actionscriptvoid and it works fine. And unless you really need to populate from ini files, why not simply populate in AS3 ?

    Not saying I have a solution for you, just hinting an alternate approach for the time being.


 

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-2015 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.