?
Solved

What exactly happens during "Event.ENTER_FRAME"

Posted on 2011-09-21
5
Medium Priority
?
382 Views
Last Modified: 2013-11-11
Hi, I've been learning a lot during the past few weeks and am trying to really understand what is actually happening in my FLAs, rather than just learning to parrot a bunch of code to make something work.

My question is regarding the "Event.ENTER_FRAME" event. -- What exactly is happening when this event fires?

What is entering which frame? I assume my object, but what frame is it entering?

Does this event fire on each frame, continuously over and over again throughout the life of the MovieClip, or does it stop at some point?

As you can see, I'm a bit hazy on what is actually happening with "Event.ENTER_FRAME", so your help explaining it will certainly be welcome.

(I've added the code I'm referring to below)

Thanks,
Fulano
stage.addEventListener(Event.ENTER_FRAME, onEnter);

private function onEnter(event:Event):void
    {
	do something...
    }

Open in new window

0
Comment
Question by:Mr_Fulano
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 2000 total points
ID: 36578689
Hi, if you place the code in a keyframe on the timeline it will trigger then and keep triggering on every frame.

if you instantiate it in code, ass soon as you use the addEventListener it will trigger and continue triggering until you explicitly remove the event listener  using the removeEventListener.

0
 
LVL 29

Expert Comment

by:dgofman
ID: 36578736
blue-genie:

That behavior in AS3 in AS2 and AS1 you will get onEnterFrame by default until you will not call stop() in your AcrtionScript
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 36579919
@dgofman - not sure what you're saying - "that what i  said is specific to AS3?"  Yeah i'm assuming the asker is referring to AS3 based on the code snippet format.
0
 

Author Comment

by:Mr_Fulano
ID: 36581136
Yes, I'm using AS3.
0
 

Author Closing Comment

by:Mr_Fulano
ID: 36802418
Thank you very much!!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses
Course of the Month8 days, 1 hour left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question