Re: [Flashcoders] AS3 finally..
Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. On 27/05/2013 06:50, Cor wrote: I think they can be usefull to create objects with a lot of its own functionality. In fact the same as you use a public classes: create objects, and you can polymorphism the objects to your needs. I also think this will keep your code more readable and clean. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: maandag 27 mei 2013 1:22 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Thanks Ktu. That actually makes sense. I was not looking for a reason necessarily to use a private class, but more so, saw this example and had the though this must be a private class and wanted to verify for my own understanding. Which you have provided. I see and understand what you mean by it is not the most necessary thing to create a private namespace class and that I will more then likely be able to accomplish what i need through regular classes and never need to set a private class up. Thank you for the clarification. Well. Finished Perkins, on to Moock. Actually getting excited... LoL Thanks again, Best, Karl Sent from losPhone On May 26, 2013, at 10:40 AM, ktu ktu_fl...@cataclysmicrewind.com wrote: yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/flash/video/cuepoints.flv;; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.Success: connectStream(); break; case NetStream.Play.StreamNotFound: trace(Stream not found: + videoURL); break; } } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(securityErrorHandler: + event); } private function connectStream():void { addChild(video); var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.client = new CustomClient(); video.attachNetStream(stream); stream.play
Re: [Flashcoders] AS3 finally..
i generally use them for something teeny tiny that is only needed in the scope of the main class and doesn't feel right in it's own file as it's never used anywhere but the main class. On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. On 27/05/2013 06:50, Cor wrote: I think they can be usefull to create objects with a lot of its own functionality. In fact the same as you use a public classes: create objects, and you can polymorphism the objects to your needs. I also think this will keep your code more readable and clean. HTH Cor -Original Message- From: flashcoders-bounces@chattyfig.**figleaf.comflashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-bounces@**chattyfig.figleaf.comflashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: maandag 27 mei 2013 1:22 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Thanks Ktu. That actually makes sense. I was not looking for a reason necessarily to use a private class, but more so, saw this example and had the though this must be a private class and wanted to verify for my own understanding. Which you have provided. I see and understand what you mean by it is not the most necessary thing to create a private namespace class and that I will more then likely be able to accomplish what i need through regular classes and never need to set a private class up. Thank you for the clarification. Well. Finished Perkins, on to Moock. Actually getting excited... LoL Thanks again, Best, Karl Sent from losPhone On May 26, 2013, at 10:40 AM, ktu ktu_flash@cataclysmicrewind.**comktu_fl...@cataclysmicrewind.com wrote: yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.**SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/**flash/video/cuepoints.flvhttp://www.helpexamples.com/flash/video/cuepoints.flv ; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(**NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(**SecurityErrorEvent.SECURITY_* *ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:**NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.**Success: connectStream(); break; case NetStream.Play.**StreamNotFound: trace(Stream not found
RE: [Flashcoders] AS3 finally..
I use this for objects only needed in the scope of that particular class. I don't know if this is the best solution... I guess this depends on what you are trying to achieve. It works for me. Regards Cor On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. On 27/05/2013 06:50, Cor wrote: I think they can be usefull to create objects with a lot of its own functionality. In fact the same as you use a public classes: create objects, and you can polymorphism the objects to your needs. I also think this will keep your code more readable and clean. HTH Cor -Original Message- From: flashcoders-bounces@chattyfig.**figleaf.comflashcoders-bounces@chatt yfig.figleaf.com [mailto:flashcoders-bounces@**chattyfig.figleaf.comflashcoders-bounc e...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: maandag 27 mei 2013 1:22 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Thanks Ktu. That actually makes sense. I was not looking for a reason necessarily to use a private class, but more so, saw this example and had the though this must be a private class and wanted to verify for my own understanding. Which you have provided. I see and understand what you mean by it is not the most necessary thing to create a private namespace class and that I will more then likely be able to accomplish what i need through regular classes and never need to set a private class up. Thank you for the clarification. Well. Finished Perkins, on to Moock. Actually getting excited... LoL Thanks again, Best, Karl Sent from losPhone On May 26, 2013, at 10:40 AM, ktu ktu_flash@cataclysmicrewind.**comktu_fl...@cataclysmicrewind.com wrote: yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.**SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/**flash/video/cuepoints.flvhttp://www. helpexamples.com/flash/video/cuepoints.flv ; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(**NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(**SecurityErrorEvent.SECURITY_* *ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:**NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.**Success: connectStream(); break; case NetStream.Play
Re: [Flashcoders] AS3 finally..
On 27/05/2013 11:37, tom rhodes wrote: i generally use them for something teeny tiny that is only needed in the scope of the main class and doesn't feel right in it's own file as it's never used anywhere but the main class. Why wouldn't you just incorporate that functionality as part of the class? Helper methods that aren't necessarily intended for external use? On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 finally..
As for my usage: I create at any given moment one or more objects of the helper class within one or more functions in the containing class. excuse the poor English, I am Dutch. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: maandag 27 mei 2013 12:50 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. On 27/05/2013 11:37, tom rhodes wrote: i generally use them for something teeny tiny that is only needed in the scope of the main class and doesn't feel right in it's own file as it's never used anywhere but the main class. Why wouldn't you just incorporate that functionality as part of the class? Helper methods that aren't necessarily intended for external use? On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
I have written a lot of AS3 code with classes and before that was mostly a Java developer and I have yet to have written an AS3 project that has used private classes for anything at all but singleton enforcement. I'm trying to get a handle on whether I've been missing out or people are using private classes where they weren't needed. Does it really matter that much? perhaps not. For me, private classes are some secret coding hidden from the world and segregated from the main class. If a class is important, it's probably important enough to be a public class. If it's not that important I suspect it could have it's functionality coded as a helper function for the main class. I have never really been a fan of private classes because IMHO they introduce added complication, quietly, where it's probably not needed - hence my search for an example to change my mind about this. Anyone have a concrete example where a private class suits perfectly (and doesn't involve singletons)? This is your chance to educate me. On 27/05/2013 11:47, Cor wrote: I use this for objects only needed in the scope of that particular class. I don't know if this is the best solution... I guess this depends on what you are trying to achieve. It works for me. Regards Cor On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 finally..
Thats a good question and well phrased. And I wish I could give you as good an answer, however, Collin Moocks Lost Weekend videos, which can be accessed through Safari Books, goes into why and when you'd use them, quite nicely with examples and a qa. Date: Mon, 27 May 2013 12:05:44 +0100 From: p...@ipauland.com To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 finally.. I have written a lot of AS3 code with classes and before that was mostly a Java developer and I have yet to have written an AS3 project that has used private classes for anything at all but singleton enforcement. I'm trying to get a handle on whether I've been missing out or people are using private classes where they weren't needed. Does it really matter that much? perhaps not. For me, private classes are some secret coding hidden from the world and segregated from the main class. If a class is important, it's probably important enough to be a public class. If it's not that important I suspect it could have it's functionality coded as a helper function for the main class. I have never really been a fan of private classes because IMHO they introduce added complication, quietly, where it's probably not needed - hence my search for an example to change my mind about this. Anyone have a concrete example where a private class suits perfectly (and doesn't involve singletons)? This is your chance to educate me. On 27/05/2013 11:47, Cor wrote: I use this for objects only needed in the scope of that particular class. I don't know if this is the best solution... I guess this depends on what you are trying to achieve. It works for me. Regards Cor On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
On 27/05/2013 18:03, Rick Hassen wrote: Thats a good question and well phrased. And I wish I could give you as good an answer, however, Collin Moocks Lost Weekend videos, which can be accessed through Safari Books, goes into why and when you'd use them, quite nicely with examples and a qa. Sadly, I'm not a subscriber, so I'll have to pass. I might sign up for a trial sometime and check out what he has to say. Date: Mon, 27 May 2013 12:05:44 +0100 From: p...@ipauland.com To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 finally.. I have written a lot of AS3 code with classes and before that was mostly a Java developer and I have yet to have written an AS3 project that has used private classes for anything at all but singleton enforcement. I'm trying to get a handle on whether I've been missing out or people are using private classes where they weren't needed. Does it really matter that much? perhaps not. For me, private classes are some secret coding hidden from the world and segregated from the main class. If a class is important, it's probably important enough to be a public class. If it's not that important I suspect it could have it's functionality coded as a helper function for the main class. I have never really been a fan of private classes because IMHO they introduce added complication, quietly, where it's probably not needed - hence my search for an example to change my mind about this. Anyone have a concrete example where a private class suits perfectly (and doesn't involve singletons)? This is your chance to educate me. On 27/05/2013 11:47, Cor wrote: I use this for objects only needed in the scope of that particular class. I don't know if this is the best solution... I guess this depends on what you are trying to achieve. It works for me. Regards Cor On 27 May 2013 12:24, Paul A. p...@ipauland.com wrote: Out of curiosity, has anyone on the list actually used private classes for anything other than enforcing singleton creation? If you have, please tell us and say why it was the best solution. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/flash/video/cuepoints.flv;; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.Success: connectStream(); break; case NetStream.Play.StreamNotFound: trace(Stream not found: + videoURL); break; } } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(securityErrorHandler: + event); } private function connectStream():void { addChild(video); var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.client = new CustomClient(); video.attachNetStream(stream); stream.play(videoURL); } } } class CustomClient { public function onMetaData(info:Object):void { trace(metadata: duration= + info.duration + width= + info.width + height= + info.height + framerate= + info.framerate); } public function onCuePoint(info:Object):void { trace(cuepoint: time= + info.time + name= + info.name + type= + info.type); } } Best, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/flash/video/cuepoints.flv;; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.Success: connectStream(); break; case NetStream.Play.StreamNotFound: trace(Stream not found: + videoURL); break; } } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(securityErrorHandler: + event); } private function connectStream():void { addChild(video); var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.client = new CustomClient(); video.attachNetStream(stream); stream.play(videoURL); } } } class CustomClient { public function onMetaData(info:Object):void { trace(metadata: duration= + info.duration + width= + info.width + height= + info.height + framerate= + info.framerate); } public function onCuePoint(info:Object):void { trace(cuepoint: time= + info.time + name= + info.name + type= + info.type); } } Best, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Thanks Ktu. That actually makes sense. I was not looking for a reason necessarily to use a private class, but more so, saw this example and had the though this must be a private class and wanted to verify for my own understanding. Which you have provided. I see and understand what you mean by it is not the most necessary thing to create a private namespace class and that I will more then likely be able to accomplish what i need through regular classes and never need to set a private class up. Thank you for the clarification. Well. Finished Perkins, on to Moock. Actually getting excited... LoL Thanks again, Best, Karl Sent from losPhone On May 26, 2013, at 10:40 AM, ktu ktu_fl...@cataclysmicrewind.com wrote: yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/flash/video/cuepoints.flv;; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.Success: connectStream(); break; case NetStream.Play.StreamNotFound: trace(Stream not found: + videoURL); break; } } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(securityErrorHandler: + event); } private function connectStream():void { addChild(video); var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.client = new CustomClient(); video.attachNetStream(stream); stream.play(videoURL); } } } class CustomClient { public function onMetaData(info:Object):void { trace(metadata: duration= + info.duration + width= + info.width + height= + info.height + framerate= + info.framerate); } public function onCuePoint(info:Object):void { trace(cuepoint: time= + info.time + name= + info.name + type= + info.type); } } Best, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Ktu; The information contained in this message may or may
RE: [Flashcoders] AS3 finally..
I think they can be usefull to create objects with a lot of its own functionality. In fact the same as you use a public classes: create objects, and you can polymorphism the objects to your needs. I also think this will keep your code more readable and clean. HTH Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: maandag 27 mei 2013 1:22 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Thanks Ktu. That actually makes sense. I was not looking for a reason necessarily to use a private class, but more so, saw this example and had the though this must be a private class and wanted to verify for my own understanding. Which you have provided. I see and understand what you mean by it is not the most necessary thing to create a private namespace class and that I will more then likely be able to accomplish what i need through regular classes and never need to set a private class up. Thank you for the clarification. Well. Finished Perkins, on to Moock. Actually getting excited... LoL Thanks again, Best, Karl Sent from losPhone On May 26, 2013, at 10:40 AM, ktu ktu_fl...@cataclysmicrewind.com wrote: yes. this is an example of a private class. but as someone earlier mentioned, you shouldn't ever _need_ to use them. and it would be more appropriate not to use them in production code. using the internal namespace gives you some restriction, and you could even use your own namespace for restriction but that's quite uncommon as well. for reference.. - you cannot add a namespace to this 'private' class and should result in a compile error if you do. (ex. public class CustomClient) therefore, it must always be defined as 'class ClassName' with no namespace. - any classes that you need within this 'private' class must be imported outside the package package com { // code } import flash.display.Sprite class MySprite { // code } - and if some outside object gets a reference to it, you should be able to access public functions and properties so long as you do not try to cast the object as anything other than Object. in my experience, i have yet to feel the need for a pseudo 'private' class. the internal namespace serves me well most and in a few occasions a custom namespace was required. good luck :) On Sun, May 26, 2013 at 6:58 AM, Karl DeSaulniers k...@designdrumm.comwrote: Ok, I am understanding things a little better I believe. Quick question to solidify some knowledge. In reference to my question about a private class, is the class CustomClient at the bottom an example of a private class? It was mentioned that even if you don't have the word private there and don't put public, flash automatically will interpret it as a private class. It is inside the class file but outside the package for the main class (which was also mentioned), it does not have public on it so you can't call it outside this file. This is what a private class is, correct? package { import flash.display.Sprite; import flash.events.NetStatusEvent; import flash.events.SecurityErrorEvent; import flash.media.Video; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.Event; public class NetConnectionExample extends Sprite { private var videoURL:String = http://www.helpexamples.com/flash/video/cuepoints.flv;; private var connection:NetConnection; private var stream:NetStream; private var video:Video = new Video(); public function NetConnectionExample() { connection = new NetConnection(); connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); connection.connect(null); } private function netStatusHandler(event:NetStatusEvent):void { switch (event.info.code) { case NetConnection.Connect.Success: connectStream(); break; case NetStream.Play.StreamNotFound: trace(Stream not found: + videoURL); break; } } private function securityErrorHandler(event:SecurityErrorEvent):void { trace(securityErrorHandler: + event); } private function connectStream():void { addChild(video); var stream:NetStream = new NetStream(connection); stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); stream.client = new CustomClient(); video.attachNetStream(stream); stream.play(videoURL); } } } class CustomClient { public function onMetaData(info:Object):void { trace(metadata: duration= + info.duration + width
Re: [Flashcoders] AS3 Noise (Audio) Filter?
I have not seen anything that does that (how unhelpful was this !)… Having said that, this guy is a DSP specialist by the looks of it: http://gerrybeauregard.wordpress.com/2010/08/03/an-fft-in-as3/ maybe if you got in contact with him ? On 24 May 2013, at 15:20, Eric E. Dolecki edole...@gmail.com wrote: I'm looking for something to attempt to remove noise (or hum/hiss) from a playing audio file in real-time. Thanks for any pointers. Google Voice: (508) 656-0622 Twitter: eric_dolecki XBoxLive: edolecki PSN: eric_dolecki Imagineric http://imagineric.ericd.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 finally..
Karl, One: why doesn't ActionScript 3 allow private classes? A: They are useless because they couldn't be used, I guess. You can use a Class within a public class which then would be private to that class it self. Two: why is writing public class a best practice if private class does not exist? Look a the variations with static etc. HTH Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
On 21/05/2013 05:04, Karl DeSaulniers wrote: Thank you Ktu. That is what I was looking for. I'd say the problem with asking questions like this is that you're getting answers to questions you shouldn't be asking at this stage of your AS3 experience. While you may get a technical answer, you miss out completely on the real question - in what circumstances would using a private class be of benefit (and why), and when should you not use a private class? A book will teach you more than the technicalities. To put this into context, about the only time I have ever used private classes is to enforce the creation of singleton classes. They are hardly an essential and I have written a ton of AS3 code over the years. You also need to get a good grasp of design patterns - particularly MVC. You can't get an overall view of best practice by asking these very particular questions when you don't have a bigger context to understand where a language feature fits well and where it doesn't. The Moock book is popular and very detailed. I have it. Personally I think it's a bit heavy for a beginner to AS3 and I'd recommend (again) learning actionscript 3 as a gentler start before tackling the Moock book. This list can give you specific answers, but you really need the bigger picture. Paul Much thanks, Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:58 PM, Ktu wrote: you can have public class, internal class (limited to package), and you can make pseudo private classes by declaring a class in the same file as another class, but outside the package. the main reason you write 'public class' is because the _default_ is internal. if you simply say class MyClass {}it is treated as internal. On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.comwrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.comwrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
$8.49 here: http://www.ebay.com/ctg/Essential-ActionScript-3-0-Colin-Moock-2007-Paperback-/59066703 On Tue, May 21, 2013 at 9:02 PM, Matt S. mattsp...@gmail.com wrote: You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.com wrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Oh well hot dog I can afford that! :) Thanks all. Karl Sent from losPhone On May 21, 2013, at 11:44 AM, mike g mike.ogr...@gmail.com wrote: $8.49 here: http://www.ebay.com/ctg/Essential-ActionScript-3-0-Colin-Moock-2007-Paperback-/59066703 On Tue, May 21, 2013 at 9:02 PM, Matt S. mattsp...@gmail.com wrote: You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.com wrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 finally..
Check your junk mail Karl, sent you a PM but may have got filtered Cheers Marco Terrinoni - Director MULARAM PRODUCTIONS web design // animation // illustration uk: +44 7876 652 643 e: ma...@mularam.com w: www.mularam.com -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: 21 May 2013 18:50 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Oh well hot dog I can afford that! :) Thanks all. Karl Sent from losPhone On May 21, 2013, at 11:44 AM, mike g mike.ogr...@gmail.com wrote: $8.49 here: http://www.ebay.com/ctg/Essential-ActionScript-3-0-Colin-Moock-2007-Pa perback-/59066703 On Tue, May 21, 2013 at 9:02 PM, Matt S. mattsp...@gmail.com wrote: You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.com wrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders - No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3336 / Virus Database: 3162/6341 - Release Date: 05/20/13 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Thanks Marco. Got your email. Will check it when I get home tonight. Best, Karl Sent from losPhone On May 21, 2013, at 1:18 PM, Marco Terrinoni ma...@mularam.com wrote: Check your junk mail Karl, sent you a PM but may have got filtered Cheers Marco Terrinoni - Director MULARAM PRODUCTIONS web design // animation // illustration uk: +44 7876 652 643 e: ma...@mularam.com w: www.mularam.com -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: 21 May 2013 18:50 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Oh well hot dog I can afford that! :) Thanks all. Karl Sent from losPhone On May 21, 2013, at 11:44 AM, mike g mike.ogr...@gmail.com wrote: $8.49 here: http://www.ebay.com/ctg/Essential-ActionScript-3-0-Colin-Moock-2007-Pa perback-/59066703 On Tue, May 21, 2013 at 9:02 PM, Matt S. mattsp...@gmail.com wrote: You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.com wrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders - No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3336 / Virus Database: 3162/6341 - Release Date: 05/20/13 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Why? The answer has to do with Adobe's adherence to the ECMAScript working standard that they were basing AS3 on. At the time (before the ECMAScript 4 process fell apart), the body determined that private constructors were not needed, so adobe built this restriction into AS3. Private constructors aren't useless, particularly for single pattern. With a private constructor, you can instantiate the class from within itself, assign it to a private class (static) property, and then expose the single instance through a public class (static) getter function. You'd be protected from every other way to instantiate the class. There are ways to do singleton without it, they are just more of a pain. Like taking an instance of a key class in the constructor, where the Key class is defined in the local class file scope chain. Since nothing else will have access to that Key class except your singleton class, you can use that as a nice locking mechanism. I can't think of any use for private class off the top of my head, but that doesn't mean there isn't one. Kevin N. On 5/21/13 2:39 AM, Cor wrote: Karl, One: why doesn't ActionScript 3 allow private classes? A: They are useless because they couldn't be used, I guess. You can use a Class within a public class which then would be private to that class it self. Two: why is writing public class a best practice if private class does not exist? Look a the variations with static etc. HTH Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
This is very interesting to me. I don't know how that all works in a real-case scenario yet, but I will. ;) When I get into design patterns I think I may revisit this post. Thanks Kevin. Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 21, 2013, at 5:51 PM, Kevin Newman wrote: Why? The answer has to do with Adobe's adherence to the ECMAScript working standard that they were basing AS3 on. At the time (before the ECMAScript 4 process fell apart), the body determined that private constructors were not needed, so adobe built this restriction into AS3. Private constructors aren't useless, particularly for single pattern. With a private constructor, you can instantiate the class from within itself, assign it to a private class (static) property, and then expose the single instance through a public class (static) getter function. You'd be protected from every other way to instantiate the class. There are ways to do singleton without it, they are just more of a pain. Like taking an instance of a key class in the constructor, where the Key class is defined in the local class file scope chain. Since nothing else will have access to that Key class except your singleton class, you can use that as a nice locking mechanism. I can't think of any use for private class off the top of my head, but that doesn't mean there isn't one. Kevin N. On 5/21/13 2:39 AM, Cor wrote: Karl, One: why doesn't ActionScript 3 allow private classes? A: They are useless because they couldn't be used, I guess. You can use a Class within a public class which then would be private to that class it self. Two: why is writing public class a best practice if private class does not exist? Look a the variations with static etc. HTH Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Again, I am shown the great generosity of this list. Much thanks Marco. Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 21, 2013, at 2:12 PM, Karl DeSaulniers wrote: Thanks Marco. Got your email. Will check it when I get home tonight. Best, Karl Sent from losPhone On May 21, 2013, at 1:18 PM, Marco Terrinoni ma...@mularam.com wrote: Check your junk mail Karl, sent you a PM but may have got filtered Cheers Marco Terrinoni - Director MULARAM PRODUCTIONS web design // animation // illustration uk: +44 7876 652 643 e: ma...@mularam.com w: www.mularam.com -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: 21 May 2013 18:50 To: Flash Coders List Subject: Re: [Flashcoders] AS3 finally.. Oh well hot dog I can afford that! :) Thanks all. Karl Sent from losPhone On May 21, 2013, at 11:44 AM, mike g mike.ogr...@gmail.com wrote: $8.49 here: http://www.ebay.com/ctg/Essential-ActionScript-3-0-Colin-Moock-2007-Pa perback-/59066703 On Tue, May 21, 2013 at 9:02 PM, Matt S. mattsp...@gmail.com wrote: You can get Moock's book for $26 on Powells: http://www.powells.com/biblio/1-9780596526948-6 Its been out for a while now though, so I would hit your local used bookstore, I'm willing to bet there's a few copies out there, you can probably score it for $10 or something. Not that Moock doesn't deserve full-price for this invaluable resource of course! And whatever you pay, it's simply required reading if you're serious about AS3. .m On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.com wrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders - No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3336 / Virus Database: 3162/6341 - Release Date: 05/20/13 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
For some more insights (though ... not much .. .and hey baby, is that Java over there ?) you can check this thread (they are speaking about private and protected classes, but the reading is interesting) http://www.coderanch.com/t/410134/java/java/private-protected-class hth, Cedric Why? The answer has to do with Adobe's adherence to the ECMAScript working standard that they were basing AS3 on. At the time (before the ECMAScript 4 process fell apart), the body determined that private constructors were not needed, so adobe built this restriction into AS3. Private constructors aren't useless, particularly for single pattern. With a private constructor, you can instantiate the class from within itself, assign it to a private class (static) property, and then expose the single instance through a public class (static) getter function. You'd be protected from every other way to instantiate the class. There are ways to do singleton without it, they are just more of a pain. Like taking an instance of a key class in the constructor, where the Key class is defined in the local class file scope chain. Since nothing else will have access to that Key class except your singleton class, you can use that as a nice locking mechanism. I can't think of any use for private class off the top of my head, but that doesn't mean there isn't one. Kevin N. On 5/21/13 2:39 AM, Cor wrote: Karl, One: why doesn't ActionScript 3 allow private classes? A: They are useless because they couldn't be used, I guess. You can use a Class within a public class which then would be private to that class it self. Two: why is writing public class a best practice if private class does not exist? Look a the variations with static etc. HTH Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Quick two part question. One: why doesn't ActionScript 3 allow private classes? Two: why is writing public class a best practice if private class does not exist? I could not find an explination in the books I am studying so I thought I'd ask here. TIA. Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 19, 2013, at 6:01 AM, mike g wrote: Just wondering, has Colin Moock put forward any thoughts re. Flash/Actionscript's future direction? On Sun, May 19, 2013 at 6:02 PM, Paul A. p...@ipauland.com wrote: On 19/05/2013 09:18, Hans Wichman wrote: Karl, no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :). Excellent advice. Don't try and get to grips with the language via the forum. This is a gentler introduction: http://shop.oreilly.com/**product/0636920010401.dohttp://shop.oreilly.com/product/0636920010401.do Also http://www.adobe.com/devnet/**actionscript/learning.htmlhttp://www.adobe.com/devnet/actionscript/learning.html Good luck __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 finally..
Hi Karl, One: AS3 does allow private classes. Just not as the constructor class of the main file. ( I am not sure if subclasses can have private constructors but everything else can be private )Two: Private classes are a best practice, Internal is also good, public only when necessary to create an api. Hope that helps. I don't know where you are getting your information, but you may want to consider getting a good AS3 book. Rick Subject: Re: [Flashcoders] AS3 finally.. From: k...@designdrumm.com Date: Mon, 20 May 2013 20:58:41 -0500 To: flashcoders@chattyfig.figleaf.com Quick two part question. One: why doesn't ActionScript 3 allow private classes? Two: why is writing public class a best practice if private class does not exist? I could not find an explination in the books I am studying so I thought I'd ask here. TIA. Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 19, 2013, at 6:01 AM, mike g wrote: Just wondering, has Colin Moock put forward any thoughts re. Flash/Actionscript's future direction? On Sun, May 19, 2013 at 6:02 PM, Paul A. p...@ipauland.com wrote: On 19/05/2013 09:18, Hans Wichman wrote: Karl, no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :). Excellent advice. Don't try and get to grips with the language via the forum. This is a gentler introduction: http://shop.oreilly.com/**product/0636920010401.dohttp://shop.oreilly.com/product/0636920010401.do Also http://www.adobe.com/devnet/**actionscript/learning.htmlhttp://www.adobe.com/devnet/actionscript/learning.html Good luck __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
you can have public class, internal class (limited to package), and you can make pseudo private classes by declaring a class in the same file as another class, but outside the package. the main reason you write 'public class' is because the _default_ is internal. if you simply say class MyClass {}it is treated as internal. On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.comwrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Yeah, we all have the bad problem of paying the rent and eating. :) I know just what you mean. Good luck and like someone said before, we can't teach you AS3, but when you have specific problems or questions, feel free to ask the group. We've all needed help at one time or another and this has been a really good resource, quite often. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 10:57 PM, Karl DeSaulniers wrote: Just need to gen some funds. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Thank you Ktu. That is what I was looking for. Much thanks, Best, Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:58 PM, Ktu wrote: you can have public class, internal class (limited to package), and you can make pseudo private classes by declaring a class in the same file as another class, but outside the package. the main reason you write 'public class' is because the _default_ is internal. if you simply say class MyClass {}it is treated as internal. On Mon, May 20, 2013 at 11:57 PM, Karl DeSaulniers k...@designdrumm.comwrote: Thank you John. Yes, I have already watched some really good tuts on gotoandlearn and plan to watch more when I start working on my project. My book is from lynda.com too. Going to invest in Moocks book as suggested earlier as well. Just need to gen some funds. :) Karl DeSaulniers Design Drumm http://designdrumm.com On May 20, 2013, at 10:30 PM, John R. Sweeney Jr. wrote: Or subscribe to http://www.lynda.com Excellent training tutorials on tons of software. Very in-depth, but you do pay for it. If you know AS2, check out www.gotoandlearn.com. Many free tutorials on specific tasks, but you'll see them working and their AS3 code, so you can start making the correlation between what is different in 2 versus 3. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 20, 2013, at 9:25 PM, Rick Hassen wrote: but you may want to consider getting a good AS3 book. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Ktu; The information contained in this message may or may not be privileged and/or confidential. If you are NOT the intended recipient, congratulations, you got mail! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
In place of void? so like... function someFunc():Number { //return a number } function someFunc():String { //return a string } Karl DeSaulniers Design Drumm http://designdrumm.com On May 19, 2013, at 12:26 AM, John R. Sweeney Jr. wrote: Void was AS2 and wasn't really necessary. void is AS3 and since it uses strong typing, very necessary. void will not return anything. If you want back values (numeric) use Number (text) use String, etc. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 18, 2013, at 10:15 PM, Karl DeSaulniers wrote: My first question. What is the purpose of void versus Void? When do you use void and Void and when is it not needed or wise to use void on a function? I may have asked this a few years ago, but can not find any of the emails, so if its a duplicate I apologize. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Karl, no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :). That said, AS3 is much more about (strong) typing than AS2 was. In that line of thinking, you need to specify exactly what types of parameters go into a method/function and what it returns, even if that what is nothing. The type of Nothing is this respect is void. //i return a number function bla():Number { return 10; } //i return nothing function bla():void { //im not giving you anything! // //implicit return } //i return nothing as well function bla():void { //explicit return if (myConditionNotMet) return; //some other stuff here //... //implicit return } If you go the corporal punishment route, there is some good info here: http://owhips.com/ ;) Best H On 19-5-2013 9:34, Karl DeSaulniers wrote: In place of void? so like... function someFunc():Number { //return a number } function someFunc():String { //return a string } Karl DeSaulniers Design Drumm http://designdrumm.com On May 19, 2013, at 12:26 AM, John R. Sweeney Jr. wrote: Void was AS2 and wasn't really necessary. void is AS3 and since it uses strong typing, very necessary. void will not return anything. If you want back values (numeric) use Number (text) use String, etc. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 18, 2013, at 10:15 PM, Karl DeSaulniers wrote: My first question. What is the purpose of void versus Void? When do you use void and Void and when is it not needed or wise to use void on a function? I may have asked this a few years ago, but can not find any of the emails, so if its a duplicate I apologize. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Hans Wichman skriver: That said, AS3 is much more about (strong) typing than AS2 was. In that line of thinking, you need to specify exactly what types of parameters go into a method/function and what it returns, even if that what is nothing. The type of Nothing is this respect is void. Need and need, it is good practice. So good that some compilers will raise a warning if you fail to do it. The point of void here is twofold, to let the compiler check that the return statement doesn't try to return anything and to let the compiler check that the caller isn't expecting a return value. Other types have similar checks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
On 19/05/2013 09:18, Hans Wichman wrote: Karl, no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :). Excellent advice. Don't try and get to grips with the language via the forum. This is a gentler introduction: http://shop.oreilly.com/product/0636920010401.do Also http://www.adobe.com/devnet/actionscript/learning.html Good luck ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Just wondering, has Colin Moock put forward any thoughts re. Flash/Actionscript's future direction? On Sun, May 19, 2013 at 6:02 PM, Paul A. p...@ipauland.com wrote: On 19/05/2013 09:18, Hans Wichman wrote: Karl, no harm intended, but do yourself and us a favor and get something like Essential Actionscript 3 from Moock, it will save you lots and lots of unnecessary self inflicted punishment :). Excellent advice. Don't try and get to grips with the language via the forum. This is a gentler introduction: http://shop.oreilly.com/**product/0636920010401.dohttp://shop.oreilly.com/product/0636920010401.do Also http://www.adobe.com/devnet/**actionscript/learning.htmlhttp://www.adobe.com/devnet/actionscript/learning.html Good luck __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 finally..
Void was AS2 and wasn't really necessary. void is AS3 and since it uses strong typing, very necessary. void will not return anything. If you want back values (numeric) use Number (text) use String, etc. John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On May 18, 2013, at 10:15 PM, Karl DeSaulniers wrote: My first question. What is the purpose of void versus Void? When do you use void and Void and when is it not needed or wise to use void on a function? I may have asked this a few years ago, but can not find any of the emails, so if its a duplicate I apologize. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
ah well if asnext/as4 is better then its actionscript is dead, long live actionscript:) Sent from my iPad On 29 okt. 2012, at 05:36, Kevin Newman capta...@unfocus.com wrote: I literally meant AS3 is dying. Adobe does have their replacement (check some recent discussions on the Apache Flex-dev mailing list ;-) ). Hopefully it'll revitalize things a bit. Kevin N. On 10/28/2012 7:24 AM, Hans Wichman wrote: I think the heart of the matter is that in my opinion actionscript/flash is not dying, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Sorry for the late reply, I was pondering about how to bring this without going into a flash vs html5 debate (been there done that). So I think to sum it up, I think the heart of the matter is that in my opinion actionscript/flash is not dying, it's moving and growing towards where its strengths lie. In some industries that might mean it feels as if it is dying, but the conclusion might just as well be: - if I want to keep doing website/webapplication work I might have to add html5/css/javascript to my skillset OR - if I want to keep doing actionscript/flash work I might have to move towards gaming, gamification, serious games, desktop apps, mobile apps and other fields of work (maybe even a teacher) Anyway I could go on and on but that pretty much sums it up I think. Even is there is an as4 or asnext (which appearently there is or will be), that only means we can migrate to as4 *not *that flash or adobe air or adobe air for mobile is dead. For those of you fearing to move to mobile using flash, yeah there is a steep learning curve and yeah there are pitfalls and yeah it is a lot of work blahblah, but it's fun, it works and most of it is very doable. Unity3D is a very nice option as well to move to if you are into platform independent game development etc etc. My 2 cents, this is not to disregard your opinion that flash in your industry is dying, I can only take your word for it, nor to say that I sometimes don't have sleepless nights as a fulltime freelancer, but anyway;) JC On 26/10/2012 19:53, Kevin Newman wrote: But why? :-) To add a little bit - perhaps AS3 is only dying in some industries (like mine). But surely once ASNext ships, AS3 will become the next AS2 (which has been diminishing for years now). Kevin N. On 10/26/12 1:44 PM, Hans Wichman wrote: I call bs:) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
I literally meant AS3 is dying. Adobe does have their replacement (check some recent discussions on the Apache Flex-dev mailing list ;-) ). Hopefully it'll revitalize things a bit. Kevin N. On 10/28/2012 7:24 AM, Hans Wichman wrote: I think the heart of the matter is that in my opinion actionscript/flash is not dying, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
AS4 is on the way, including a new VM to support it. - Original Message - From: Kerry Thompson al...@cyberiantiger.biz To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Friday, October 26, 2012 8:28 PM Subject: Re: [Flashcoders] AS3 I don't think there is going to be an AS4. The ECMA Script committee was working on a new standard at one point, but they disbanded 2-3 years ago without issuing a standard for ECMA Script 4. Adobe have been adding capabilities, such as sort, and I expect they will continue to add capabilities. They might even call a new release ActionScript 4, but it won't meet any ECMA standard. I don't think that's necessarily a bad thing. AS3 is a mature, robust language that has most of the features found in Java, JavaScript, and even C++. To go much beyond what they already have, it would almost mean a whole new programming paradigm. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
There is absolutely definitely going to be /something/. ASNext is what it's called in the roadmap: http://www.adobe.com/devnet/flashplatform/whitepapers/roadmap.html Kevin N. On 10/26/2012 2:28 PM, Kerry Thompson wrote: I don't think there is going to be an AS4. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
I'm on my first serious project using js. Some of it is pretty neat and simple and all the AS3 knowledge makes grabbing and treating elements (for animation and what not) very easy. I would definitely recommend using jQuery, and I am using jQuery Transit for some animations. However some of it baffles me, mainly stuff with CSS and positioning elements (which I thought I was OK with) and has added a lot of un-chargeable time. But in the long run I'm sure we will all adjust. I'd really like to learn to approach javascript from a class-based approach, so I must check out some of the links posted on this thread. Good luck to all making the transition! David On 25 October 2012 20:23, Karl DeSaulniers k...@designdrumm.com wrote: jQuery I think you will find is a very friendly language. Once you get into jQuery UI and jQuery animation, I think that is when your wheels will churn most. Best of luck! Karl On Oct 25, 2012, at 10:35 AM, Merrill, Jason wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-bounces@chattyfig.**figleaf.comflashcoders-boun...@chattyfig.figleaf.com[mailto: flashcoders-bounces@**chattyfig.figleaf.comflashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders --**--** -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/**emaildisclaimerhttp://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman
Re: [Flashcoders] AS3
JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
my framework lets you code like this: _package('com.neuromantic.display.shapes', _import( 'com.neuromantic.display.shapes.Oval'), _class( 'Circle' )._extends( 'Oval',{ Circle: function ( size ) { this._super( size, size ); } }) ); Ross P. Sclafani design / technology / creative http://ross.sclafani.net http://www.twitter.com/rosssclafani http://www.linkedin.com/in/rosssclafani [347] 204.5714 let go of even your longest held beliefs, the only truth is in observation. On Oct 26, 2012, at 10:25 AM, Kevin Newman capta...@unfocus.com wrote: JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! whilst we're on that subject though... http://haxe.org/doc/targets/js http://www.haxejs.org/ is about as close as you are going to get to AS3 in terms of JS. i can't recommend haxe enough for a million reasons but the JS target has just improved massively in the code it generates and haxe 3 is a few months away which should have the complete html5 spec covered as standard, including webgl. On 26 October 2012 16:40, Ross Sclafani ross.sclaf...@gmail.com wrote: my framework lets you code like this: _package('com.neuromantic.display.shapes', _import( 'com.neuromantic.display.shapes.Oval'), _class( 'Circle' )._extends( 'Oval',{ Circle: function ( size ) { this._super( size, size ); } }) ); Ross P. Sclafani design / technology / creative http://ross.sclafani.net http://www.twitter.com/rosssclafani http://www.linkedin.com/in/rosssclafani [347] 204.5714 let go of even your longest held beliefs, the only truth is in observation. On Oct 26, 2012, at 10:25 AM, Kevin Newman capta...@unfocus.com wrote: JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Thanks Kevin, I guess what I meant was a more object orientated approach, which I have enjoyed learning and using in AS3. I'll look into those libraries you mentioned. David On 26 October 2012 16:11, tom rhodes tom.rho...@gmail.com wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! whilst we're on that subject though... http://haxe.org/doc/targets/js http://www.haxejs.org/ is about as close as you are going to get to AS3 in terms of JS. i can't recommend haxe enough for a million reasons but the JS target has just improved massively in the code it generates and haxe 3 is a few months away which should have the complete html5 spec covered as standard, including webgl. On 26 October 2012 16:40, Ross Sclafani ross.sclaf...@gmail.com wrote: my framework lets you code like this: _package('com.neuromantic.display.shapes', _import( 'com.neuromantic.display.shapes.Oval'), _class( 'Circle' )._extends( 'Oval',{ Circle: function ( size ) { this._super( size, size ); } }) ); Ross P. Sclafani design / technology / creative http://ross.sclafani.net http://www.twitter.com/rosssclafani http://www.linkedin.com/in/rosssclafani [347] 204.5714 let go of even your longest held beliefs, the only truth is in observation. On Oct 26, 2012, at 10:25 AM, Kevin Newman capta...@unfocus.com wrote: JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- David Hunter www.davidhunterdesign.com +44 (0) 7869 104 906 @DHDPIC ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
Yeah, unfortunately the world has accepted Javascript without much complaint. But here's a simple example of simulating a class in Javascript - put this in a js file: (function(window){ function Person(name, address){ this.name = name; this.address = address; } Person.prototype.sayHello = function(){ console.log(this.name + says hello from+this.address); }; Person.SPECIES = human; window.Person = Person; }(window)); Then in HTML you can do this after importing the above js file: var jason = new Person(Jason Merrill, 123 Smith Street); jason.sayHello(); Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David Hunter Sent: Friday, October 26, 2012 11:23 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Thanks Kevin, I guess what I meant was a more object orientated approach, which I have enjoyed learning and using in AS3. I'll look into those libraries you mentioned. David On 26 October 2012 16:11, tom rhodes tom.rho...@gmail.com wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! whilst we're on that subject though... http://haxe.org/doc/targets/js http://www.haxejs.org/ is about as close as you are going to get to AS3 in terms of JS. i can't recommend haxe enough for a million reasons but the JS target has just improved massively in the code it generates and haxe 3 is a few months away which should have the complete html5 spec covered as standard, including webgl. On 26 October 2012 16:40, Ross Sclafani ross.sclaf...@gmail.com wrote: my framework lets you code like this: _package('com.neuromantic.display.shapes', _import( 'com.neuromantic.display.shapes.Oval'), _class( 'Circle' )._extends( 'Oval',{ Circle: function ( size ) { this._super( size, size ); } }) ); Ross P. Sclafani design / technology / creative http://ross.sclafani.net http://www.twitter.com/rosssclafani http://www.linkedin.com/in/rosssclafani [347] 204.5714 let go of even your longest held beliefs, the only truth is in observation. On Oct 26, 2012, at 10:25 AM, Kevin Newman capta...@unfocus.com wrote: JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- David Hunter www.davidhunterdesign.com +44 (0) 7869 104 906 @DHDPIC ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located
Re: [Flashcoders] AS3
Where it gets complicated is when you do inheritance. You can do it this way: (function(window){ function Person(name, address){ this.name = name; this.address = address; } Person.prototype = { sayHello: function() { console.log(this.name + says hello from+this.address); }; }; Person.SPECIES = human; function NeoPerson(name, address){ // kind of like super() Person.call( this, name, address ); // or (you only need one) Person.apply( this, arguments ); } // protects the prototype chain, without invoking the parent constructor // Object.create will need a polyfill in some browsers. NeoPerson.prototype = Object.create( Person.prototype ); // manually sync class props NeoPerson.SPECIES = Person.SPECIES; // can't use object literal syntax in child classes NeoPerson.prototype.sayHello = function() { // call parent method Person.prototype.sayHello.call( this ); console.log(this.name + says \I know Kung Fu.\ ); } window.Person = Person; window.NeoPerson = NeoPerson; })(window); var foo = new NeoPerson( 'Neo', 'somewhere' ); foo.sayHello(); // logs both sayHellos But you can see how verbose that it, which is why it can be useful to use a framework like Ross's or underscore.js. Also, there is Jangaroo, which compiles AS3 to JS. That is closer to AS3 than haXe. ;-) Personally, I'm a big fan of TypeScript from what I've seen so far. I'll be looking at that much more closely soon. Kevin N. On 10/26/12 11:30 AM, Merrill, Jason wrote: Yeah, unfortunately the world has accepted Javascript without much complaint. But here's a simple example of simulating a class in Javascript - put this in a js file: (function(window){ function Person(name, address){ this.name = name; this.address = address; } Person.prototype.sayHello = function(){ console.log(this.name + says hello from+this.address); }; Person.SPECIES = human; window.Person = Person; }(window)); Then in HTML you can do this after importing the above js file: var jason = new Person(Jason Merrill, 123 Smith Street); jason.sayHello(); Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of David Hunter Sent: Friday, October 26, 2012 11:23 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Thanks Kevin, I guess what I meant was a more object orientated approach, which I have enjoyed learning and using in AS3. I'll look into those libraries you mentioned. David On 26 October 2012 16:11, tom rhodes tom.rho...@gmail.com wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! whilst we're on that subject though... http://haxe.org/doc/targets/js http://www.haxejs.org/ is about as close as you are going to get to AS3 in terms of JS. i can't recommend haxe enough for a million reasons but the JS target has just improved massively in the code it generates and haxe 3 is a few months away which should have the complete html5 spec covered as standard, including webgl. On 26 October 2012 16:40, Ross Sclafani ross.sclaf...@gmail.com wrote: my framework lets you code like this: _package('com.neuromantic.display.shapes', _import( 'com.neuromantic.display.shapes.Oval'), _class( 'Circle' )._extends( 'Oval',{ Circle: function ( size ) { this._super( size, size ); } }) ); Ross P. Sclafani design / technology / creative http://ross.sclafani.net http://www.twitter.com/rosssclafani http://www.linkedin.com/in/rosssclafani [347] 204.5714 let go of even your longest held beliefs, the only truth is in observation. On Oct 26, 2012, at 10:25 AM, Kevin Newman capta...@unfocus.com wrote: JS doesn't have classes, and emulating them is somewhat tricky using the prototype chain (it can be done though). The easiest way to emulate classes though is to use a framework like underscore.js (which Backbone.js is built on). Kevin N. On 10/26/12 9:21 AM, David Hunter wrote: I'd really like to learn to approach javascript from a class-based approach, -- David Hunter www.davidhunterdesign.com +44 (0) 7869 104 906 @DHDPIC ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http
Re: [Flashcoders] AS3
I hate to say it, but AS3 is kind of dying. My hope is AS4 (or whatever they end up calling Actionscript Next) with it's gaming focus, will revitalize things a bit. Kevin N. On 10/26/12 11:11 AM, tom rhodes wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
I call bs :) Op 26 okt. 2012 19:34 schreef Kevin Newman capta...@unfocus.com het volgende: I hate to say it, but AS3 is kind of dying. My hope is AS4 (or whatever they end up calling Actionscript Next) with it's gaming focus, will revitalize things a bit. Kevin N. On 10/26/12 11:11 AM, tom rhodes wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
But why? :-) To add a little bit - perhaps AS3 is only dying in some industries (like mine). But surely once ASNext ships, AS3 will become the next AS2 (which has been diminishing for years now). Kevin N. On 10/26/12 1:44 PM, Hans Wichman wrote: I call bs:) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
I don't think there is going to be an AS4. The ECMA Script committee was working on a new standard at one point, but they disbanded 2-3 years ago without issuing a standard for ECMA Script 4. Adobe have been adding capabilities, such as sort, and I expect they will continue to add capabilities. They might even call a new release ActionScript 4, but it won't meet any ECMA standard. I don't think that's necessarily a bad thing. AS3 is a mature, robust language that has most of the features found in Java, JavaScript, and even C++. To go much beyond what they already have, it would almost mean a whole new programming paradigm. Cordially, Kerry Thompson On Fri, Oct 26, 2012 at 1:32 PM, Kevin Newman capta...@unfocus.com wrote: I hate to say it, but AS3 is kind of dying. My hope is AS4 (or whatever they end up calling Actionscript Next) with it's gaming focus, will revitalize things a bit. Kevin N. On 10/26/12 11:11 AM, tom rhodes wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Also, there is Jangaroo, which compiles AS3 to JS. That is closer to AS3 than haXe. ;-) hmmm, nowhere near as mature as haxe and haxe compiles to JS without needing a lightweight runtime either. the lack of a standard for ECMA script 4 is interesting, adobe has put there plans forward here http://www.adobe.com/devnet/flashplatform/whitepapers/roadmap.html for actionscript next. On 26 October 2012 20:28, Kerry Thompson al...@cyberiantiger.biz wrote: I don't think there is going to be an AS4. The ECMA Script committee was working on a new standard at one point, but they disbanded 2-3 years ago without issuing a standard for ECMA Script 4. Adobe have been adding capabilities, such as sort, and I expect they will continue to add capabilities. They might even call a new release ActionScript 4, but it won't meet any ECMA standard. I don't think that's necessarily a bad thing. AS3 is a mature, robust language that has most of the features found in Java, JavaScript, and even C++. To go much beyond what they already have, it would almost mean a whole new programming paradigm. Cordially, Kerry Thompson On Fri, Oct 26, 2012 at 1:32 PM, Kevin Newman capta...@unfocus.com wrote: I hate to say it, but AS3 is kind of dying. My hope is AS4 (or whatever they end up calling Actionscript Next) with it's gaming focus, will revitalize things a bit. Kevin N. On 10/26/12 11:11 AM, tom rhodes wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcoders http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
And don't forget, without being as feature complete as well. Kevin N. On 10/26/12 3:11 PM, tom rhodes wrote: hmmm, nowhere near as mature as haxe and haxe compiles to JS without needing a lightweight runtime either. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
I hate to say it, but AS3 is kind of dying. It's the platform that is taking the big hit (Flash player) therefore AS3 is decreasing in use because the platform is decreasing in use. It's not because AS3 lost favorability, the player did. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry Thompson Sent: Friday, October 26, 2012 2:28 PM To: Flash Coders List Subject: Re: [Flashcoders] AS3 I don't think there is going to be an AS4. The ECMA Script committee was working on a new standard at one point, but they disbanded 2-3 years ago without issuing a standard for ECMA Script 4. Adobe have been adding capabilities, such as sort, and I expect they will continue to add capabilities. They might even call a new release ActionScript 4, but it won't meet any ECMA standard. I don't think that's necessarily a bad thing. AS3 is a mature, robust language that has most of the features found in Java, JavaScript, and even C++. To go much beyond what they already have, it would almost mean a C++whole new programming paradigm. Cordially, Kerry Thompson On Fri, Oct 26, 2012 at 1:32 PM, Kevin Newman capta...@unfocus.com wrote: I hate to say it, but AS3 is kind of dying. My hope is AS4 (or whatever they end up calling Actionscript Next) with it's gaming focus, will revitalize things a bit. Kevin N. On 10/26/12 11:11 AM, tom rhodes wrote: how depressing that a simple AS3 question has turned into a thread about how everyone is now coding JS!! __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://cha ttyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Yeah the css thing got me for a while. $('#myElement').css('top', '0px'); $('#myElement').css('left', '0px'); or $('#myElement').css('top', '0px').css('left', '0px'); or $('#myElement').css({'top':'100px', 'left': '0px'}); Does the same thing. :-/ Karl On Oct 26, 2012, at 8:21 AM, David Hunter wrote: I'm on my first serious project using js. Some of it is pretty neat and simple and all the AS3 knowledge makes grabbing and treating elements (for animation and what not) very easy. I would definitely recommend using jQuery, and I am using jQuery Transit for some animations. However some of it baffles me, mainly stuff with CSS and positioning elements (which I thought I was OK with) and has added a lot of un-chargeable time. But in the long run I'm sure we will all adjust. I'd really like to learn to approach javascript from a class-based approach, so I must check out some of the links posted on this thread. Good luck to all making the transition! David On 25 October 2012 20:23, Karl DeSaulniers k...@designdrumm.com wrote: jQuery I think you will find is a very friendly language. Once you get into jQuery UI and jQuery animation, I think that is when your wheels will churn most. Best of luck! Karl On Oct 25, 2012, at 10:35 AM, Merrill, Jason wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-bounces@chattyfig.**figleaf.comflashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-bounces@**chattyfig.figleaf.comflashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com __**_ Flashcoders mailing list Flashcoders@chattyfig.figleaf.**com Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/**mailman/listinfo/flashcodershttp://chattyfig.figleaf.com/mailman/listinfo/flashcoders --**--** -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/**emaildisclaimerhttp://www.bankofamerica.com
Re: [Flashcoders] AS3
True enough - I keep hoping we'll get renewed interest in AIR apps on mobile, but the brand has taken such a beating no one seems willing to promote the usefulness of AIR that way. In my view, it's just as easy to make an awesome app experience in AIR as it has always been out of Flash Pro and/or with pure AS3 (not speaking about RIAs/Flex). It's not like there were ever great component tools out of Flash Pro (the ugly forms, bleh!), so we all have plenty of experience creating all that from scratch (and frankly I prefer that anyway). Nothing has changed for those of us who always used Flash that way. Add in Stage3D - the sky is the limit. It's just no one wants to hear about Flash anymore. But yeah, AS3 is still one of my favorite languages. TypeScript looks good, and I'd really love to dive into Google's Go Lang - that looks awesome! I'm stuck in hopeless PHP most of the time these days. :-/ Kevin N. On 10/26/12 4:54 PM, Merrill, Jason wrote: It's the platform that is taking the big hit (Flash player) therefore AS3 is decreasing in use because the platform is decreasing in use. It's not because AS3 lost favorability, the player did. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Well, got an update on the progress. First off, thank you all for your participation in helping me with my problem. Unfortunately this was a case of epic fail on my part. movieClipOverButtonitis was the disease. Seems the frame MC I had over the scene was blocking my button, so the code I wrote originally, now works. Instead I took the hole the frame made for the scene to show through. Filled it with red, deleted the frame and used the red box to mask the scene. Same effect, just no movieClip in the way... _ So if I wasted anyones time with this question, I deeply apologize. Thanks again people... YOU ROCK! Best Karl On Oct 24, 2012, at 5:43 PM, Karl DeSaulniers wrote: That didn't fix my problem. :( I got all excited too.. lol Karl On Oct 24, 2012, at 5:38 PM, Karl DeSaulniers wrote: I did start with a AS2 FLA and switched to AS3. So your saying the IDE does not add the appropriate stuff when you just convert? WTF! Good to know Kevin. Thanks Best, Karl On Oct 24, 2012, at 4:25 PM, Kevin Newman wrote: When I first started in AS3, there were two blocks that caught me up a lot. I started from an older AS2 FLA and then converted to AS3 - that was the cause of the problem. If you do that, you end up with an AS3 fla that doesn't have the right settings in the AS3 Properties panel. You won't have automatically declare stage instance set, or strict mode (you want both). Also, to get actual line numbers with errors, you'll need to check allow debugging in publish settings - I know it sounds like it's a permissions thing, but it really enables debugging symbols to be embedded in the swf, so that when you get an error, you'll actually get a useful error number with it. Good luck! Kevin N. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
No worries - we've all been there. On 25/10/2012 09:08, Karl DeSaulniers wrote: Well, got an update on the progress. First off, thank you all for your participation in helping me with my problem. Unfortunately this was a case of epic fail on my part. movieClipOverButtonitis was the disease. Seems the frame MC I had over the scene was blocking my button, so the code I wrote originally, now works. Instead I took the hole the frame made for the scene to show through. Filled it with red, deleted the frame and used the red box to mask the scene. Same effect, just no movieClip in the way... _ So if I wasted anyones time with this question, I deeply apologize. Thanks again people... YOU ROCK! Best Karl ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
And we'll be there again, I'm sure… :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure… :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Congratulations… John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 8:58 AM, Karl DeSaulniers wrote: Yay! I just completed my first AS3 job Go Me! :P ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
Hi Jason, Me too. :-) Be sure to look at http://www.greensock.com/get-started-js/ regards Cor van Dooren The Netherlands Merrill schreef: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
There are some things that are quite nice about JS, but it can be hard to get used to closures over classes, and that kind of thing. If you are looking for library suggestions, I loved Backbone.js, but Flex folks seem to prefer Angular.js. QUnit is actually a lot of fun too (I haven't found another Unit testing framework on other platforms that I like quite as much). One more unsolicited suggestion - add use strict; inside your JS files (inside a closure). This turns on some compiler like functionality in JS consoles, to cache typos and things like that, which normally fail silently. Also, you can enable stack traces in FireBug, if you are developing in Firefox (took me a while to find that). Good luck! Kevin N. On 10/25/12 11:35 AM, Merrill, Jason wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
or you can just turn it into an advanced language. https://github.com/neuromantic/CodeJS/blob/master/doc/README.markdown On Oct 25, 2012, at 11:35 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
Yeah, been looking to someday switch to Java and use GWT to export to Javascript but think it's wise to get really comfortable with JS first. I'm comfortable with the language, just haven't done much in the way of application yet. I've been programmed by a full 10 years of Actionscript. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Ross P. Sclafani Sent: Thursday, October 25, 2012 1:28 PM To: Flash Coders List Subject: Re: [Flashcoders] AS3 or you can just turn it into an advanced language. https://github.com/neuromantic/CodeJS/blob/master/doc/README.markdown On Oct 25, 2012, at 11:35 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended
Re: [Flashcoders] AS3
jQuery I think you will find is a very friendly language. Once you get into jQuery UI and jQuery animation, I think that is when your wheels will churn most. Best of luck! Karl On Oct 25, 2012, at 10:35 AM, Merrill, Jason wrote: I'm about to start my first HTML5/CSS3/Javascript job - wish me luck! :) Going through a lot of courses on Lynda.com - completed some Javascript courses and jQuery, now enjoying Lee Brimlow's HTML 5 For Flash Developers course right now. Good stuff - I wish Javascript was a more advanced language but it has some pretty cool features. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Karl DeSaulniers Sent: Thursday, October 25, 2012 9:59 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Yay! I just completed my first AS3 job Go Me! :P Best, Karl On Oct 25, 2012, at 8:48 AM, John R. Sweeney Jr. wrote: And we'll be there again, I'm sure... :) John John R. Sweeney Jr. Senior Interactive Multimedia Developer OnDemand Interactive Inc Hoffman Estates, IL 60169 On Oct 25, 2012, at 3:15 AM, Paul A. wrote: No worries - we've all been there. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com/emaildisclaimer. By messaging with Sender you consent to the foregoing. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Hi Karl, jus keep breathin;), this will pass and you'll never go back to as2 again;). Anyway on subject, have you tried out the standard SimpleButton class? If it doesnt fit your need, why not, maybe we can help with that, but that class should work for most simple cases. In addition, do you still use the Flash IDE? Since as3 offers so many options, here is just one of the possible ones that might fit your workflow: - create a basic button class, put all the buttonMode, handCursor etc stuff in there - add the eventlistener mumbojumbo in there as well, in short everything to create a button - if you want to implement the functionality for different states such as _up, _down etc go ahead and do so Now create a movieclip with timeline states _up, _down etc, and specify your button class as base class for this clip: -voila a button, you can do this with as many buttons as you like Of course if you'd rather keep the assets external that is possible as well, but it might require a slightly different setup. HTH, JC On 24-10-2012 14:33, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3
function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.bankofamerica.com
Re: [Flashcoders] AS3
On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have additional important disclosures and disclaimers, which you should read. This message
RE: [Flashcoders] AS3
Plus, anonymous functions can throw off your scope, so your buttons could fail... Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason Sent: Wednesday, October 24, 2012 9:43 AM To: Flash Coders List Subject: RE: [Flashcoders] AS3 function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America
RE: [Flashcoders] AS3
Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced
Re: [Flashcoders] AS3
anon functions benefit from coding speed and lose all benefits of static typing, this is why they are perfectly suited to javascript and poor tools in as3.0, although i try to avoid them in js also because i prefer code organization over script size -- i let uglify.js take care of that part. On Oct 24, 2012, at 10:08 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any
RE: [Flashcoders] AS3
That still isn't an argument to use them in my opinion, personally I think the code is much more convoluted that way. Your argument is essentially it's a preference in coding style, not that there are situations that specifically call for their use. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:19 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 On 24/10/2012 15:08, Merrill, Jason wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Sometimes (depending on what your buttons do), it seems rather artificial to have to fabricate a stand-alone function to handle an event when the action required is very simple. I used to always create named event handler functions and realised I was adopting some fixed pattern that was actually obfuscating my code unnecessarily in some situations. The OP was using an event handler simply to control the timeline and manufacturing a named function to do this very specific thing seems unnecessary. With an inline function you can see straight off what happens when the event is handled, without looking up the handler function to see what it does. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] AS3
On 24/10/2012 15:08, Merrill, Jason wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Sometimes (depending on what your buttons do), it seems rather artificial to have to fabricate a stand-alone function to handle an event when the action required is very simple. I used to always create named event handler functions and realised I was adopting some fixed pattern that was actually obfuscating my code unnecessarily in some situations. The OP was using an event handler simply to control the timeline and manufacturing a named function to do this very specific thing seems unnecessary. With an inline function you can see straight off what happens when the event is handled, without looking up the handler function to see what it does. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message
Re: [Flashcoders] AS3
Jason, I wasn't arguing anything except that IMHO using them makes code more readable in some circumstances. It's not an either/or. We can agree to differ. On 24/10/2012 15:23, Merrill, Jason wrote: That still isn't an argument to use them in my opinion, personally I think the code is much more convoluted that way. Your argument is essentially it's a preference in coding style, not that there are situations that specifically call for their use. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:19 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 On 24/10/2012 15:08, Merrill, Jason wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Sometimes (depending on what your buttons do), it seems rather artificial to have to fabricate a stand-alone function to handle an event when the action required is very simple. I used to always create named event handler functions and realised I was adopting some fixed pattern that was actually obfuscating my code unnecessarily in some situations. The OP was using an event handler simply to control the timeline and manufacturing a named function to do this very specific thing seems unnecessary. With an inline function you can see straight off what happens when the event is handled, without looking up the handler function to see what it does. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http
RE: [Flashcoders] AS3
Right, it's cool, we're on the same page, my only point is there is no functional reason to use them (no pun intended) and in my personal opinion, they have more potential to introduce problems. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:34 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Jason, I wasn't arguing anything except that IMHO using them makes code more readable in some circumstances. It's not an either/or. We can agree to differ. On 24/10/2012 15:23, Merrill, Jason wrote: That still isn't an argument to use them in my opinion, personally I think the code is much more convoluted that way. Your argument is essentially it's a preference in coding style, not that there are situations that specifically call for their use. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:19 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 On 24/10/2012 15:08, Merrill, Jason wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Sometimes (depending on what your buttons do), it seems rather artificial to have to fabricate a stand-alone function to handle an event when the action required is very simple. I used to always create named event handler functions and realised I was adopting some fixed pattern that was actually obfuscating my code unnecessarily in some situations. The OP was using an event handler simply to control the timeline and manufacturing a named function to do this very specific thing seems unnecessary. With an inline function you can see straight off what happens when the event is handled, without looking up the handler function to see what it does. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break
Re: [Flashcoders] AS3
Hi Karl, Hahahaha, AS3 is very much easier then AS2. But can be a little tricky to grasp when you are switching. Believe me, once you see the structure, you don't understand that AS2 has ever existed. First the Q: How do you use a button instead of a MC. There is no difference, they are both Objects with each some specific properties. The button is in fact a movieclip with just a timeline of 4 states. I recommend never to use Flash Components(!). Create youre own button or movieclip. When you create a graphic and transform (F8) it into a Symbol you can choose to set it as a MC or Button. I prefer MC always and write my own class to deal with the states. I will send you some examples in a following mail. In this mail I will address your code problem as is. I always look at code to see if something is redundant. So if there is ANYTHING I discover is present more then once, I create something so there is only 1 of it, and reuse that as often as needed. In your case I can't see if the buttons are put on stage phisically or with code. I always use code only, my stage stays empty and I have no frames on the timeline! My guess is that in this case the buttons are already on the stage, so I will set the code as follows: //put all the button names in this array var aButtons:Array = [ button1_btn, button2_btn]; var idx:int = -1; //no button selected yet for (var i:uint = 0; i aButtons.length; ++i){ aButtons[i].buttonMode = true; aButtons[i]..mouseChildren = false; aButtons[i].addEventListener(MouseEvent.CLICK, btnClickHandler, false, 0, true); aButtons[i].addEventListener(MouseEvent.ROLL_OVER, btnOverHandler, false, 0, true); aButtons[i].addEventListener(MouseEvent.ROLL_OUT, btnOutHandler, false, 0, true); } function btnClickHandler(e:MouseEvent):void{ //get the position in the array of the clicked button idx = aButtons.indexof(e.target); switch (idx) { case 0: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 1: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function btnOverHandler(e:MouseEvent):void { //get the position in the array of the clicked button idx = aButtons.indexof(e.target); //RENAME THE FRAME TO 'over' !! aButtons[idx].gotoAndStop(over); //toggle this button MC frame } function btnOutHandler(e:MouseEvent):void { //get the position in the array of the clicked button idx = aButtons.indexof(e.target); //RENAME THE FRAME TO 'out' !! aButtons[idx].gotoAndStop(out); //toggle this button MC frame } I typed this instantly in this mail, so watch for a possible typo? I go to dinner now, and create and send the promised examples after that. If you have problems with the code above, please tell me. For simplicity, I suggest mailing a FLA to eachother. regards Cor Karl DeSaulniers k...@designdrumm.com schreef: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] AS3
Thanks Paul.. I will try that. On Oct 24, 2012, at 7:33 AM, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Your not the only one who has said that about AS2.. lol I know nothing about any AS3 classes. Frankly they confuse me with the whole extend and static and public and aa! Makes my brain hurt just thinking about how I MUST learn them or fade into AS2 history. Karl On Oct 24, 2012, at 8:02 AM, Hans Wichman wrote: Hi Karl, jus keep breathin;), this will pass and you'll never go back to as2 again;). Anyway on subject, have you tried out the standard SimpleButton class? If it doesnt fit your need, why not, maybe we can help with that, but that class should work for most simple cases. In addition, do you still use the Flash IDE? Since as3 offers so many options, here is just one of the possible ones that might fit your workflow: - create a basic button class, put all the buttonMode, handCursor etc stuff in there - add the eventlistener mumbojumbo in there as well, in short everything to create a button - if you want to implement the functionality for different states such as _up, _down etc go ahead and do so Now create a movieclip with timeline states _up, _down etc, and specify your button class as base class for this clip: -voila a button, you can do this with as many buttons as you like Of course if you'd rather keep the assets external that is possible as well, but it might require a slightly different setup. HTH, JC On 24-10-2012 14:33, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance on, the information contained in or attached to this message is prohibited. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Sender. Subject to applicable law, Sender may intercept, monitor, review and retain e-communications (EC) traveling through its networks/systems and may produce any such EC to regulators, law enforcement, in litigation and as required by law. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or free of errors or viruses. References to Sender are references to any subsidiary of Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this EC may have
Re: [Flashcoders] AS3
I am glad I could get the blood stirring in this list again. :P Karl On Oct 24, 2012, at 10:02 AM, Merrill, Jason wrote: Right, it's cool, we're on the same page, my only point is there is no functional reason to use them (no pun intended) and in my personal opinion, they have more potential to introduce problems. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:34 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Jason, I wasn't arguing anything except that IMHO using them makes code more readable in some circumstances. It's not an either/or. We can agree to differ. On 24/10/2012 15:23, Merrill, Jason wrote: That still isn't an argument to use them in my opinion, personally I think the code is much more convoluted that way. Your argument is essentially it's a preference in coding style, not that there are situations that specifically call for their use. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:19 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] AS3 On 24/10/2012 15:08, Merrill, Jason wrote: Ok, what's a good case to use them? Just curious, I have never found a situation where they were warranted. Sometimes (depending on what your buttons do), it seems rather artificial to have to fabricate a stand-alone function to handle an event when the action required is very simple. I used to always create named event handler functions and realised I was adopting some fixed pattern that was actually obfuscating my code unnecessarily in some situations. The OP was using an event handler simply to control the timeline and manufacturing a named function to do this very specific thing seems unnecessary. With an inline function you can see straight off what happens when the event is handled, without looking up the handler function to see what it does. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 10:07 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 On 24/10/2012 14:43, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Really? I used to be of the same opinion, but certainly not as a blanket rule. It all depends. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers
Re: [Flashcoders] AS3
Thank you Cor! The buttons are MCs placed on the stage. At first they were Buttons, but when they wouldn't change even the states within the Button, so I converted them to MCs. Also, what does the , false, 0, true); do? Does it have to do with removing the listener? uhg im not going to sleep well tonight. Being that this is a clients FLA, I am not able to email my FLA. Will try your suggestions and let you know. Thank you! Best, Karl On Oct 24, 2012, at 10:51 AM, Cor wrote: Hi Karl, Hahahaha, AS3 is very much easier then AS2. But can be a little tricky to grasp when you are switching. Believe me, once you see the structure, you don't understand that AS2 has ever existed. First the Q: How do you use a button instead of a MC. There is no difference, they are both Objects with each some specific properties. The button is in fact a movieclip with just a timeline of 4 states. I recommend never to use Flash Components(!). Create youre own button or movieclip. When you create a graphic and transform (F8) it into a Symbol you can choose to set it as a MC or Button. I prefer MC always and write my own class to deal with the states. I will send you some examples in a following mail. In this mail I will address your code problem as is. I always look at code to see if something is redundant. So if there is ANYTHING I discover is present more then once, I create something so there is only 1 of it, and reuse that as often as needed. In your case I can't see if the buttons are put on stage phisically or with code. I always use code only, my stage stays empty and I have no frames on the timeline! My guess is that in this case the buttons are already on the stage, so I will set the code as follows: //put all the button names in this array var aButtons:Array = [ button1_btn, button2_btn]; var idx:int = -1; //no button selected yet for (var i:uint = 0; i aButtons.length; ++i){ aButtons[i].buttonMode = true; aButtons[i]..mouseChildren = false; aButtons[i].addEventListener(MouseEvent.CLICK, btnClickHandler, false, 0, true); aButtons[i].addEventListener(MouseEvent.ROLL_OVER, btnOverHandler, false, 0, true); aButtons[i].addEventListener(MouseEvent.ROLL_OUT, btnOutHandler, false, 0, true); } function btnClickHandler(e:MouseEvent):void{ //get the position in the array of the clicked button idx = aButtons.indexof(e.target); switch (idx) { case 0: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 1: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function btnOverHandler(e:MouseEvent):void { //get the position in the array of the clicked button idx = aButtons.indexof(e.target); //RENAME THE FRAME TO 'over' !! aButtons[idx].gotoAndStop(over); //toggle this button MC frame } function btnOutHandler(e:MouseEvent):void { //get the position in the array of the clicked button idx = aButtons.indexof(e.target); //RENAME THE FRAME TO 'out' !! aButtons[idx].gotoAndStop(out); //toggle this button MC frame } I typed this instantly in this mail, so watch for a possible typo? I go to dinner now, and create and send the promised examples after that. If you have problems with the code above, please tell me. For simplicity, I suggest mailing a FLA to eachother. regards Cor Karl DeSaulniers k...@designdrumm.com schreef: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so
Re: [Flashcoders] AS3
Hi Karl, when you are starting with as3: whatever works :)). Basically both will work (anon and nonanon (double wow)), but anonymous is harder (read impossible) to remove. So if you create a view that exists throughout the lifetime of the app, with buttons that do the same, either way will work. If you are creating and removing a lot of buttons, I'd skip anonymous, and nicely removely the listeners when done. button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); will not work because you are registering the result of the toggleB1(1) call, which in most cases will not be a function reference. What you wanted to do is something like the old as2 proxy or delegate call, which you can recreate in as3 and would result in something like: button1_btn.addEventListener(MouseEvent.ROLL_OUT, Proxy.create (toggleB1, [1])); Thing is, as3 is going to pass event objects as arguments as well, so this is getting more complicated than its worth real fast. But I would do myself a favor and pick up actionscript 3 essentials and actionscript 3 cookbook. Doesn't take too long to get through them and saves you a lot and a lt of frustration :) hth jc On 24-10-2012 21:49, Karl DeSaulniers wrote: OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you are not an intended recipient, please notify the sender, and then please delete and destroy all copies and attachments, and be advised that any review or dissemination of, or the taking of any action in reliance
Re: [Flashcoders] AS3
I've got Todd Perkins book But project is due today, so no time to read. Must dive head first into this empty pool. :P Karl On Oct 24, 2012, at 2:58 PM, Hans Wichman wrote: Hi Karl, when you are starting with as3: whatever works :)). Basically both will work (anon and nonanon (double wow)), but anonymous is harder (read impossible) to remove. So if you create a view that exists throughout the lifetime of the app, with buttons that do the same, either way will work. If you are creating and removing a lot of buttons, I'd skip anonymous, and nicely removely the listeners when done. button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); will not work because you are registering the result of the toggleB1(1) call, which in most cases will not be a function reference. What you wanted to do is something like the old as2 proxy or delegate call, which you can recreate in as3 and would result in something like: button1_btn.addEventListener(MouseEvent.ROLL_OUT, Proxy.create (toggleB1, [1])); Thing is, as3 is going to pass event objects as arguments as well, so this is getting more complicated than its worth real fast. But I would do myself a favor and pick up actionscript 3 essentials and actionscript 3 cookbook. Doesn't take too long to get through them and saves you a lot and a lt of frustration :) hth jc On 24-10-2012 21:49, Karl DeSaulniers wrote: OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- This message w/attachments (message) is intended solely for the use of the intended recipient(s) and may contain information that is privileged, confidential or proprietary. If you
Re: [Flashcoders] AS3
Karl DeSaulniers skriver: Thank you Cor! The buttons are MCs placed on the stage. At first they were Buttons, but when they wouldn't change even the states within the Button, so I converted them to MCs. Also, what does the , false, 0, true); do? Does it have to do with removing the listener? uhg im not going to sleep well tonight. It doesn't do anything in practice. It only matters if the listened to object is alive when the source of the listener isn't. Which almost never happens unless you are listening to the stage. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
So will this work? divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { this.gotoAndStop(OVER);}); I mean. Will this = divers_btn? or do I HAVE to specify divers_btn.gotoAndStop()? After all I am applying the listener to it. @jason Not that I am going to continue with annon functions, just currious. Basically, I am trying to set up the listener for the buttons to be generic for the buttons hover states. Then specify data for the click state per button. So if button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); doesnt work, how do I specify which frame to move to. Trying to set up a toggle if you will. I DONT want to have to create a function for EVERY state for EVERY button I have. That just seems stupid to me to have to do. Very bloated IMO. Best, Karl On Oct 24, 2012, at 2:58 PM, Hans Wichman wrote: Hi Karl, when you are starting with as3: whatever works :)). Basically both will work (anon and nonanon (double wow)), but anonymous is harder (read impossible) to remove. So if you create a view that exists throughout the lifetime of the app, with buttons that do the same, either way will work. If you are creating and removing a lot of buttons, I'd skip anonymous, and nicely removely the listeners when done. button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); will not work because you are registering the result of the toggleB1(1) call, which in most cases will not be a function reference. What you wanted to do is something like the old as2 proxy or delegate call, which you can recreate in as3 and would result in something like: button1_btn.addEventListener(MouseEvent.ROLL_OUT, Proxy.create (toggleB1, [1])); Thing is, as3 is going to pass event objects as arguments as well, so this is getting more complicated than its worth real fast. But I would do myself a favor and pick up actionscript 3 essentials and actionscript 3 cookbook. Doesn't take too long to get through them and saves you a lot and a lt of frustration :) hth jc On 24-10-2012 21:49, Karl DeSaulniers wrote: OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more
Re: [Flashcoders] AS3
Karl, , false, 0, true); I need the false, 0, to get to the third param. Which when set (weak reference) to true gives the garbage collector the oppurtunity to clear the listener and free up resources. Not necessary but I like to clean up. @Being that this is a clients FLA, I am not able to email my FLA. No no, I don't want you to send clients FLA, but create a mock up with the problem/question, which I can adjust and send back. This makes understanding the problem much easier. Sleep tight, don't let Cor ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
try this: divers_btn.addEventListener(MouseEvent.ROLL_OVER, function(e:MouseEvent):void { e.target.gotoAndStop(OVER);}); Karl DeSaulniers k...@designdrumm.com schreef: So will this work? divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { this.gotoAndStop(OVER);}); I mean. Will this = divers_btn? or do I HAVE to specify divers_btn.gotoAndStop()? After all I am applying the listener to it. @jason Not that I am going to continue with annon functions, just currious. Basically, I am trying to set up the listener for the buttons to be generic for the buttons hover states. Then specify data for the click state per button. So if button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); doesnt work, how do I specify which frame to move to. Trying to set up a toggle if you will. I DONT want to have to create a function for EVERY state for EVERY button I have. That just seems stupid to me to have to do. Very bloated IMO. Best, Karl On Oct 24, 2012, at 2:58 PM, Hans Wichman wrote: Hi Karl, when you are starting with as3: whatever works :)). Basically both will work (anon and nonanon (double wow)), but anonymous is harder (read impossible) to remove. So if you create a view that exists throughout the lifetime of the app, with buttons that do the same, either way will work. If you are creating and removing a lot of buttons, I'd skip anonymous, and nicely removely the listeners when done. button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); will not work because you are registering the result of the toggleB1(1) call, which in most cases will not be a function reference. What you wanted to do is something like the old as2 proxy or delegate call, which you can recreate in as3 and would result in something like: button1_btn.addEventListener(MouseEvent.ROLL_OUT, Proxy.create (toggleB1, [1])); Thing is, as3 is going to pass event objects as arguments as well, so this is getting more complicated than its worth real fast. But I would do myself a favor and pick up actionscript 3 essentials and actionscript 3 cookbook. Doesn't take too long to get through them and saves you a lot and a lt of frustration :) hth jc On 24-10-2012 21:49, Karl DeSaulniers wrote: OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things
Re: [Flashcoders] AS3
Thanks Henrik, Well for this, there are two buttons on stage. When you hover over one it makes a message appear, if the other another message appears. So if I dont use those, your saying that when I roll out, the listener is removed automatically? I dont want my project to make peoples computer fans start freaking out because of unremoved listeners. lol Best, Karl On Oct 24, 2012, at 3:11 PM, Henrik Andersson wrote: Karl DeSaulniers skriver: Thank you Cor! The buttons are MCs placed on the stage. At first they were Buttons, but when they wouldn't change even the states within the Button, so I converted them to MCs. Also, what does the , false, 0, true); do? Does it have to do with removing the listener? uhg im not going to sleep well tonight. It doesn't do anything in practice. It only matters if the listened to object is alive when the source of the listener isn't. Which almost never happens unless you are listening to the stage. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
On 24/10/2012 21:13, Karl DeSaulniers wrote: So will this work? divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { this.gotoAndStop(OVER);}); I mean. Will this = divers_btn? or do I HAVE to specify divers_btn.gotoAndStop()? My bad, you're right. I put divers_btn because button1 means nothing, so use meaningful names - always. Use labels rather than fixed frame numbers. divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Karl DeSaulniers skriver: Thanks Henrik, Well for this, there are two buttons on stage. When you hover over one it makes a message appear, if the other another message appears. So if I dont use those, your saying that when I roll out, the listener is removed automatically? I am saying that the last argument to addEventListener becomes irrelevant. the argument only matters if the listener function has captured a reference to its original scope (shown as savedThis in the debugger) (the class instance it came from) AND the original scope has no more live references to it AND the listened to object is live. This is irrelevant, since in nearly all cases the original scope was the one who created the listened to object in the first place and as such both will die at the same time. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
if you were writing as2 without extending classes etc, why arent you just working in JS, its the new hot chick on the block, afterall... On Oct 24, 2012, at 3:45 PM, Karl DeSaulniers k...@designdrumm.com wrote: Your not the only one who has said that about AS2.. lol I know nothing about any AS3 classes. Frankly they confuse me with the whole extend and static and public and aa! Makes my brain hurt just thinking about how I MUST learn them or fade into AS2 history. Karl On Oct 24, 2012, at 8:02 AM, Hans Wichman wrote: Hi Karl, jus keep breathin;), this will pass and you'll never go back to as2 again;). Anyway on subject, have you tried out the standard SimpleButton class? If it doesnt fit your need, why not, maybe we can help with that, but that class should work for most simple cases. In addition, do you still use the Flash IDE? Since as3 offers so many options, here is just one of the possible ones that might fit your workflow: - create a basic button class, put all the buttonMode, handCursor etc stuff in there - add the eventlistener mumbojumbo in there as well, in short everything to create a button - if you want to implement the functionality for different states such as _up, _down etc go ahead and do so Now create a movieclip with timeline states _up, _down etc, and specify your button class as base class for this clip: -voila a button, you can do this with as many buttons as you like Of course if you'd rather keep the assets external that is possible as well, but it might require a slightly different setup. HTH, JC On 24-10-2012 14:33, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
That kinda made sense. Will have to read about 5 more times though.. lol :P thanks Henrik. Time to go vote. I will be back later to see if I can pull an elephant out my WHOO HOO. Best, Karl On Oct 24, 2012, at 3:32 PM, Henrik Andersson wrote: Karl DeSaulniers skriver: Thanks Henrik, Well for this, there are two buttons on stage. When you hover over one it makes a message appear, if the other another message appears. So if I dont use those, your saying that when I roll out, the listener is removed automatically? I am saying that the last argument to addEventListener becomes irrelevant. the argument only matters if the listener function has captured a reference to its original scope (shown as savedThis in the debugger) (the class instance it came from) AND the original scope has no more live references to it AND the listened to object is live. This is irrelevant, since in nearly all cases the original scope was the one who created the listened to object in the first place and as such both will die at the same time. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3
Ok, I tried suggestions and things are still not working. The hand cursor doesn't even show. Here is the set up Scene 2 - frame 1 : Main MC - Scene2MC frame 96: Layer 1 : (Actions were working on) Layer 2: button1_btn Layer 3: button2_btn with the way I am referencing button1_btn and button2_btn, could it be that they are not recieving the scope? Do I need to point them like this.Scene2MC.button1_btn.addListener(... I thought not, because the actions and the button are inside Scene2MC I may just have to pass on this job. I cant even get buttons to work.. lol Best, Karl On Oct 24, 2012, at 3:13 PM, Karl DeSaulniers wrote: So will this work? divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { this.gotoAndStop(OVER);}); I mean. Will this = divers_btn? or do I HAVE to specify divers_btn.gotoAndStop()? After all I am applying the listener to it. @jason Not that I am going to continue with annon functions, just currious. Basically, I am trying to set up the listener for the buttons to be generic for the buttons hover states. Then specify data for the click state per button. So if button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); doesnt work, how do I specify which frame to move to. Trying to set up a toggle if you will. I DONT want to have to create a function for EVERY state for EVERY button I have. That just seems stupid to me to have to do. Very bloated IMO. Best, Karl On Oct 24, 2012, at 2:58 PM, Hans Wichman wrote: Hi Karl, when you are starting with as3: whatever works :)). Basically both will work (anon and nonanon (double wow)), but anonymous is harder (read impossible) to remove. So if you create a view that exists throughout the lifetime of the app, with buttons that do the same, either way will work. If you are creating and removing a lot of buttons, I'd skip anonymous, and nicely removely the listeners when done. button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); will not work because you are registering the result of the toggleB1(1) call, which in most cases will not be a function reference. What you wanted to do is something like the old as2 proxy or delegate call, which you can recreate in as3 and would result in something like: button1_btn.addEventListener(MouseEvent.ROLL_OUT, Proxy.create (toggleB1, [1])); Thing is, as3 is going to pass event objects as arguments as well, so this is getting more complicated than its worth real fast. But I would do myself a favor and pick up actionscript 3 essentials and actionscript 3 cookbook. Doesn't take too long to get through them and saves you a lot and a lt of frustration :) hth jc On 24-10-2012 21:49, Karl DeSaulniers wrote: OH? What is the best coding standards way? I used an annon function because button1_btn.addEventListener(MouseEvent.ROLL_OUT, toggleB1(1)); Does not work. Karl On Oct 24, 2012, at 8:43 AM, Merrill, Jason wrote: function() { gotoAndStop(divinedivers); }); Yeah, this is weird and unnecessary. Anonymous functions are recommended against in AS3. Jason Merrill Instructional Technology Architect II Bank of America Global Learning 703.302.9265 (w/h) ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com ] On Behalf Of Paul A. Sent: Wednesday, October 24, 2012 8:33 AM To: Flash Coders List Subject: Re: [Flashcoders] AS3 Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener
Re: [Flashcoders] AS3
Already have Javascript and jQuery under belt. (well mostly) This job is primarily AS3 so I thought I'd give it a try. Karl On Oct 24, 2012, at 3:35 PM, Ross P. Sclafani wrote: if you were writing as2 without extending classes etc, why arent you just working in JS, its the new hot chick on the block, afterall... On Oct 24, 2012, at 3:45 PM, Karl DeSaulniers k...@designdrumm.com wrote: Your not the only one who has said that about AS2.. lol I know nothing about any AS3 classes. Frankly they confuse me with the whole extend and static and public and aa! Makes my brain hurt just thinking about how I MUST learn them or fade into AS2 history. Karl On Oct 24, 2012, at 8:02 AM, Hans Wichman wrote: Hi Karl, jus keep breathin;), this will pass and you'll never go back to as2 again;). Anyway on subject, have you tried out the standard SimpleButton class? If it doesnt fit your need, why not, maybe we can help with that, but that class should work for most simple cases. In addition, do you still use the Flash IDE? Since as3 offers so many options, here is just one of the possible ones that might fit your workflow: - create a basic button class, put all the buttonMode, handCursor etc stuff in there - add the eventlistener mumbojumbo in there as well, in short everything to create a button - if you want to implement the functionality for different states such as _up, _down etc go ahead and do so Now create a movieclip with timeline states _up, _down etc, and specify your button class as base class for this clip: -voila a button, you can do this with as many buttons as you like Of course if you'd rather keep the assets external that is possible as well, but it might require a slightly different setup. HTH, JC On 24-10-2012 14:33, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Karl DeSaulniers Design Drumm
Re: [Flashcoders] AS3
as3 is so great. you should heed other's warning about never being able to look back. i love the language so much, i rewrote it in javascript pretty much. i even ported my classical inheritance engine to Node.js then i recreated most of the the Flash API, but im less sold now that mimicking the displaylist in the DOM has a clear advantage over using the document box model and stylesheets. On Oct 24, 2012, at 4:39 PM, Karl DeSaulniers k...@designdrumm.com wrote: Already have Javascript and jQuery under belt. (well mostly) This job is primarily AS3 so I thought I'd give it a try. Karl On Oct 24, 2012, at 3:35 PM, Ross P. Sclafani wrote: if you were writing as2 without extending classes etc, why arent you just working in JS, its the new hot chick on the block, afterall... On Oct 24, 2012, at 3:45 PM, Karl DeSaulniers k...@designdrumm.com wrote: Your not the only one who has said that about AS2.. lol I know nothing about any AS3 classes. Frankly they confuse me with the whole extend and static and public and aa! Makes my brain hurt just thinking about how I MUST learn them or fade into AS2 history. Karl On Oct 24, 2012, at 8:02 AM, Hans Wichman wrote: Hi Karl, jus keep breathin;), this will pass and you'll never go back to as2 again;). Anyway on subject, have you tried out the standard SimpleButton class? If it doesnt fit your need, why not, maybe we can help with that, but that class should work for most simple cases. In addition, do you still use the Flash IDE? Since as3 offers so many options, here is just one of the possible ones that might fit your workflow: - create a basic button class, put all the buttonMode, handCursor etc stuff in there - add the eventlistener mumbojumbo in there as well, in short everything to create a button - if you want to implement the functionality for different states such as _up, _down etc go ahead and do so Now create a movieclip with timeline states _up, _down etc, and specify your button class as base class for this clip: -voila a button, you can do this with as many buttons as you like Of course if you'd rather keep the assets external that is possible as well, but it might require a slightly different setup. HTH, JC On 24-10-2012 14:33, Paul A. wrote: Try removing: button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; Your code is a bit convoluted! divers_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(divinedivers); }); scuba_btn.addEventListener(MouseEvent.CLICK, function() { gotoAndStop(scubadudes); }); divers_btn.addEventListener(MouseEvent.ROLL_OVER, function() { divers_btn.gotoAndStop(OVER);}); .. Paul On 24/10/2012 12:39, Karl DeSaulniers wrote: Hello All, Long time. If your available at the moment, I could use your help with some AS3. I finally got an AS3 job! Yay! But I am stuck on the most simple of things. All I am trying to do is make some buttons work... lol Here is my code. button1_btn.buttonMode = true; button2_btn.buttonMode = true; button1_btn.useHandCursor = true; button2_btn.useHandCursor = true; button1_btn.mouseChildren = false; button2_btn.mouseChildren = false; button1_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(1); }); button2_btn.addEventListener(MouseEvent.CLICK, function() { changeSelect(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB1(2); }); button2_btn.addEventListener(MouseEvent.ROLL_OVER, function() { toggleB2(2); }); button1_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB1(1); }); button2_btn.addEventListener(MouseEvent.ROLL_OUT, function() { toggleB2(1); }); function changeSelect(p):void { switch (p) { case 1: this.gotoAndStop(divinedivers); //goto frame divinedivers in this MC break; case 2: this.gotoAndStop(scubadudes); //got frame scubadudes in this MC break; } } function toggleB1(f):void { button1_btn.gotoAndStop(f); //toggle this button MC frame } function toggleB2(f):void { button2_btn.gotoAndStop(f); //toggle this button MC frame } Why does AS3 have to make things so difficult for something so simple?? What the heck am I doing wrong??? Also, how do you use just a button instead of a mc? I tried using just a button and it wouldn't even switch to the over state that is inside the button!!? AS2 is just so much more simple... sigh* TIA, Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders