Results 1 to 3 of 3
  1. #1

    Default I can't change the text of my test label, can you help me?

    I created a test Flash project and imported to UDK, it should change the label's text, but can't work. I just copied the label component from the file "\Development\Flash\AS3\CLIK\components\CLIK_Compo nents_AS3.fla", into my flash project called "FlashTest", and renamed the label as "label". I also set "enableInintCallback" to "true". The "FlashTest.swf" is under" UDK-2011-12\UDKGame\Flash\FlashTest". My unscript code is as below:

    Code:
    class UITest extends GFxMoviePlayer;
    var GFxCLIKWidget MessageLabel;
    function bool Start(optional bool StartPaused = false)
    {
        Super.Start();
        Advance(0);
    
        return true;
    }
    
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
        switch(Widgetname)
        {
            case 'label':
                MessageLabel = GFxCLIKWidget(Widget);          //important
                MessageLabel.SetString("text","fucalsdkjfas");    //important
                break;
            default:
                return Super.WidgetInitialized(Widgetname, WidgetPath, Widget);
        }
        
        return false;
    }
    
    defaultproperties
    {
    	MovieInfo=SwfMovie'FlashTest.FlashTest'
    	WidgetBindings.Add((WidgetName="label",WidgetClass=class'GFxCLIKWidget'))
    	bDisplayWithHudOff=TRUE
    	TimingMode=TM_Real
    	bPauseGameWhileActive=TRUE
    	bCaptureInput=true
    }

  2. #2

    Default

    Maybe the widget on the stage doesn't have the right instance name? Is the instance name "label"?

  3. #3

    Default

    I was getting really frustrated with my text not showing up as well.

    Ends up I should have been copying and pasting the Label and buttons from CLICK_Components.fla, and not adding my own.

    When the text still wasn't updating I took a look at the SFTutorialAS3 code (SFAS3Menu.uc) and saw that they were using the following in their default properties.

    Code:
    WidgetBindings(0)={(WidgetName="mainMenu_tf",WidgetClass=class'GFxClikWidget')}
    Lastly, the kismet node for OpenGFXMovie needs to have the Movie Player Class changed to the .uc file you create for these labels etc or they won't show up at all.

    Hope that helps!

    Here's my full code.

    Code:
    class Test_TeamSelectionUI extends GFXMoviePlayer;
    
    // Standard Flash Objects
    var GfxClikWidget teamSelectTF;
    var GfxClikWidget joinBlueBtn, JoinRedBtn;
    
    function bool Start(optional bool StartPaused = false)
    {
        Super.Start();
        Advance(0);
    
        return true;
    }
    
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    	switch(WidgetName)
    	{
    		case 'teamSelect_TF':
    			teamSelectTF = GfxClikWidget(Widget);
    			teamSelectTF.SetString("text", "Select a team");
    			break;
    		case 'joinBlue_Btn':
    			joinBlueBtn = GfxClikWidget(Widget);
    			joinBlueBtn.SetString("label", "Blue");
    			break;
    		case 'joinRed_Btn':
    			joinRedBtn = GfxClikWidget(Widget);
    			joinRedBtn.SetString("label", "Red");
    			break;
    		default:
    			break;
    	}
    	
    	return true;
    }
    
    // This function adds event listeners to the menu buttons, and sets the text displayed on the button.
    function SetUpButtonEvents(GFxClikWidget button, string buttonLabel)
    {
    	button.SetString("label", buttonLabel);
    }
    
    DefaultProperties
    {
    	WidgetBindings(0)={(WidgetName="teamSelect_TF",WidgetClass=class'GFxClikWidget')}
    	WidgetBindings(1)={(WidgetName="joinBlue_Btn",WidgetClass=class'GFxClikWidget')}
    	WidgetBindings(3)={(WidgetName="joinRed_Btn",WidgetClass=class'GFxClikWidget')}
    }
    Now I'm onto making the buttons actually pick the correct team
    "See you on the Battlfield!"

    -iICol SandersIi


 

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.