What is the proper way to reinitialize CLIK widgets when jumping around in a flash file?
In my menu, I have the CLIK widgets set to a blank value for the text labels.
In my unreal script, I do this for each button label in the Start function:
I'm doing this so I can use localized text on the main menu. It works fine.Code:// Setup Main Menu Label_Button_MM_Play = GetVariableObject("_root.button_MM_Play.textField"); Label_Button_MM_Play.SetText(Label_Button_MM_Play_loc); //This is localized text
In my flash file, I have my menu pages laid out in labeled frames. So when you click options, it jumps to the Options label with gotoAndPlay.
After jumping with gotoAndPlay, any buttons I have in the options frame (which happens to be frame 20) don't have text labels. For reference, the CLIK widget doesn't exist on Frame 1 (in otherwords, I didn't put it there and hide it) it begins existing only on Frame 20 (Options label)
When I hit the back button on my Options menu to jump back to the Main Menu frame (frame 1) all the text labels are gone, even though they were there when the flash file started.
If I put this in the WidgetInitialized switch block:
The text shows up again. However, this doesn't work for greyed out buttons (disabled buttons) I think they are probably not firing initialized events?Code:Label_Button_MM_Play.SetText(Label_Button_MM_Play_loc);
I also can't get a CLIK widget that is created in frame 20 to have text on it at all... so I'm doing something wrong. Even if I follow the steps above for the CLIK button on Frame 20, I still get "textfield"
I hope this isn't too confusing. The short version is -- I think I'm not reinitializing widgets properly after a gotoAndPlay. What is the right way to catch these events and reset my localized text on buttons?
I've read the block on localization here: http://udn.epicgames.com/Three/Scale...0and%20Binding
And that is essentially what I'm doing but it doesn't work on A) Disabled CLIK widgets (I'm guess they don't fire off widgetinitialized events?) and B) Widgets that first show up on Frames after 1.
I've got visible and EnableInitCallback turned on for all of these buttons.