Solved

What exactly happens during "Event.ENTER_FRAME"

Posted on 2011-09-21
5
355 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWAY 3d Using BitMapCubeTexture 1 406
need a player that can play .d and .i DVR files 9 1,519
Add 'birds singing' to homepage 5 108
System Center Configuration Manager 2012R2 7 85
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…
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 live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now