[Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-21 Thread Steve Abaffy
Hello, I basically have the follow: Function DrawMyStuffOnScreen():void{ Var myMovieClip:MovieClip = new DefinedMovieClip(); Var myButton:SimpleButton = new DefinedButton(); myButton.addEventListener(MouseEvent.CLICK,DoSomething); //Define

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-21 Thread Ross Sclafani
read up on event.target. On Apr 21, 2011, at 9:44 PM, Steve Abaffy wrote: > Hello, > > > > I basically have the follow: > > > > Function DrawMyStuffOnScreen():void{ > >Var myMovieClip:MovieClip = new DefinedMovieClip(); > >Var myButton:SimpleButton = new D

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-21 Thread Gerry
Steve, You have some things confused. Like Ross said, read up on event.target. Your code should look something like this... Var myMovieClip:MovieClip; Var myButton:SimpleButton; DrawMyStuffOnScreen(); Function DrawMyStuffOnScreen():void{ myMovieClip = new DefinedMovieClip();

RE: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-21 Thread Steve Abaffy
List Subject: Re: [Flashcoders] How to access MovieClip declared in one function in an event listener Steve, You have some things confused. Like Ross said, read up on event.target. Your code should look something like this... Var myMovieClip:MovieClip; Var myButton:SimpleButton

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-21 Thread Deepanjan Das
Thursday, April 21, 2011 9:28 PM > To: Flash Coders List > Subject: Re: [Flashcoders] How to access MovieClip declared in one function > in an event listener > > Steve, > > You have some things confused. Like Ross said, read up on event.target. > > Your code should look s

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Gerry
1 9:28 PM > To: Flash Coders List > Subject: Re: [Flashcoders] How to access MovieClip declared in one function > in an event listener > > Steve, > > You have some things confused. Like Ross said, read up on event.target. > > Your code should look something like this... &g

RE: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Steve Abaffy
fig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gerry Sent: Friday, April 22, 2011 6:15 AM To: Flash Coders List Subject: Re: [Flashcoders] How to access MovieClip declared in one function in an event listener "There is more than one way to skin a cat" - crazy expression but y

Re: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Gerry
ingly as possible. I have written thousands of lines of > code in my 30+ years as a programmer and probably only used global variables > once or twice before OOPs programming became the rage. > > > -----Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com > [mailt

RE: [Flashcoders] How to access MovieClip declared in one function in an event listener

2011-04-22 Thread Merrill, Jason
>>The only example that seems to work is to make the movieClip a global >>variable, >>which seems to me to violate everything I have ever been taught about >>programming. >>Which is to say that one should use global variables as sparingly as >>possible. >>I have written thousands of lines of