Re: [Flashcoders] code review
also, have you put text in p_1 already? Because the order that Flash wants is you setTextFormat on the text field, and then you put the text in it. HTH Gabino Really? I thought it was the other way around - put text in, then set the format, *unless* you are using TextField.setNewTextFormat... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] code review
Hi, It is the other way around. setTextFormat is for formatting text currently in the textfield (optionally text in the textfield within a certain range), and setNewTextFormat is for text prepended to the current contents of the textfield (either prepended by script or by the user in case of input fields). Regards, Morten -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter B Sent: Wednesday, April 16, 2008 5:23 PM To: Flash Coders List Subject: Re: [Flashcoders] code review also, have you put text in p_1 already? Because the order that Flash wants is you setTextFormat on the text field, and then you put the text in it. HTH Gabino Really? I thought it was the other way around - put text in, then set the format, *unless* you are using TextField.setNewTextFormat... ___ 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] code review
Oh, right. I never use setTextFormat, I always create the text box, format it and put the text in. public static function makeTextField(x:Float,y:Float,w:Float,h:Float,f:String, s:Float,rgb,t:String){ var newDepth=flash.Lib.current.getNextHighestDepth(); var tf2 =flash.Lib.current.createTextField(tf2,newDepth,x,y,w,h); tf2.selectable=false; tf2.wordWrap=true; tf2.embedFonts=true; tf2.setNewTextFormat(new TextFormat(f,s,rgb)); tf2.text=t; } The above is written in haXe, so it mgiht not make sense. Sorry about the misinformation, Theodore. - Original Message - From: Morten Barklund [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, April 16, 2008 10:33 AM Subject: RE: [Flashcoders] code review Hi, It is the other way around. setTextFormat is for formatting text currently in the textfield (optionally text in the textfield within a certain range), and setNewTextFormat is for text prepended to the current contents of the textfield (either prepended by script or by the user in case of input fields). Regards, Morten -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter B Sent: Wednesday, April 16, 2008 5:23 PM To: Flash Coders List Subject: Re: [Flashcoders] code review also, have you put text in p_1 already? Because the order that Flash wants is you setTextFormat on the text field, and then you put the text in it. HTH Gabino Really? I thought it was the other way around - put text in, then set the format, *unless* you are using TextField.setNewTextFormat... ___ 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] code review
What is wrong with this code: for (i=1; i6; i++) { _root.main_content[p_+i].setTextFormat(portNavOff); } P_1, p_2, are dynamic text fields. Should this be working or can I not target a text field like this? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] code review
Your code is correct and yes you can access text fields like that. I would double check that main_content is named correctly as well as the text fields. On Tue, Apr 15, 2008 at 11:13 AM, Lehr, Theodore M (N-SGIS) [EMAIL PROTECTED] wrote: What is wrong with this code: for (i=1; i6; i++) { _root.main_content[p_+i].setTextFormat(portNavOff); } P_1, p_2, are dynamic text fields. Should this be working or can I not target a text field like this? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- ...helmut ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] code review
Hi Theodore Have you tried it without the loop? i=1; _root.main_content[p_+i].setTextFormat(portNavOff); _root.main_content[p_+i].text=hello world!; also, have you put text in p_1 already? Because the order that Flash wants is you setTextFormat on the text field, and then you put the text in it. HTH Gabino - Original Message - From: Lehr, Theodore M (N-SGIS) [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Tuesday, April 15, 2008 10:13 AM Subject: [Flashcoders] code review What is wrong with this code: for (i=1; i6; i++) { _root.main_content[p_+i].setTextFormat(portNavOff); } P_1, p_2, are dynamic text fields. Should this be working or can I not target a text field like this? ___ 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] code review
apart from the _root reference whichis never a good idea check you lower-case / upper-case naming on your textfield Flash will treat P_1 and p_1 as different fields. in your loop your only mapping references to p_1, p_2, p_3 ... etc etc and fields named P_1, P_2, P_3 ... etc will never be referenced Pete -Original Message- From: [EMAIL PROTECTED] on behalf of Lehr, Theodore M (N-SGIS) Sent: Tue 15/04/2008 17:13 To: Flash Coders List Subject: [Flashcoders] code review What is wrong with this code: for (i=1; i6; i++) { _root.main_content[p_+i].setTextFormat(portNavOff); } P_1, p_2, are dynamic text fields. Should this be working or can I not target a text field like this? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Code review, please
If you aren't you should Knee jerk reaction: Nobody should use any pattern. They CAN use patterns if it benefits the project, benefits their mental health and provides for a better product. I probably read too much into it but pattern worship is useless, crippling and annoying. - A Per Bolmstedt wrote: Anggie Bratadinata wrote: This is the simple app I created a few days ago, about which I'd like to have your expert advice on how to improve it or maybe how to code it in a much better way. 1. Comment your code! It looks structured enough, so adding comments should be easy. If you use FDT, using Javadoc is straightforward: http://java.sun.com/j2se/javadoc/writingdoccomments/ 2. Are you using the MVC pattern? It's not really clear from the code, but it looks somewhat like it. If you aren't you should; if you are, maybe you could make it more clear, by changing class names, adding an interface or two, or adding comments. 3. What's hl.as? It's an ill chosen file/class name. -- Per ___ 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 -- - Andreas Rønning --- Flash guy Rayon Visual Concepts, Oslo, Norway --- ___ 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
Re: [Flashcoders] Code review, please
Hear hear. Patterns are no magic bullet. Alias On 25/09/06, Andreas Rønning [EMAIL PROTECTED] wrote: If you aren't you should Knee jerk reaction: Nobody should use any pattern. They CAN use patterns if it benefits the project, benefits their mental health and provides for a better product. I probably read too much into it but pattern worship is useless, crippling and annoying. - A Per Bolmstedt wrote: Anggie Bratadinata wrote: This is the simple app I created a few days ago, about which I'd like to have your expert advice on how to improve it or maybe how to code it in a much better way. 1. Comment your code! It looks structured enough, so adding comments should be easy. If you use FDT, using Javadoc is straightforward: http://java.sun.com/j2se/javadoc/writingdoccomments/ 2. Are you using the MVC pattern? It's not really clear from the code, but it looks somewhat like it. If you aren't you should; if you are, maybe you could make it more clear, by changing class names, adding an interface or two, or adding comments. 3. What's hl.as? It's an ill chosen file/class name. -- Per ___ 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 -- - Andreas Rønning --- Flash guy Rayon Visual Concepts, Oslo, Norway --- ___ 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@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
Re: [Flashcoders] Code review, please
1. Comment your code! Ah, yes, of course. Sorry about that. I'll comment it right away. 2. Are you using the MVC pattern? It's not really clear from the code, but it looks somewhat like it nope, I don't use pattern. I just want to make the HistoryList and HistoryItem 'talk' to each other. I don't know anything about pattern (I've just started reading Headfirst DP book). 3. What's hl.as? It's an ill chosen file/class name. Oops, my bad ... It shouldn't be there! It's the external .as that I included in the first (procedural) version of my app. Thanks, -- Anggie Bratadinata Web|Graphic|Flash Jl. Raya Langsep 21 Malang - East Java I N D O N E S I A http://design.ibshastautama.com Per Bolmstedt wrote: Anggie Bratadinata wrote: This is the simple app I created a few days ago, about which I'd like to have your expert advice on how to improve it or maybe how to code it in a much better way. 1. Comment your code! It looks structured enough, so adding comments should be easy. If you use FDT, using Javadoc is straightforward: http://java.sun.com/j2se/javadoc/writingdoccomments/ 2. Are you using the MVC pattern? It's not really clear from the code, but it looks somewhat like it. If you aren't you should; if you are, maybe you could make it more clear, by changing class names, adding an interface or two, or adding comments. 3. What's hl.as? It's an ill chosen file/class name. -- Per ___ 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] Code review, please
Folks, I hope it's okay for a noob like me to ask for a code review here. If not, sorry for the noise. This is the simple app I created a few days ago, about which I'd like to have your expert advice on how to improve it or maybe how to code it in a much better way. http://www.masputih.com/files/flash/undoredo2/undo_redo2.swf http://www.masputih.com/files/flash/undoredo2/undo_redo2.zip I know it looks like a piece of junk to most of you but, hey, that's why I need your advice. :-) Thanks in advance, ___ 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
Re: [Flashcoders] Code review, please
Anggie Bratadinata wrote: This is the simple app I created a few days ago, about which I'd like to have your expert advice on how to improve it or maybe how to code it in a much better way. 1. Comment your code! It looks structured enough, so adding comments should be easy. If you use FDT, using Javadoc is straightforward: http://java.sun.com/j2se/javadoc/writingdoccomments/ 2. Are you using the MVC pattern? It's not really clear from the code, but it looks somewhat like it. If you aren't you should; if you are, maybe you could make it more clear, by changing class names, adding an interface or two, or adding comments. 3. What's hl.as? It's an ill chosen file/class name. -- Per ___ 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