RE: [Flashcoders] Calling Event methods and Other Classes methods.
NO, ofcourse it has to be set to public and static. That’s the way to secure your objects and events being triggered or not -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Omar Fouad Verzonden: zondag 23 maart 2008 20:49 Aan: Flash Coders List Onderwerp: Re: [Flashcoders] Calling Event methods and Other Classes methods. Even if myButton is not static? and even so, if in main myButton.addEventListener(MouseEvent.CLICK, fun); and in other Class Main.myButton. now what? On Sun, Mar 23, 2008 at 3:52 PM, Cor [EMAIL PROTECTED] wrote: I noticed I didn't answer your question. In another class file you can trigger the button like this: Main.myButton.whatever... -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Omar Fouad Verzonden: zondag 23 maart 2008 14:28 Aan: Flash Coders List Onderwerp: [Flashcoders] Calling Event methods and Other Classes methods. look at this. Main FLA Document Class public class Main extends Sprite { public function Main() { myButton.addEventListener(MouseEvent.CLICK, fun) } public function fun(e:MouseEvent):void { trace(Clicked); } } Now supposed I need to call the function fun by some other function or object. How? And If i have another Class, How can i reach this function and call it? Thanks in advance. -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Calling Event methods and Other Classes methods.
I noticed I didn't answer your question. In another class file you can trigger the button like this: Main.myButton.whatever... -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Omar Fouad Verzonden: zondag 23 maart 2008 14:28 Aan: Flash Coders List Onderwerp: [Flashcoders] Calling Event methods and Other Classes methods. look at this. Main FLA Document Class public class Main extends Sprite { public function Main() { myButton.addEventListener(MouseEvent.CLICK, fun) } public function fun(e:MouseEvent):void { trace(Clicked); } } Now supposed I need to call the function fun by some other function or object. How? And If i have another Class, How can i reach this function and call it? Thanks in advance. -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Calling Event methods and Other Classes methods.
Even if myButton is not static? and even so, if in main myButton.addEventListener(MouseEvent.CLICK, fun); and in other Class Main.myButton. now what? On Sun, Mar 23, 2008 at 3:52 PM, Cor [EMAIL PROTECTED] wrote: I noticed I didn't answer your question. In another class file you can trigger the button like this: Main.myButton.whatever... -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Omar Fouad Verzonden: zondag 23 maart 2008 14:28 Aan: Flash Coders List Onderwerp: [Flashcoders] Calling Event methods and Other Classes methods. look at this. Main FLA Document Class public class Main extends Sprite { public function Main() { myButton.addEventListener(MouseEvent.CLICK, fun) } public function fun(e:MouseEvent):void { trace(Clicked); } } Now supposed I need to call the function fun by some other function or object. How? And If i have another Class, How can i reach this function and call it? Thanks in advance. -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 22-3-2008 16:43 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders