3 Replies Latest reply on Oct 20, 2008 12:12 PM by alan arthur

    Simple onRelease Not Working

    alan arthur
      Long-time programmer, first time writing dynamic ActionScript, so please be patient with me :-)
      Two questions:

      Question1: Can't get onRelease() to fire

      Using Flash 8 Pro
      I'm storing URL links in a text file.
      Loading them using loadVars() is working perfectly.

      However, when I assign the URL to the button using an onRelease event, nothing is happening.
      The button has no other active events (all have been remarked out) and there's no conflicts that I can see.

      "lv_links" is the loadVars() instance

      The offending code:

      var cLink:String = lv_links.link1;
      //cLink==> http://www.aakatz.com

      hiButton1.onRelease = function() {
      trace('calling onRelease'); ==> Never fires!
      getURL(cLink,"_blank");
      }

      the instance name of the button symbol is hiButton1
      Everything is in the same timeline
      Code is in frame 1, button is not defined until frame 200-or-so. Is that an issue?

      Seems pretty basic, but I just can't seem to get it working.
      Any help would be appreciated.

      Question 2:

      Is there any reason why I can't use the cLink var in an on (release) event attached to the object in the timeline?
      That keeps coming up undefined. Scope?

      Thanks so much.