Results 1 to 2 of 2
  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    186

    Default Function Delegates: Error #1037

    So im trying to use delegates for my functions in AS3/Scaleform4. I did this all the time in AS2/Scaleform3

    Code:
    public function setup()
    {
    	// Actionscript delegates
    	SetupASRequestSomeDelegate(none);
    	SetupASRequestSomeDelegate(RequestSome);
    	(...)
    }
    
    (...)
    
    /**************************
     * The watch delegate
     * 
     **************************/
    delegate RequestSomeDelegate();
    public  function RequestSome()
    {
    	(...)
    }
    
    (...)
    
    ///////////////////////////////////////////////////////////
    // Delegate registry
    ///////////////////////////////////////////////////////////
    public function SetupASRequestSomeDelegate( delegate<RequestSomeDelegate> _delagate)
    {
    	ActionScriptSetFunction("RequestSome");
    }
    In actionscript
    Code:
     ...
     button.addEventListener(MouseEvent.CLICK, RequestSome);
    ...
    
    public function RequestSome() :void
    {
        trace( "Request Some Delegate, should never see at runtime!");
    }
    I believe this should work, however im getting the following cryptic error when I try and do an ActionScriptSetFunction
    Code:
    DevGFxUI: ReferenceError: Error #1037
    If I click on my 'button' object, I get the "should never see at runtime" message. Anyone have a clue?

  2. #2

    Default

    According to http://forums.epicgames.com/threads/...iptSetFunction you don't provide the actual function definition in actionscript at all, you just call it. You'll get an compiler error in flash pro (something about possibly undefined function call) but it's supposed to build the swf correctly nonetheless.


 

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.