Download

For what it's worth, here's how to play sounds from a UISoundTheme in AS3

Years ago, Flash moved from AS2 to AS3. The Scaleform guys never bothered updating code or documentation for a lot of it. Lost in the change was _global.gfxProcessSound(). (Related topic here.) If anyone in the future needs to play a sound from a UISoundTheme, here’s how to do it:

In your GFxMoviePlayer class, add this function:



function PlaySound(string ThemeName, string EventName)
{
	local SoundThemeBinding ThemeBinding;

	foreach SoundThemes(ThemeBinding)
	{
		if(ThemeBinding.ThemeName == name(ThemeName))
		{
			ThemeBinding.Theme.ProcessSoundEvent(name(EventName));
			return;
		}
	}
}


Then in ActionScript, whenever you want to play a sound, call the function like this:



ExternalInterface.call("PlaySound", "ThemeName", "EventName");


ThemeName and EventName could be “default” and “click” for example, depending on what you put into your own class and theme.

Cool stuff. I think people stay away from AS3 mainly becuase of 2 things

  1. most guides favour AS2
  2. Epic’s notes saying “ALERT! Please contact Scaleform for audio and video integration support.”

Would it be suitable to maybe state what Version of UDK Works with AS3? … *or do they all ? im totally guessing this was a 2012 implementation.
*

I really do not believe that every UDK game released since 2010 has people working with legitimate software. I tried really hard just to get the shi**iest game to work, and earning the money for license’s, building a rig, affording to live all with a **** job was just impossible.

May i ask do you have a Full adobe license? and if so… Would you /// want to Run my menu system through your software ? (if that was an option?).

I have worked with 3 teams and helped Hourences on Solus very briefly, im still the only person i know with any form of license and im the only person i know who has the NVIDIA PhysX license [UE4 it is now free i beleive]

anyway rant rant merry christmas new year and thanks for the AS3 tips.

Hey TKBS. Yes, it certainly seems like all of the information on Scaleform in UDK was meant for AS2. It’s a pity because supposedly AS3 runs at least a degree of magnitude faster than AS2. As far as I know, all UDK versions work with AS3. It’s just that a lot of the ActionScript 2 code snippets don’t work in AS3.

I do have a full Adobe Creative Cloud subscription. It includes Animator. (Which does not work, by the way, for producing UDK-friendly swf’s. You have to download one of the older Flash Professional versions.) I wouldn’t mind doing menus on a case-by-case basis, but I’m working really hard on finishing my own game right now. PM me if you want to talk about specific details and maybe we can work something out.

And merry Christmas and a happy New Year to you too!

Hmmm interesting. I abandoned the use of sound themes for my AS3 scaleform application as they never seemed to work. Ended up just building out something simple that does the same job.