[Flashcoders] Function call from a function

2007-09-07 Thread Lee Marshall
I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2 removes the movieclip I have a button setup in function 1 that reads like this: target_mc.closer_mc.onRelease = function() removeMC(); };

Re: [Flashcoders] Function call from a function

2007-09-07 Thread Helmut Granda
you have scope issues, the function never gets called because the MovieClip cant see it. target_mc.closer_mc.onRelease = function() _parent.removeMC(); }; or if you are in AS2 you can also use Delegate target_mc.closer_mc.onRelease =

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Hal Leonard
To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Function call from a function I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2 removes the movieclip I have a button setup in function 1 that reads like this: target_mc.closer_mc.onRelease

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Geoff Bower
PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Lee Marshall Sent: 07 September 2007 15:48 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Function call from a function I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2

Re: [Flashcoders] Function call from a function

2007-09-07 Thread eric e. dolecki
can we see all the code? probably a scoping issue. On 9/7/07, Lee Marshall [EMAIL PROTECTED] wrote: I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2 removes the movieclip I have a button setup in function 1 that reads like this:

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
, 2007 10:48 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Function call from a function I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2 removes the movieclip I have a button setup in function 1 that reads like

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
Function function1() { target_mc.closer_mc.classRef = this; target_mc.closer_mc.onRelease = function() this.classRef.removeMC(); }; } That's how I used to do it before I discovered Delegate. I wouldn't

Re: [Flashcoders] Function call from a function

2007-09-07 Thread Andy Herrman
You're having scope issues. When the onRelease function is called its scope is the movie clip (closer_mc), not the class. Try this: At the top of your class' file: import mx.utils.Delegate; Then define the onRelease function this way: target_mc.closer_mc.onRelease = Delegate.create(this,

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Lee Marshall
Still not working... I think it is a scoping issue. Here's my code (Excuse the bloat, I am very much learning!) import flash.filters.DropShadowFilter; import mx.utils.Delegate; class PopupIll { //Initialise variables public static var t:MovieClip; public static var

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
Still not working... I think it is a scoping issue. Yup. You're still using anonymous functions: swfListen.onLoadInit = function(target_mc:MovieClip):Void { Those don't fly in AS2 classes very well. You can use them once, but anything within them will have only the scope of the specific

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Hal Leonard
code in one place instead of on the individual clips. So that's something. Hal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lee Marshall Sent: Friday, September 07, 2007 10:24 AM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] Function

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Paul Venton
target_mc.closer_mc.onRelease = Delegate.create(this, getPopHolder); -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lee Marshall Sent: 07 September 2007 18:24 To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] Function call from

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
Should be something more like this. target_mc.closer_mc.addEventListener(onRelease, Delegate.create(this, getPopHolder)); Or, I would just do this instead: target_mc.closer_mc.onRelease = Delegate.create(this, getPopHolder); (Then of course in AS3 you do:

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Lee Marshall
Sorry is this an advanced forum? From: [EMAIL PROTECTED] on behalf of Helmut Granda Sent: Fri 07/09/2007 16:14 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Function call from a function you have scope issues, the function never gets called

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Hal Leonard
: [Flashcoders] Function call from a function Should be something more like this. target_mc.closer_mc.addEventListener(onRelease, Delegate.create(this, getPopHolder)); Or, I would just do this instead: target_mc.closer_mc.onRelease = Delegate.create(this, getPopHolder); (Then of course in AS3 you do

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
: [Flashcoders] Function call from a function Sorry is this an advanced forum? From: [EMAIL PROTECTED] on behalf of Helmut Granda Sent: Fri 07/09/2007 16:14 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Function call from a function you have scope

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Merrill, Jason
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hal Leonard Sent: Friday, September 07, 2007 3:53 PM To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] Function call from a function Jason - Is there any reason for not using the event Listener? Just curious

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Kerry Thompson
Lee Marshall wrote: Sorry is this an advanced forum? Pretty much, yes. Flashnewbie is a better forum when you're just coming up to speed. Not that we don't want you here--it's just that we usually discuss more esoteric issues. Newbie sounds like it's really just very basic, but there are some

Re: [Flashcoders] Function call from a function

2007-09-07 Thread Troy Rollins
On Sep 7, 2007, at 4:32 PM, Kerry Thompson wrote: I never felt out of place, and, once I felt I had a good enough handle on Flash's way of doing things, I signed up for Flashcoders. Liar. ;-) You went the other way. We kicked you up to FlashCoders. -- Troy RPSystems, Ltd.

RE: [Flashcoders] Function call from a function

2007-09-07 Thread Kerry Thompson
Troy Rollins wrote: Liar. ;-) You went the other way. We kicked you up to FlashCoders. There's a fair amount of truth in that. As I progressed (slowly, very slowly), I finally reached a point where my questions were too advanced for Newbie. Troy did, indeed, suggest that Flashcoders would