Re: [Flashcoders] using "this" in AS3 classes?
You need the this in any case the scope of the variable or method is not clear. In all other cases the this is not necessary. I don't use it. Tools such as FDT highlight instance properties differently to local or argument variables. This makes it easy to visually detect the scope of a property even if no this is in use. public var value : String = ""; public function setValue(value : String) : void { this.value = value; } Am 08.06.2011 08:06, schrieb Cor: Micky, There are no stupid questions! Only stupid people who don't ask their question... and yes, there are stupid answers. :-) As for the prefix, IMO it is unnecessary, but some people find it easier to read their code. I'll will not call myself a pro, but I never use it. HTH, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Micky Hulse Sent: woensdag 8 juni 2011 6:55 To: Flash Coders List Subject: [Flashcoders] using "this" in AS3 classes? Hi, Stupid question, but... Let's say I have some class properties: private var _mc1:MovieClip; private var _mc2:MovieClip; ... and methods: private function baz():void { ... } private function foo():void { ... } In my code, would it be overkill to always reference the above examples with a prefix of "this"? For example: this._mc1 = ...; this._mc2 = this.mc1; this.baz(); this.foo(); I could easily do this instead: _mc1 = ...; _mc2 = mc1; baz(); foo(); Sorry if silly question, I am just kinda wondering what the pros do. :) Best practices? Thanks! Micky ___ 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] using "this" in AS3 classes?
Micky, There are no stupid questions! Only stupid people who don't ask their question... and yes, there are stupid answers. :-) As for the prefix, IMO it is unnecessary, but some people find it easier to read their code. I'll will not call myself a pro, but I never use it. HTH, Cor -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Micky Hulse Sent: woensdag 8 juni 2011 6:55 To: Flash Coders List Subject: [Flashcoders] using "this" in AS3 classes? Hi, Stupid question, but... Let's say I have some class properties: private var _mc1:MovieClip; private var _mc2:MovieClip; ... and methods: private function baz():void { ... } private function foo():void { ... } In my code, would it be overkill to always reference the above examples with a prefix of "this"? For example: this._mc1 = ...; this._mc2 = this.mc1; this.baz(); this.foo(); I could easily do this instead: _mc1 = ...; _mc2 = mc1; baz(); foo(); Sorry if silly question, I am just kinda wondering what the pros do. :) Best practices? Thanks! Micky ___ 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] XML Gallery Viewer
Jason I knew all this but I was hoping to save time. Thanks On Tue, Jun 7, 2011 at 5:50 PM, Merrill, Jason < jason.merr...@bankofamerica.com> wrote: > >> but I need to have the fla source file to modify the code > > I think a better approach is to: > > 1. Learn how to load XML and get the data. > 2. Learn how to create display objects with code, animate and present them. > 3. Learn how to load external images. > > > Jason Merrill > Instructional Technology Architect > Bank of America Global Learning > > > > > > ___ > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com [mailto: > flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Bassam M > Sent: Tuesday, June 07, 2011 3:24 AM > To: Flash Coders List > Subject: [Flashcoders] XML Gallery Viewer > > Hi Guys > I need AS2 xml gallery viewer, it should be thumbnail and big image > something like this http://www.flashgallery.org/demo.html > but I need to have the fla source file to modify the code > > Thanks > Bassam > ___ > 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
[Flashcoders] using "this" in AS3 classes?
Hi, Stupid question, but... Let's say I have some class properties: private var _mc1:MovieClip; private var _mc2:MovieClip; ... and methods: private function baz():void { ... } private function foo():void { ... } In my code, would it be overkill to always reference the above examples with a prefix of "this"? For example: this._mc1 = ...; this._mc2 = this.mc1; this.baz(); this.foo(); I could easily do this instead: _mc1 = ...; _mc2 = mc1; baz(); foo(); Sorry if silly question, I am just kinda wondering what the pros do. :) Best practices? Thanks! Micky ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] dynmically adding waves together problem
I draw my wave with this class: package com.codobyte.display{ /* @class: Sinus @author:Cor van Dooren @usage: Draw sinus dynamically @syntax:var s:Sinus= new Sinus(params); @params:positieX:int=0, positieY:int=200, lengte:int=200, hoogte:int=200, kleur:uint=0x00, lijndikte:int=2 @methods: s.startWave(); s.stopWave(); */ import flash.display.*; import flash.events.*; public class Sinus extends Sprite { private var positieX:int; private var positieY:int; private var hoogte:int; private var lengte:int; private var kleur:uint; private var lijndikte:int; private var val:int; public function Sinus(positieX:int=0, positieY:int=200, lengte:int=200, hoogte:int=200, kleur:uint=0x00, lijndikte:int=2) { this.positieX=positieX; this.positieY= positieY; this.lengte= lengte; this.hoogte= hoogte; this.kleur= kleur; this.lijndikte=lijndikte; val=0; if (stage) { init(null); } else { addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true); } }//end CONSTRUCTOR private function init(e:Event):void { removeEventListener(Event.ADDED_TO_STAGE, init); graphics.lineStyle(lijndikte, kleur); graphics.moveTo(positieX, positieY); addEventListener(Event.REMOVED_FROM_STAGE, stopWave, false,0,true); } public function startWave():void { addEventListener(Event.ENTER_FRAME, enterframe, false, 0, true); } public function stopWave():void { removeEventListener(Event.ENTER_FRAME, enterframe); removeEventListener(Event.REMOVED_FROM_STAGE, stopWave); } private function enterframe(e:Event):void { tekenSinus(val+=2); } private function tekenSinus(psdValue:int):void { graphics.lineTo(positieX+psdValue+2, positieY+hoogte*Math.sin(psdValue*360/lengte * Math.PI/180)); } } } So how would I fit this in? Reagrds, Cor van Dooren -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steve Abaffy Sent: maandag 6 juni 2011 21:41 To: 'Flash Coders List' Subject: RE: [Flashcoders] dynmically adding waves together problem It would seem to me that you are drawing the two waves with some kind of sine function. Y1 = Sin(x1+Phase1) Y2 = Sin(x2+Phase2) So all you have do to create the third is Y3 = Sin(x1+Phase1) + Sin(x2+Phase2) Remember of course that Y3 will have a max/min of +2/-2 assuming of course that originals are +1/-1 range as they should be with no amplitude adjustment. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor Sent: Monday, June 06, 2011 2:16 PM To: Flash Coders List Subject: [Flashcoders] dynmically adding waves together problem Hi All, I need to draw waves dynamically which can be influenced at runtime. These waves then have to add together and show the result in a third wave. Here you can see the problem graphically: http://www.codobyte.com/waves/ Every help is welcome! TIA, Cor van Dooren ___ 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] XML Gallery Viewer
>> but I need to have the fla source file to modify the code I think a better approach is to: 1. Learn how to load XML and get the data. 2. Learn how to create display objects with code, animate and present them. 3. Learn how to load external images. Jason Merrill Instructional Technology Architect Bank of America Global Learning ___ -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Bassam M Sent: Tuesday, June 07, 2011 3:24 AM To: Flash Coders List Subject: [Flashcoders] XML Gallery Viewer Hi Guys I need AS2 xml gallery viewer, it should be thumbnail and big image something like this http://www.flashgallery.org/demo.html but I need to have the fla source file to modify the code Thanks Bassam ___ 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] Haxe for Mac
Hi, I am working on an application which run on windows and MAC os x. I am using swfmill and haxe to generate swf file in my application. The application is working fine on windows. I need swfmill and haxe for mac os x. Can anybody help me out. Thanks Tarjinder ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] XML Gallery Viewer
google is your friend try.. "Flash AS2 xml gallery example" Best, Karl On Jun 7, 2011, at 2:24 AM, Bassam M wrote: Hi Guys I need AS2 xml gallery viewer, it should be thumbnail and big image something like this http://www.flashgallery.org/demo.html but I need to have the fla source file to modify the code Thanks Bassam ___ 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] XML Gallery Viewer
Hi Guys I need AS2 xml gallery viewer, it should be thumbnail and big image something like this http://www.flashgallery.org/demo.html but I need to have the fla source file to modify the code Thanks Bassam ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders