A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [F8] dynamic function?

Threaded View

  1. #1
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755

    [F8] dynamic function?

    Im sure how to even ask this one..LOL

    but I want to be able to set a variable (parameter) that holds a function name..

    example:

    I have a parameter for user input (callBackFuntion)

    I want the user to be able to enter in a function name that they created..(example: allDone() is a function the user created.) and when 'callBackFunction' is found in the code..it executes the 'allDone();' function they created and defined as the callBackFuntion variable/function.

    so in this snippet of code:
    Code:
    if (lb>=tb) {
    	trace("alwaysOn3: "+alwaysOn);
    	if (alwaysOn == true) {
    		_visible = false;
    		trace("visible2 (false):"+_visible);
                    callBackFuntion;
    	} else {
    		trace("deleting onEnterFrame code");
    		trace("Back to frame 1");
    		gotoAndStop(1);
                    callBackFuntion;
    	}
    }
    I want the part in BOLD to really be var that passes in the user define function they want to execute in that place..

    (makes sense?)


    how would I go about doing that? make a function the calls that function? or something? LOL

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center