Announcement

Collapse
No announcement yet.

Can someone post an example of how call unrealscript function from actionscript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can someone post an example of how call unrealscript function from actionscript?

    Hi.

    Please, can someone post an example of how call unrealscript function from actionscript?


    Thank you.

    #2
    Hi!

    It's very easy. Here's how:

    ActionScript:

    Code:
    import flash.external.ExternalInterface
    
    ExternalInterface.call("MyUnrealFunction", "someString", someInt, someBoolean);
    UnrealScript:

    Code:
    function MyUnrealFunction(String myString, Int myInt, Bool myBoolean)
    {
        \\ Do Something...
    }

    Comment


      #3
      Thank you, Matt!!

      That's right!

      Comment


        #4
        i have tried this.... but how to initialize the class of gfxmovieplayer... can you post a complete class sample

        Comment


          #5
          aCatUDK - There are lots of tutorials on these forums, and our Youtube Scaleform channel on how to do this type of stuff. I'd recommend following those if you are just now learning how to use it.

          Here however is what a Scaleform class looks like:

          Code:
          class SFAS3Menu extends GFxMoviePlayer;
          
          // Standard Flash Objects
          var GFxObject 				MenuMC, MouseCursorMC, RollOverMC;
          
          // CLIK Widgets
          var GFxClikWidget 			MainMenuTF, OptionsMenuTF, ToolTipTF;
          var GFxClikWidget			StartBtn, OptionsBtn, BackBtn;
          
          // For ease of modification, all display text is localized and stored in the file 'SFTutorialAS3.int' in the /Localization/INT directory.
          var localized string 		mainMenuTitle, optionsMenuTitle, startBtnLabel, optionsBtnLabel, backBtnLabel, startBtnTip, optionsBtnTip, backBtnTip;
          
          // This function starts playing the SWF, and can also be used to initialize various variables and objects.
          function bool Start(optional bool StartPaused = false)
          {	
              super.Start();
              Advance(0.f);
          	
          	// Cache a reference to the menu container.
          	MenuMC = GetVariableObject("root.menu");
          					
              return true;
          }
          You can either run it from Kismet (OpenGFxMovie) or from UnrealScript with something like this:\

          Code:
          var SFAS3Hud   			HudMovie;
          
          simulated function PostBeginPlay()
          {
          	Super.PostBeginPlay();
          	
          	HudMovie = new class'SFAS3Hud';
          
          	HudMovie.SetTimingMode(TM_Real);
          	HudMovie.Init(class'Engine'.static.GetEngine().GamePlayers[HudMovie.LocalPlayerOwnerIndex]);
          
          }

          Comment


            #6
            http://udn.epicgames.com/Three/GFxUScriptVarAccess.html

            Comment

            Working...
            X