Why does Event.ENTER_FRAME cause this code to stop working? Is there a better alternative?

I programmed the following code so that an array of buttons
can be dragged across the screen when either on :
var buttons:Array=[button1, button2, button3];
for (var i:uint=0; i<buttons.length; i++)
buttons[i].addEventListener(MouseEvent.CLICK, alignButtons )
function alignButtons (e:Event)
     for (var i2:uint=0; i2<buttons.length; i2++)
      if(buttons[i2]!=e.target){buttons[i2].x=e.target.x;}
     for (var i3:uint=0; i3<buttons.length; i3++)
     buttons[i3].addEventListener(MouseEvent.MOUSE_DOWN, buttonDrag);
     function buttonDrag (e:Event)
    e.target.startDrag();
    e.target.addEventListener(MouseEvent.MOUSE_UP, buttonDrop);
    function buttonDrop(e:Event)
          e.target.stopDrag();    
It works pretty much how I'd like it to work, except for the fact that I have to click the mouse to update the screen. However, when I change the first event listener from "MouseEvent.CLICK" to "Event.ENTER_FRAME" the code goes haywire. Is there another event listener I should be using here?

Due to what appears to be an incomplete set of curly braces, it is hard to tell how much nesting you have there, but there should be none.  Each listener and event handler function should be able to stand on its own.  You should not have to put any functions inside a loop.
Having the CLICK event listener is redundant if you have a MOUSE_DOWN and a MOUSE_UP because a MOUSE_DOWN followed by a MOUSE_UP is a CLICK. 
If your goal is to have the buttons all follow each other around x-wise, then what you can do is assign a MOUSE_MOVE event listener at the same time you execute the startDrag and use its event handler for adjust button positions.  When you stopDrag, you also remove the MOUSE_MOVE listener.
As far as why things go haywire when you change to using an ENTER_FRAME, you should show the code when it is in that form so that whatever error is evident.

Similar Messages

  • Why does my line-in audio port quit stop working while recording?

    My set-up is a bit confusing, so I'll try and be very specific.
    I record into Garageband via the following set-up:
    Microphone(s) run into TASCAM 4-track -> RCA-to-Stereo Cable runs out of TASCAM into MacBook Pro via the single audio port.
    This generally works fine for several hours, but the last 3 times I've had a recording session, the audio signal has dropped to virtually nil without any warning. At this point, even yelling into the microphone (with the TASCAM max-ing out) will only produce 1 volume bar in the "Line-In" system preference screen. At best, it sounds like a very quiet whisper.
    My microphone is working (works while recording to tape) as does my cable (RCA - to - Stereo) when used in other situations. Any ideas as to why this is happening? Am I tripping some sort of internal line-in volume...protector? (Is that even a thing?) Or do I need a new audio port?

    funny how to one seems to have an answer for this, I just posted my own issue, audio in line port just stopped working after update.

  • Why does my notebook say set up manager stopped working

    how do i fix set up manager ???

    iSync uses modem AT commands to communicate with the phone for identity purposes. The phone is effectively acting like a modem.
    It does not mean that your Mac is connecting to the internet via your phone, and in fact can't do this unless you set it up to do so.
    During the Bluetooth Setup procedure it would've asked you for Internet connection settings, which presumably you left blank.

  • Why does the speaker in my IPAD 3 stop working intermittently?

    The speakers on my IPAD 3 with the latest operating system sometimes stop wotking, then return later.  Why?

    Try a reset:
    Hold the Sleep and Home button down until you see the Apple logo.

  • Why does the sound to my MacBook Air stop working after it wakes up from sleeping?

    When I leave my headphones in the headphone jack and then close the computer to sleep, when it wakes back up the sound will not work.
    It doesn't work with the headphones in or out, it is just completely disabled. I tried muting and unmuting and and toggling the volume but the only thing that works is restarting the computer.
    Obviously, the sound works after restart but it is an inconvenience due to the tone on restart which is not the greatest noise when trying to work with a sleeping baby in the house (Which is why I use headphones in the first place.)
    Any help is much appreciated.

    Plug in the headphone and remove it
    1. Reset PRAM.  http://support.apple.com/kb/PH4405
    2. Reset SMC.     http://support.apple.com/kb/HT3964
        Choose the method for:
        "Resetting SMC on portables with a battery you should not remove on your own".
    Remove the logitech mouse receiver if you have one.
    Update Boom, Windows Media Player and all other third party plug-ins.

  • Why have the forward, back and refresh buttons stopped working in Firefox 4 Beta 10?

    Upgraded from FF4 Beta 2 to Beta 10. They were working fine in Beta 2.

    This can be a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    The shortcut key sequence to open Panorama (View > Tab Groups) has changed to Shift + Ctrl + E.

  • A problem caused this program to stop interacting with Windows.  Problem signature:   Problem Event Name:     AppHangB1

    I have received the following error message with Adobe Acrobat Pro XI when working with Portfolio Files. I am operating Windows 7 Professional.
    Has anyone found a fix for this issue?
    Description:
      A problem caused this program to stop interacting with Windows.
    Problem signature:
      Problem Event Name: AppHangB1
      Application Name: Acrobat.exe
      Application Version: 11.0.10.32
      Application Timestamp: 547e97af
      Hang Signature: 8dc7
      Hang Type: 0
      OS Version: 6.1.7601.2.1.0.256.48
      Locale ID: 1033
      Additional Hang Signature 1: 8dc7ed9d7ff41b8cc5ee35b7294b45e9
      Additional Hang Signature 2: e6d0
      Additional Hang Signature 3: e6d001594873a6b1363ccd82616a4edf
      Additional Hang Signature 4: 8dc7
      Additional Hang Signature 5: 8dc7ed9d7ff41b8cc5ee35b7294b45e9
      Additional Hang Signature 6: e6d0
      Additional Hang Signature 7: e6d001594873a6b1363ccd82616a4edf
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt
    Please help
    John Sorkin [email protected]

    jamodi
    What computer operating system is your Premiere Elements 12 installed?
    How far into the opening of the program do you get? Do you get to the Expert or Quick workspaces?
    And, if so, how long can you stay there? What are you doing when you get this message, opening a new project
    or opening an existing one that has been saved/closed or just trying to launch the program from the desktop icon.
    Are you running the program Run As Administrator and from a User Account with Administrative Privileges?
    Do you have the McAfee antivirus program? Do you have the latest version of QuickTime installed on your computer
    with Premiere Elements 12?
    What video card/graphics card does your computer use? Have you verified at the web site of the manufacturer of the
    card that the video card/graphics card driver is up to date?
    If you do not know, check the Device Manager/Display
    Adapters to determine if you have 1 or 2 cards.
    Depending on your answers, the next step will be
    Uninstall the program the usual Control Panel way.
    (If you can get into the program long enough to go to Help Menu/Sign Out, please do that to deactivate the program
    before going to the uninstall in Control Panel area.)
    Do a run through with ccleaner (both the regular cleaner and registry cleaner parts) to get rid of leftovers from
    incomplete uninstalls and reinstalls.
    https://www.piriform.com/ccleaner
    Reinstall the program with the antivirus and firewalls disabled.
    (If you have McAfee as the antivirus, that may be problem, and we can take care of that without having to go
    through this uninstall/ccleaner/reinstall.)
    Let us start here and then decide what next.
    Thank you.
    ATR

  • Why Does 3D Reposse cause crashes and work so slow?

    Why Does 3D Reposse cause crashes and work so slow?   I get the pinwheel of death when I use this feature.  It works at a snails pace.  I liked the 3D Type effects in iIllustrator.  Why couldn't Adobe have added all the Reposse features to Illustrator instead of craming all these new features into Photoshop?
    They're worthless if the program needs an hour to process every selection.

    What are your OS specs, your Video Card and your Preferences > Performance settings?
    Why Does 3D Reposse cause crashes and work so slow?
    My guess would be because it has to create a whole bunch of polygons and your computer-set-up may be insufficient for the task.

  • Why does iTunes Match cause iTunes to crash ?

    Why does iTunes Match cause iTunes to crash ?

    My problem is similar.  It began right after I allowed an Adobe update to run.  (Adobe Flash Player version 10.0.45.2 is recorded in my Registry.) Now every single website I try to open triggers a window (see below) and repeats many times.
    It makes no difference whether I "Allow" or not.  I think it runs this window for every flash object on that website.  It is occurring while I enter this post!
    It makes using the Internet MOST challenging.  Surely this is causing major problems for everyone.
    I have IE8 on Windows Vista.
    Here's the text from the message:
    "A website wants to open web content using this program on your computer.
    This program will open outside of Protected Mode. Internet Explorer's Protected Mode helps protect your computer. If you do not trust this website, do not open this program.
    Name:  Adobe Flash Player
    Publisher: Adobe Systems Incorporated
    (Checkbox) Do not show me the warning for this program again.
    buttons:  Allow         Do Not Allow"
    Should I appeal to Microsoft or Adobe for a solution?  Is is possible to install the previous version?
    Thanks for any wisdom.

  • Why  will photoshop not open after loading it to new iMac computer from an external hard drive and I get this message: Licensing for this product has stopped working:error code: 150:30

    Why will Photoshop CS4 not open after loading to new iMac from an external hard drive and I get this message: Licensing for this product has stopped working:error code: 150:30

    A Photoshop installation is tied to the machine it was installed on. Moving it to or from a hard drive breaks the licensing.
    The answer is easy: Reinstall CS4 from your disc. and apply all updates.
    Gene

  • Why does the Safari message "This is a non-secure form" pop up everytime I try to use yahoo mail?

    Why does the Safari message "This is a non-secure form" pop everytime I go into yahoo mail?  If I don't press the send option my whole computer freezes.

    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.

  • Description: A problem caused this program to stop interacting with Windows. Problem signature: Problem Event Name: AppHangB1 Application Name: firefox.exe Application Version: 1.9.2.3855 Application Timestamp: 4c48d5ce Hang Signature: 9962

    I am having this problem, in the first window when I try to do anything.
    Description:
    A problem caused this program to stop interacting with Windows.
    Problem signature:
    Problem Event Name: AppHangB1
    Application Name: firefox.exe
    Application Version: 1.9.2.3855
    Application Timestamp: 4c48d5ce
    Hang Signature: 9962
    Hang Type: 0
    OS Version: 6.0.6002.2.2.0.768.3
    Locale ID: 1033
    Additional Hang Signature 1: 5df72ce88195c0212c542e9c8c172716
    Additional Hang Signature 2: 2b94
    Additional Hang Signature 3: 9acafbb8ad01bf9d2eb258d8fddad3ca
    Additional Hang Signature 4: 9962
    Additional Hang Signature 5: 5df72ce88195c0212c542e9c8c172716
    Additional Hang Signature 6: 2b94
    Additional Hang Signature 7: 9acafbb8ad01bf9d2eb258d8fddad3ca
    == This happened ==
    Every time Firefox opened
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    I suspect a RAM or hardware problem.

  • When I try to launch my copy of PSE it tells me that licensing for this product has stopped working. Error code 150:30. Restarting does nothing. Thanks!

    When I try to launch my copy of PSE it tells me that licensing for this product has stopped working. Error code 150:30. Restarting does nothing. Any ideas?
    Thanks!

    You haven't said what version of PSE you are using but the general solution to this problem is to re-install the product from your original disks.  Have you got the disks for your product and the related serial number?

  • Why does Safari ask me this every time I open my Macbook?  "NONE OF YOUR PREFERRED NETWORKS ARE AVAILABLE.  CHOOSE THE WI-FE NETWORK YOU WANT TO JOIN FROM THE LIST BELOW. "

    Why does Safari ask me this every time I open my Macbook?  "NONE OF YOUR PREFERRED NETWORKS ARE AVAILABLE.  CHOOSE THE WI-FI NETWORK YOU WANT TO JOIN FROM THE LIST BELOW. "

    Open System Preferences > Netwwork then click Advanced then select the Wi-Fi tab.
    Under Preferred Networks, if you see more than one network name listed, click and drag yours to the top then click OK.
    Quit and relaunch Safari.

  • I keep having this problem " A problem caused this program to stop interacting with Windows., Problem Event Name: AppHangB1". Even I uninstall or reinstall, the problem still persists! Anyone can help!?

    Description:
    A problem caused this program to stop interacting with Windows.
    Problem signature:
    Problem Event Name: AppHangB1
    Application Name: firefox.exe
    Application Version: 1.9.2.3951
    Application Timestamp: 4cc7ae16
    Hang Signature: baf1
    Hang Type: 0
    OS Version: 6.0.6002.2.2.0.256.6
    Locale ID: 18441
    Additional Hang Signature 1: 897ae6b831cea2d1f02b14199c9f3e81
    Additional Hang Signature 2: 6fd0
    Additional Hang Signature 3: b3b3b2452eec1eff2c85f2da7046f02c
    Additional Hang Signature 4: baf1
    Additional Hang Signature 5: 897ae6b831cea2d1f02b14199c9f3e81
    Additional Hang Signature 6: 6fd0
    Additional Hang Signature 7: b3b3b2452eec1eff2c85f2da7046f02c

    I suspect a RAM or hardware problem.

Maybe you are looking for

  • ?!?! See who can figure this one out first...

    ok, so this has been happening on and off for the past 3 months, just curious if anyone else has had this happen as well. so im working in Logic (this happened in 7 and now 8 as well) and i get done with my session and im going to close logic for a b

  • PO RESPONSE WORK FLOW - SRM SUS

    Dear friends We are confirming PO items from SUS , The XMl message generated fails in ebp with following error - Exception occurredE:BBP_WFL:012 -No approval workflow found. Inform system administrator We have activated event linakges for following w

  • Mandatory data selection field in infopackage

    Hello together, Do you know how to mark as mandatory one filed from data selection tab in the infopackage? I would like the load not to start if the field is not filed. Thank you, Iuliana

  • 24P advanced converted to 30P

    I've been shooting a bunch of material in 30P, but, by mistake, shot some yesterday in 24P advanced mode. How do you convert the 24Pa material to be compatible with the 30P material. Thank you!

  • Multiple COM devices freeze LV

    I'm pretty sure this is not a Labview issue, but in case someone else has had a similar problem. I am trying to run 8 Serial devices (linear traverses) using VISA calls in LV 7.1.  Each device has a USB to RS422 converter that gives an individual COM