A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Keyboard events

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    29

    Keyboard events

    When I am writing AS3 for a keyboard event, do I have to use "stage.addEventListener" or can I use "InstanceName.addEventListener"?

    My problem is, I have a drop down menu which is used at different points on the timeline. I converted all of the drop down menus into separate movie files, and not just separate instances of the same movie file. Inside the movie files, I have written actionscript for keyboard events. However, I keep getting the error message "Duplicate Function." They are separate movies! Shouldn't Flash be able to tell the difference between them?

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    You should add the event listener to the stage.

    If you're receiving that error that's because you have a function defined in the same scope, at least twice.
    Having functions with the same name on different timelines isn't a problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center