Announcement

Collapse
No announcement yet.

[Solved] Invoke ActionScript Kismet with AS3

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

    [Solved] Invoke ActionScript Kismet with AS3

    Is there a known bug with Invoke ActionScript not working using ActionScript 3?

    December 2011 UDK.

    Using Kismet, I had a Gfx Invoke ActionScript node working with a swf made with AS2, after I brought the .fla to AS3, Invoke no longer has any effect, but the movie still loads.

    #2
    Sequence to invoke AS3 functions from Kismet

    This is tested in UDK Feb 2012 with AS3

    This is the functioning solution I came up with. I'm posting it here since it may be of help to someone else using AS3 Scaleform. It gets setup in a similar way as the Gfx Invoke ActionScript that is allready in Kismet.

    FunctionPath for me has been '_root'
    The InvokeFunction is the name of the function you want to call in your .swf
    args does not need to be set if your functions doesn't take any.

    Code:
    class SeqAction_GFx_CustomInvoke_AS3 extends SequenceAction
    	dependson(GFxMoviePlayer);
    
    var GFxMoviePlayer MoviePlayer;
    
    var() string FunctionPath;
    var() string InvokeFunction;
    var() array<ASValue> args;
    
    event Activated()
    {
    	CallASFunction();
    }
    function CallASFunction()
    {
    	MoviePlayer.GetVariableObject(FunctionPath).Invoke(InvokeFunction, args);
    }
    
    event bool IsValidLevelSequenceObject() { return true; }
    
    defaultproperties
    {
        ObjName="Custom Invoke"
        ObjCategory="GFx AS3 Stuff"
        VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Movie Player",bWriteable=false,PropertyName=MoviePlayer)
    }

    Comment


      #3
      How to set FunctionPath?

      Comment


        #4
        can u show me a example about functionpath?I really don't know how to set it. Thank u~

        Comment


          #5
          ye~!I just know how to set root,thank u for this code~

          Comment


            #6
            I wasn't watching this forum. Here, this is if it's in the timeline.

            FunctionPath = "_root";

            Comment

            Working...
            X