OK.
First of all try to think like this:
Every class is a black box and all the other classes do not really need to
know what's going on inside.
They have to know what to put into it and what to expect out of it in
return.

If your button is in the Main class it is always available in your whole
app.
But you have to be clean in your way of declarations.
Lets build on the previous example and mail this to eachother so you have a
working example.
OK??
 

-----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

Reply via email to