Results 1 to 5 of 5

Thread: Scrolling List difference between AS2 and AS3

  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:
    class MyMenu extends GFxMoviePlayer
    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)
    		case ('sl'): // this assumes your Scrolling List has an instance name of 'sl' in Flash.
    			ScrollingList = GFxClikWidget(Widget);
        return true;
    function SetUpDataProvider(GFxClikWidget Widget)
        local byte i;
        local GFxObject DataProvider;
        local GFxObject TempObj;
        DataProvider = CreateArray();
    	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 
        Widget.SetObject("dataProvider", DataProvider);  	
        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:
    +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
    John J
    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.

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

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

  5. #5
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts