I learn AS3 .0 for 2 days and I have 1 little problem.
stopBtn.addEventListener(MouseEvent.CLICK, onStopClick, false, 0, true);
I don’t understand why we need false, 0, true at end? What that do? Thanks and sorry for stupidity.
I learn AS3 .0 for 2 days and I have 1 little problem.
stopBtn.addEventListener(MouseEvent.CLICK, onStopClick, false, 0, true);
I don’t understand why we need false, 0, true at end? What that do? Thanks and sorry for stupidity.
Its call weakly referenced if you don’t remove your listener, there is no garbage sweeping so if the listener is true (last parameter) makes this as weekly referenced. and allow garbage sweeping from memory .
Still if you remove your listener you don’t have to use the 5 parameters method.
welcome to the AS3 club .
this is an advanced topic and you should leave it for when you have a better idea about all this as3 stuff
you can write only
stopBtn.addEventListener(MouseEvent.CLICK, onStopClick);
and it will work with out a problem.
this is an advanced topic and you should leave it for when you have a better idea about all this as3 stuffadvanced topic? you meant basic topic i think ….....you can write only
stopBtn.addEventListener(MouseEvent.CLICK, onStopClick);
and it will work with out a problem.
advanced topic? you meant basic topic i think ….....
I mean advanced topic for people who have 2 days of actionscript. 
There are 3 parameters after that function name, can you explain what they do? but always on a very beginner level. Like the “useCapture” option? Or the “priority”?
I learn AS3 .0 for 2 days and I have 1 little problem.
stopBtn.addEventListener(MouseEvent.CLICK, onStopClick, false, 0, true);
I don’t understand why we need false, 0, true at end? What that do? Thanks and sorry for stupidity.
I’m learning AS3 as well, and you definitely should get in the habit to set your listeners to weak, you can read more about it here:
http://www.gskinner.com/blog/archives/2006/07/as3_weakly_refe.html
Basically, in AS3 , if you don’t remove your listeners manually, even if you do remove the object the listener is listening to from the display list, the object will not be garbage collected, and will still be using memory So the best practice is to make sure you always remove your listeners when you don’t need them anymore.
However, setting your listeners to “weak” can be seen as a backup plan basically, so that if you do forget to remove your listerner, the object will still be garbage collected when it is no longer referenced to.
Note i am also a AS3 newbie, but this is what I understood so far 
Thank you guys…
BTW , I learn by reading a Learning ActionScript3.0 A Beginners Guide and Im on chapter 6 now (OOP). My problem is that I dont know more than basics of variables, functions, display list etc. so I cant build something with that knowledge. Is that my problem, am I wrong or its will be better and better with practice? It seems very complicated to me but I dont want give up.
everything its difficult at the beginning, you can’t know all in just a couple of days. Programming its a vast territory. Just don’t give up 
the false option after the name of the function, more info here
http://www.adobe.com/devnet/actionscript/articles/event_handling_as3_03.html
Thank you guys… BTW , I learn by reading a Learning ActionScript3.0 A Beginners Guide and Im on chapter 6 now (OOP). My problem is that I dont know more than basics of variables, functions, display list etc. so I cant build something with that knowledge. Is that my problem, am I wrong or its will be better and better with practice? It seems very complicated to me but I dont want give up.
I am also reading this book, and removing of event listeners is discussed at the beginning, on page 46 – Weakly referenced listeners is also discussed on page 47, I would advise you not to skip any part of the book if you are just starting.
AS3 is definitely not easy, but it’s not impossible, so don’t give up, you will certainly pull your hair out until the last while trying to figure stuff out, but there is a light at the end of the tunnel 
Something missing in my brain to understand that… I will read book again from start when I will be concentrated on content with more clarity. My problem is that I want read it fast but nothing can be faster than normal way.
COPYRIGHT © 2012 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.