Why my code can't stop?

I draw a graphics and convert it into moveclip named flat,then I put it into stage and write following code,
var i=0;
function onEnterFrame(e:Event):void{
if(i>3){
  plat.removeEventListener(Event.ENTER_FRAME,onEnterFrame);
i++;
plat.x=Math.random()*3;
plat.y=Math.random()*3;
plat.addEventListener(Event.ENTER_FRAME,onEnterFrame);
My idea is this moveclip shake three times and then stop. But when I run above code,I find the moveclip is shaking all the time! Why? How to stop this moveclip?
I try to define var i as follows:
private var i:int=0;
But it raise error:
1013:private attribute is only apply to class attribute definition.
I  know actionscript3 cure code programing,but I don't familiar with actionscript3 under Flash CS4 IDE, I am feeling frustration.
Thanks

Except for naming your function onEnterFrame (an AS2 term), the code works okay.

Similar Messages

  • When importing raw photos from Nikon D90 aperture seems to automatically adjust exposure darker. why? How can I stop this?

    When importing raw photos from Nikon D90 aperture seems to automatically adjust exposure darker. why? How can I stop this?

    This is typical of the default NEF RAW conversion of Aperture and the best thing you can do is set up a few presets to apply to all of your RAW images to get a tone curve and colors that is pleasing to you as a default. The in camera JPEGs / embedded JPEGs (that you first see during import) are treated to the Nikon "Picture Control" settings that are set on the camera - the RAW's as interpreted by Aperture are not.
    I have written extensively and even have a few downloadable presets on my site - look for NEF...
    http://photo.rwboyer.com/
    RB

  • When I set my screen saver to iLibrary it defaults to national geographic,why and how can I stop it

    when I set my screen saver to iLibrary it defaults to national geographic,why and how can I stop it

    Back up all data. Quit System Preferences if it's running.
    Triple-click anywhere in the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination command-C:
    ~/Library/Preferences/ByHost
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar. Paste into the box that opens (command-V), then press return. A folder named "ByHost" should open. Look inside it for a file with a long name that begins "com.apple.screensaver". There may be several such files. Move them all to the Trash.
    Log out or restart the computer. Test. If the problem is resolved, empty the Trash and recreate your settings in the Screen Saver tab.

  • I've installed Version 5, but at least once a day I keep getting notices to update to Version 3.1.11. Why? How can I stop these?

    I installed Version 4, and then Version 5, and now at least once a day I get a notice to update to Version 3.1.11. I get this on my office computer and also at home. Why is this happening and how can I stop it?

    I had to wait until it happened again, but it finally did, and I solved the problem. Boy was I stupid! It wasn't a plugin, it was ''Thunderbird'' 3.1.11. And I never noticed! Thank you all

  • Sometimes as i move my finger on the trackpad it highlights.Why and how can I stopped it from happening again. (Macpro )

    Hi just bought a macpro 15". Sometimes as I browse and hardly touch the trackpad it highlights. How can I stop it from doing it. It is very annoying.
    Thanks

    Try the 'real' MacBook Pro users forum!
    http://www.apple.com/support/macbookpro

  • Youtube won't let me type in comment box below video, and keeps affecting the video when I hit keys. why and how can I stop it from doing that?

    It seems whenever I use YouTube with Firefox, the YouTube video will only ever let me interact with it unless I go full screen then hit escape. if i don't, I can't type in the text box below the video. even stranger, if I go to a new tab and try to enter something into, say, Google, I can still pause and un-pause the you tube video, even in the other tab, just by trying to type in a text box. Why is this happened, and how can I make it stop? it is starting to get very disruptive.

    Recent crashes of certain multimedia contents (this includes Youtube videos, certain flash games and other applications) in conjunction with Firefox 14 are most probably caused by a recent Flash 11.3 update and/or a malfunctioning Real Player browser plugin.
    In order to remedy the problem, please perform the steps mentioned in these Knowledge Base articles:
    [[Flash Plugin - Keep it up to date and troubleshoot problems]]
    [[Flash 11.3 crashes]]
    [[Flash 11.3 doesn't load video in Firefox]]
    Other, more technical information about these issues can be found under these Links:
    http://forums.adobe.com/thread/1018071?tstart=0
    http://blogs.adobe.com/asset/2012/06/inside-flash-player-protected-mode-for-firefox.html
    More, I would suggest creating a new Firefox profile for sanity [1]
    Please tell us if this helped!
    [1] http://kb.mozillazine.org/Profile_Manager

  • HT3228 IPad 2.   All past months Calendar info disappeared?  From March back?  Why and how can I stop that? Can I get it back?  It is still on my Iphone

    IPad 2
    All past months Calendar info disappeared from March back?  Why and can I get it back?  April and future months info is still there

    Go to "Settings > Mail, Contacts, Calendars > Sync" and set this to "All Events".

  • I updated my contacts on icloud and then when i went back in everything i deleted or changed was back, why and how can I stop it?

    We have 3 phones and 2 ipads that sync to the same icloud.

    Yes, it should work, but to be on the safe site, just start with a new backup in iTunes first.

  • Safari bookmarks every page I visit. Why does it do this? How can I stop it?

    Safari bookmarks every web site I visit. Why? How can I stop it doing this?

    The first thing I would try is to go to Safari preferences and click on the Bookmarks icon. If any items are checked then un-check them and see what happens.

  • Sat L450D - Speaker can't stop alarm sound after i pull out mic & headphone

    Today, I try my headphone in the first time.
    Any expert here can tell me why my speaker can't stop the alarm (VIVIVIVI sound), after i pull out my mircophone and headphone?
    The sound will stop by itself when I put my microphone back!
    How to stop that alarm?

    *Paupau,*
    *Thank you very much for your information and instruction.*
    *After adjusted microphone boost and set to 10.0dB, the problem solved. But the microphone have to set to max., otherwise I cant hear my own voice when I test the chat engine through one of my chat gear.*
    *Meanwhile, I would like to ask, are there any difference between 10.0 dB and 0 dB. if positive, why you suggest me the setting to 0.*
    *Finally, buddy you solved my problem which even the toshiba support team cannot, " there answer are REINSATLL, REINSTALL THEN REINSTALL AGAIN AND AGAIN" no matter what you asked!;\*

  • When I delete domething on Mac Mail it automatically deletes it on my Yahoo server.  Why and how can I get it left on the server?

    When I delete something on Mac Mail it automatically is deleted on the Yahoo server.  Why and how can I stop this happening and leave it on the server?

    I believe that that is how IMAP accounts are designed to work, if you delete an email from a computer or device then it will be deleted from the server. If possible you could try setting up the account as a POP account in the Mail program and you should then get a 'remove copy from server' tickbox (which will need to be unticked) on the account's Advanced tab in Mail > Preferences.
    I've asked for this post to be moved to the Mountain Lion forum, this is the iPad forum.

  • How can i stop user to get the same screen while entering same T code

    hi experts,
    how can i stop user to get the same screen while entering same T code (_Means i want user enter same t code but got different different screen how it is possible.)_
    i want to know how can we set a authorization is such a manner ...
    Through different different login id user got different different screen while entering same T-code.
    for example if there is two functional login id mum & noida...
    then user login through that and
    enter any same functional tcode (for getting purchase order)
    but get different different window...so how come it is possible.....
    plz explain in brief
    thanks in advance...plz do reply as soon as possible

    For a custom transaction this is easy, you need to ask your developers to be able to direct users to different screens based on the results of an authorisation check.  You could have an auth field e.g. ZSCREEN which is checked in the program & decides what screen the user has access to.
    For standard transactions, unless already coded, I would forget it & do what is recommended by Subramaniam and create transaction variants as required.  Assign each variant to a custom t-code and users access it that way.
    What I am interested is is why do you want to do this?

  • How can I stop Dreamweaver spoiling my code layout?

    For example, if I have:
    <div class="Something">
    <some other stuff>
    </div>
    Then if I save the file and close and reopen it again, I
    sometimes find
    Dreamweaver has changed it to:
    <div class="Something">
    <some other stuff></div>
    Which IMO is far less readable.
    Also, if I paste the following nicely formatted code from one
    document to
    another:
    <p class="whatever">
    Some text
    </p>
    <p class="whatever">
    Some text
    </p>
    Then if I paste it into another document and save,
    Dreamweaver sometimes
    changes it to:
    <p class="whatever">Some text</p>
    <p class="whatever">Some text</p>
    Which again, if there's a lot of text, I find far less
    readable.
    How can I stop it from interfering with my code in this way?
    I looked under
    Preferences, but couldn't see any obvious setting.
    Dave

    That's very helpful, thanks - but what does it mean by
    "Formatted but not
    indented" and "Not Formatted"? They both look identical in
    the preview
    window.
    The other problem is that I don't use consistent rules - or
    rather, I do,
    but my rules are far more complicated and context sensitive
    than the
    Dreamweaver ones. For instance, in general, I have two line
    breaks after a
    </p> tag, but not always - and in any case,
    Dreamweaver's rules don't
    appear to allow for two line breaks before or after any tag.
    Dave
    "slinkmaster" <[email protected]> wrote in
    message
    news:g09o6t$kr9$[email protected]..
    | I've run into it a few times, never could figure out why it
    did it when I
    | saved. But to correct the formatting so that it is more
    readable for you.
    Go to
    | Edit -> Preferences -> Code Format. Click on the "Tag
    Libraries..."
    button.
    | Locate the tags in the list that you want to edit the
    formatting for and
    make
    | it look how you want.
    |

  • HT5361 Why is that when I am composing a new message do I end up with multiple versions of my message I am composing up in my Google Trash mailbox?  How can I stop this from happening?

    Why is that when I am composing a new message do I end up with multiple versions of my message I am composing up in my Google Trash mailbox?  How can I stop this from happening?

    It was very hard to see what the box says because the message displays for less than one second. However, I was able to record it with my iphone and pause it until I got a shot of the message. The box says the following:
    "Do you want the application “java” to accept incoming network connections?
    Clicking deny may limit the application’s behavior. This setting can be changed in the Firewall pane of Security preferences."
    I did make some changes. I will see if it works.
    Thank you!!!

  • Doing a 30 minute video created 15 Gigabyte of Internet usage. Why? And how can I stop this!

    Created a small, simple 30 minute video. Burned a few CDs. Downloaded one (1) sound track (a few MB). Internet usage soared to an unbelievable 15 GB!
    All data, files, etc on my PC, yet Premiere Elements used the Internet constantly, especially when burning CDs.
    Why? There was nothing to upload or download (except 1 sound track). This maxed my Internet allowance, and has cost me a lot of cash for extra capacity.
    How can I stop this data gluttony.
    Or do I have to junk a new, expensive program? (Premiere Elements 13.

    Contacted support.
    They say that this is 'impossible'!!!
    Went for Option 2. Accept one-time waste of Internet capacity. Write it off to painful experience. Junked Premiere Elements 13.
    Problem solved.

Maybe you are looking for