RE: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Ryan Potter
You want to post some code?  


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chase
Brammer
Sent: Wednesday, November 08, 2006 10:45 AM
To: Flashcoders mailing list
Subject: [Flashcoders] EventDispatcher and onEnterFrame problems

Hi yall,

I am using EventDispatcher and I can use it everywhere in my class BUT
when I need too!  Which is in a onEnterFrame loop that I am running... I
think that it must be scope problem.  Any idea's on what could be wrong,
or another work around? Thanks.

Cheers,
Chase
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Steven Sacks | BLITZ
Inside an onEnterFrame function you have to use this when referring to
things in the class (if the class extends MovieClip, which I hope it
does because only MovieClips can have onEnterFrame as far as I know).


class MyClass 
{
var foo:Boolean;

function MyClass() 
{
this.onEnterFrame = function() 
{
this.foo = !this.foo;
this.traceFoo();
}
}
function traceFoo() 
{
trace(foo);
}
}
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Mike Keesey
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:flashcoders-
 [EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ
 Sent: Wednesday, November 08, 2006 10:24 AM
 To: Flashcoders mailing list
 Subject: RE: [Flashcoders] EventDispatcher and onEnterFrame
problems
 
 Inside an onEnterFrame function you have to use this when referring
to
 things in the class (if the class extends MovieClip, which I hope it
 does because only MovieClips can have onEnterFrame as far as I know).
 
 
 class MyClass
 {
   var foo:Boolean;
 
   function MyClass()
   {
   this.onEnterFrame = function()
   {
   this.foo = !this.foo;
   this.traceFoo();
   }
   }
   function traceFoo()
   {
   trace(foo);
   }
 }

But you could just write it this way:

class MyClass extends MovieClip {
private var foo:Boolean = false;
public function MyClass() {
}
public function traceFoo() {
trace(foo);
}
private function onEnterFrame():Void {
foo = !foo;
traceFoo();
}
}

Or even like this:

class MyClass extends MovieClip {
private var foo:Boolean = false;
public function MyClass() {
onEnterFrame = toggleAndTraceFoo;
}
public function traceFoo() {
trace(foo);
}
private function toggleAndTraceFoo():Void {
foo = !foo;
traceFoo();
}
}

(Me, I prefer to use an event dispatcher that sends enterFrame events,
but I'll admit that that's often overkill.)
―
Mike Keesey

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Muzak
From a person who keeps posting against the use of 'this' and who says it's 
bad practice I'd expect something better than using 
nested functions, especially if there's no need for it whatsoever.


- Original Message - 
From: Steven Sacks | BLITZ [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, November 08, 2006 7:23 PM
Subject: RE: [Flashcoders] EventDispatcher and onEnterFrame problems


Inside an onEnterFrame function you have to use this when referring to
things in the class (if the class extends MovieClip, which I hope it
does because only MovieClips can have onEnterFrame as far as I know).


class MyClass
{
var foo:Boolean;

function MyClass()
{
this.onEnterFrame = function()
{
this.foo = !this.foo;
this.traceFoo();
}
}
function traceFoo()
{
trace(foo);
}
}


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Steven Sacks | BLITZ
You want to start a fight with me Muzak?  Don't you know I'm loco?


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Muzak
 Sent: Wednesday, November 08, 2006 3:30 PM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] EventDispatcher and 
 onEnterFrame problems
 
 From a person who keeps posting against the use of 'this' 
 and who says 
 it's bad practice I'd expect something better than using
 nested functions, especially if there's no need for it whatsoever.
 
 
 - Original Message -
 From: Steven Sacks | BLITZ [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Wednesday, November 08, 2006 7:23 PM
 Subject: RE: [Flashcoders] EventDispatcher and 
 onEnterFrame problems
 
 
 Inside an onEnterFrame function you have to use this when 
 referring to
 things in the class (if the class extends MovieClip, which I hope it
 does because only MovieClips can have onEnterFrame as far as I know).
 
 
 class MyClass
 {
 var foo:Boolean;
 
 function MyClass()
 {
 this.onEnterFrame = function()
 {
 this.foo = !this.foo;
 this.traceFoo();
 }
 }
 function traceFoo()
 {
 trace(foo);
 }
 }
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] EventDispatcher and onEnterFrame.... problems

2006-11-08 Thread Ray Chuan

I think he is against using this in class definitions.

On 11/9/06, Muzak [EMAIL PROTECTED] wrote:

From a person who keeps posting against the use of 'this' and who says it's 
bad practice I'd expect something better than using
nested functions, especially if there's no need for it whatsoever.


- Original Message -
From: Steven Sacks | BLITZ [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Wednesday, November 08, 2006 7:23 PM
Subject: RE: [Flashcoders] EventDispatcher and onEnterFrame problems


Inside an onEnterFrame function you have to use this when referring to
things in the class (if the class extends MovieClip, which I hope it
does because only MovieClips can have onEnterFrame as far as I know).


class MyClass
{
var foo:Boolean;

function MyClass()
{
this.onEnterFrame = function()
{
this.foo = !this.foo;
this.traceFoo();
}
}
function traceFoo()
{
trace(foo);
}
}


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Cheers,
Ray Chuan
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com