Need solution for Action script 3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alamraman
    New Member
    • Jan 2007
    • 1

    Need solution for Action script 3

    Hi Dear's,

    I need sulotions for this script.

    I am using CS3 Profissional software version 9.

    now i am learning AS3 from flash help, first time i am creating one script is

    myButton.addEve ntListener(Mous eEvent.CLICK, testscript);
    function testscript(even t:MouseEvent)
    {
    trace("My Name is alamraman");
    }

    that button Instance Name is myButton.


    in that Actionscript coming error. any one help me to run the script.

    bye
    Ram
  • maximillion511
    New Member
    • Jul 2008
    • 22

    #2
    what error message are you getting?

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      Shouldn't that be:
      Code:
      myButton.addEventListener("click", testscript);
      Edit:
      Nope, as it turns out they both work fine.
      I tried your code and it worked perfectly.

      Are you sure you have named your button correctly?
      Note that it is not enough to simply name the button in the "Convert to symbol" dialog (F8), you have to click it on the screen and fill out the <Instance name> box.

      Comment

      Working...