Its quite hard to figure out the problem without more code, but it
sounds like a scope issue.
Try assigning a reference to the class on the button:
//DOESN'T WORK
Class myClass
{
Function function1()
{
target_mc.closer_mc.onRelease = function()
removeMC();
};
}
Function removeMC()
{
}
}
//MIGHT WORK BETTER
Class myClass
{
Function function1()
{
target_mc.closer_mc.classRef = this;
target_mc.closer_mc.onRelease = function()
this.classRef.removeMC();
};
}
Function removeMC()
{
}
}
Haven't tested it so don't shoot me down if it doesn't work.
If it doesn't work then I recommend sending the whole class to the list,
or at least the relevant bits of code.
G:-)
Geoff Bower
Developer
MotivatEd
web: www.MotivatEd.ltd.uk
email: [EMAIL PROTECTED]
switch: +44 (0)1223 265 624
mobile: +44 (0)7971 627 687
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Lee Marshall
> Sent: 07 September 2007 15:48
> 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