Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scope Basics

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
I have been running the following code in an attempt to set up an onEnterFrame event handler for the clip1 movie

createEmptyMovieClip("clip1",10);


clip1.onEnterFrame=getInfo();

function getInfo()
{
trace(this)
}

I was hoping to have the text "clip1" returned countless times to the output but instead I get "_level0 " returned only once.

How should I be setting up an onEnterFrame handler for clip1 which runs continuously and where 'this' refers to clip1
 
this.createEmptyMovieClip("clip1",10);

clip1.onEnterFrame=getInfo;

function getInfo()
{
trace(this)
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top