Within a class, you're losing scope because you are assigning the onRelease to an anonymous function - i.e. a function that has no name and only exists in the first function. So it's not going to have scope, and this not be able to "see" removeMC(). For Actionscript 2, use Delegate instead:
target_mc.closer_mc.onRelease = mx.utils.Delegate.create(this, removeMC) Jason Merrill Bank of America GT&O Learning & Leadership Development eTools & Multimedia Team >>-----Original Message----- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf >>Of Lee Marshall >>Sent: Friday, September 07, 2007 10:48 AM >>To: [email protected] >>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 = function() >> removeMC(); >> }; >> >> >>Of which contains a removeMovieClip(); >> >> >>Except it doesn't does anybody have any advice on calling >>functions from within a function? >> >>Many thanks >>_______________________________________________ >>[email protected] >>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 >> _______________________________________________ [email protected] 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

