4 Replies Latest reply on Oct 12, 2006 6:09 AM by tegnegi

    OnRelease getURL problem

    Wildfire_London
      I just know I will look so lame when the solution to this is pointed out, so my apologies in advance. I am having problems with a script as follows

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

      However when I check the syntax or go to publish I get

      **Error** Symbol=mc_main_pages, layer=Buttons, frame=1:Line 1: Statement must appear within on handler
      invbtn2.onRelease = function(){

      Total ActionScript Errors: 1 Reported Errors: 1

      I know I am a newbie and maybe I have not woken up this morning but for the life of me I can't see the problem.

      Any assistance would be appreciated
        • 1. Re: OnRelease getURL problem
          Ankur Arora Level 1
          this code must be written on frame, where as you might be writting it on some movie clip or symbol.
          • 2. Re: OnRelease getURL problem
            Level 7
            Whenever I use buttons in movies. I just select the button on the stage,
            open the actionscript editor and insert the required action for the button
            into the editor.

            "Wildfire London" <webforumsuser@macromedia.com> wrote in message
            news:egle6r$daj$1@forums.macromedia.com...
            >I just know I will look so lame when the solution to this is pointed out,
            >so my
            > apologies in advance. I am having problems with a script as follows
            >
            > invbtn2.onRelease = function(){
            > getURL(" http://www.google.com", "_blank");
            > };
            >
            > However when I check the syntax or go to publish I get
            >
            > **Error** Symbol=mc_main_pages, layer=Buttons, frame=1:Line 1: Statement
            > must
            > appear within on handler
            > invbtn2.onRelease = function(){
            >
            > Total ActionScript Errors: 1 Reported Errors: 1
            >
            > I know I am a newbie and maybe I have not woken up this morning but for
            > the
            > life of me I can't see the problem.
            >
            > Any assistance would be appreciated
            >


            • 3. OnRelease getURL problem
              ggshow Level 2
              u've attach the code to the wrong place,

              your code below should attach to a keyframe,
              where your button given name invbtn2.
              Select the keyframe, type script below in action panel:

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




              if you want to attach the script to button symbol,
              Select the button, type script below in action panel:

              on(release) {
              getURL(" http://www.google.com", "_blank");
              };
              • 4. Re: OnRelease getURL problem
                tegnegi
                while writting the above syatement u must ve selected sum movieclip on stage or other symbol..Deselect everything n write the same script on frame.. otherwise there is no prob wid d script