Solved

What exactly happens during "Event.ENTER_FRAME"

Posted on 2011-09-21
5
364 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
  • 2
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 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

Industry Leaders: 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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

726 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