Re: [Flashcoders] Get Original Variable's Name in Function?
On 5/30/06, Doug Coning [EMAIL PROTECTED] wrote: function myFunct(str:String){ // GET ORIGINAL NAME of str? } var foo:String = ABC; var moo:String = DEF; myFunct(foo); myFunct(moo); In the above, how can myFunct know that the first call was sent 'foo' and the second call was sent 'moo'? I guess the easiest way is to pass a string reference: function myFunct(str:String, varName:String){ trace(varName+ has value of +str); } var foo:String = ABC; var moo:String = DEF; myFunct(foo, foo); myFunct(moo, moo); That probably isn't what you're trying to achieve though. What exactly are you trying to do? Tim ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] How to get colour of text formatted with CSS
Hi Does anyone know if it's possible to read the text colour specified in an externally loaded CSS style? Cheers Tim ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to get colour of text formatted with CSS
Excellent, thanks Nikolaj On 11/29/05, Nikolaj Selvik [EMAIL PROTECTED] wrote: var yourStyle:Object = yourStyleSheet.getStyle(yourStyleName); then get yourStyle.[color]; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Stickland Sent: den 29 november 2005 14:14 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] How to get colour of text formatted with CSS Hi Does anyone know if it's possible to read the text colour specified in an externally loaded CSS style? Cheers Tim ___ 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] AS2, compiler errors...
Hi Greg Thanks for the reply, but I don't think either of these are the issues. This is the constructor of UserInteractionPanel: public function UserInteractionPanel (controller:PanelController, panelObj:Object) {} And here's a version of GameoverPanel with all but the constructor removed: class GameoverPanel extends UserInteractionPanel { public function GameoverPanel(controller:PanelController, panelObj:Object) { // Call the super() constructor passing it the panel object. super(controller, panelObj); // Populate the panel contents. this.populatePanel(); } } Any other ideas? I seem unable to ever create a project involving AS2 classes without getting syntax errors when error checking. These often don't stop the classes compiling and the application running properly, but they're a pain. Cheers Tim On 11/17/05, Gregory_GOusable [EMAIL PROTECTED] wrote: Check the following: 1) class GameoverPanel extends UserInteractionPanel ... Make sure you have extends word 2) To use super(controller, panelObj); , you must have 2 parameters in the construstor of UserInteractionPanel class. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2, compiler errors...
True to form (in my experience anyway), I've just gone in to the classes to amend them using some of your suggestions and they're now not throwing any errors... I just don't get it. One thing that I noticed in your example code was that you called methods of the parent class using super.method() rather than this.method(). I wasn't aware you could do that, but it certainly makes reading the code more straightforward. Thanks! On 11/17/05, NEILHIGHLEY.COM http://NEILHIGHLEY.COM [EMAIL PROTECTED] wrote: All I can think of is that there may be an error prior to the 'super' one that flash is airbrushing. Also try using : super.constructor.apply(this, arguments); for the constructor instead. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS2, compiler errors...
Absolutely, but I'd never have been trapped as I didn't understand overriding properly ;) I wasn't aware that when a subclass overrides a superclass method it leaves the superclass method intact. Is that correct? On 11/17/05, Ian Thomas [EMAIL PROTECTED] wrote: Not just more readable - consider the case where you're overriding something: class A { public function doSomething() { trace(Something in A); } } class B extends A { public function doSomething() { super.doSomething(); trace(Something in B); } } In this situation, using super.method() lets you call the parent implementation of the method you're currently in. If you were limited to this.method(), then you'd be trapped in an infinitely recursive loop as the method kept calling itself... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders