5 Replies Latest reply on Jan 22, 2007 12:49 PM by Shandy Elliott

    onEnterFrame vs onMouseMove

    dameer

      Hi to all!
      Maybe somebody could answer my question...
      I am currently working on sort of a parallax effect. There are at least 15 objects (movieclips) on the Stage, each using its own onEnterFrame event as a constant _x position refresher. Everything works fine but there might be much more objects added in the future, all of them using its own onEnterFrame again.
      When thinking about a little bit more, there could happen an fps slowdown very soon because of onEnterFrame "intensive" usage, right?
      So I made a new script that uses onMouseMove and mouseListener combined with mx.transitions.easing. And again - it works fine.

      I am not so familiar with Flash Player rendering engine and my question, considering performance, would be:
      Which choice would give the best results?

      Thanx!
        • 1. Re: onEnterFrame vs onMouseMove
          Shandy Elliott Level 1
          The best choice would be to have one onEnterFrame that controls all the movie clips on some kind of press or release.
          • 2. Re: onEnterFrame vs onMouseMove
            dameer Level 1
            That's the case when using onMouseMove with mouseListener! There is no option by using press or release because the position of all movieClips in parallax depend on mouse position and thus movieClip's positions are changed repeatedly...
            However, maybe the next question would be whether to use one single onEnterFrame event or onMouseMove? I wanted to know how these two different events are using FPlayer's resources!

            Thanx!
            • 3. Re: onEnterFrame vs onMouseMove
              Shandy Elliott Level 1
              What the heck is a parallax effect? I wasn't talking about using an event listener. I was talking about having only one onEnterFrame that contains the code for each movie clip. I think if you use onMouseMove, it will affect ALL the clips. I don't know exactly what you are doing, so I can't be more precise about my advise, but having 15+ onEnterFrames is CPU murder. Can you post a fla?
              • 4. Re: onEnterFrame vs onMouseMove
                dameer Level 1
                C'mon man, you could at least READ what was written and THEN reply. I am not about to explain what is a parallax, nor I am exclusively asking YOUR help. I need simple advise from someone who has a clue what I am talking about. Source code is irrelevant in this topic, this is supposed to be a technical question and the parallax is the matter of education.
                • 5. Re: onEnterFrame vs onMouseMove
                  Shandy Elliott Level 1
                  I DID read your topic before I replied (doesn't seem as if anyone else is trying to help you) - and with the attitude on your last reply, good luck in the future.

                  The main question was about using 15 onEnterFrames and... well you know what.. I'm not going to waste my time on this topic anymore..