Search code examples
flashbuttonactionscript

AS2 Flash button url not working


I have the following actionscript code on my button

on(release){
getURL("http://www.google.com", "_blank");
}

When I click it, nothing happens, no compiler errors. I'm scratching my head here because its just a simple button :(

Thanks.


Solution

  • that event handler has not an object associated with its action. Give that button a name, say *my_button* and in the time line add this action code:

        this.my_button.onRelease = function() {
          getURL("http://www.google.com", "_blank");    
        }
    

    That will solve your problem :)