forcing onrelease behavior

  • How do a call a button's on release behavior via actionscript? i.e. without the user pressing the button, I want to call the code that is within the onrelease function of that button.

    I've tried
    button.onRelease;

    and
    button.onRelease();

    but it does not call the function.


  • try using an actual function:

    function pressthebutton(){
    //do something
    }
    button.onPress = function(){
    pressthebutton();
    }
    //then you could later say for example:
    pressthebutton();
    //or
    loadmovieorsomething.onLoad = function(){
    pressthebutton();
    }

    Yes, I'll do this if I can't figure out the direct call to the button's onRelease. Thanks!


  • try using an actual function:

    function pressthebutton(){
    //do something
    }
    button.onPress = function(){
    pressthebutton();
    }
    //then you could later say for example:
    pressthebutton();
    //or
    loadmovieorsomething.onLoad = function(){
    pressthebutton();
    }


  • try using an actual function:
    onRelease is almost always an actual function ;)

    You shouldn't have any problems calling it, post your code :)


  • How have you applied the onRelease on your button? If it's a plain "on(release)" you cannot call it as "button.onRelease". You must have set the eventhandler as a callback like this:


    button.onRelease = function()
    {
    trace("Yeah! You clicked me!")
    }


    /Mirandir


  • button.onRelease(); should work. hmm.. can you post our code? maybe a scope issue.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about forcing onrelease behavior , Please add it free.