6 Replies Latest reply on Jan 21, 2008 3:14 AM by niki tsanov

    help with component

    braulio956
      Greetings All,

      i need help with the script portion of a function. i am calling a function from extendstudio.com component but i am using an on(release) command. since i am unable to use an on(release) command for a component what can i use in place of an on(release) command? For example, a listener? what other options are there?

      Below is script and error.

      function myFunction2() {
      trace("this is FUNCTION2 called by my button")
      on (release) {
      if (_root.link<>page && _root.G<>1) {
      _root.scroller.scroller.gotoAndStop(3);
      _root.G = 1;
      _parent["item"+_root.link].gotoAndPlay("s2");
      _root.link = page;
      _root.Play();
      }
      }
      }


      **Error** Scene=Scene 1, layer=actions, frame=1:Line 8: Mouse events are permitted only for button instances
      on (release) {

      Total ActionScript Errors: 1 Reported Errors: 1

      BL
        • 1. Re: help with component
          niki tsanov Level 1
          So try with this one into timeline.
          Component.onRelease=function(){
          .......
          }
          • 2. Re: help with component
            braulio956 Level 1
            Is this available in flash 8, action script 1 or 2?

            BL
            • 3. Re: help with component
              braulio956 Level 1
              quote:

              Originally posted by: niki tsanov
              So try with this one into timeline.
              Component.onRelease=function(){
              .......
              }


              • 4. Re: help with component
                braulio956 Level 1
                quote:

                Originally posted by: niki tsanov
                So try with this one into timeline.
                Component.onRelease=function(){
                .......
                }


                Great idea. But failed to work. Error goes away but nothing happens when i click contact button. Below is new script with component.on release suggestion.

                Any other ideas? I have also tried the listener option but nothing happens.

                BL
                • 5. Re: help with component
                  braulio956 Level 1
                  quote:

                  Originally posted by: braulio!
                  quote:

                  Originally posted by: niki tsanov
                  So try with this one into timeline.
                  Component.onRelease=function(){
                  .......
                  }


                  Great idea. But failed to work. Error goes away but nothing happens when i click contact button. Below is new script with component.on release suggestion.

                  Any other ideas? I have also tried the listener option but nothing happens.

                  BL

                  Failed to include the scrip with the component.onrelease script. Here it is. Error goes away but nothing happens when i release, click contact button.

                  function myFunction2() {
                  trace("this is FUNCTION2 called by my button")
                  Component.onRelease=function(){
                  _root.scroller.scroller.gotoAndStop(3);
                  _root.G = 1;
                  _parent["item"+_root.link].gotoAndPlay("s2");
                  _root.link = page;
                  _root.Play();
                  }
                  }

                  BL
                  • 6. Re: help with component
                    niki tsanov Level 1
                    Very strange try with onPress or some other function and trace what is the result The other way is with hitTest function here the code try it i think must work but try also with onPress not only onRelease.

                    this.onMouseDown = function() {
                    if (cmd1.hitTest(_xmouse, _ymouse)) {
                    trace("Clicked");
                    }
                    };