[Flashcoders] Basic idea to use xml in flash

2005-10-29 Thread Waseem Shahzad
Hello All members hope you are fine. I have a problem that I am novice in the world of flash but not so much but I think that you are all too much seniors from me in flash knowledge I want too much from flash please guide me and tell me a better way to have a nice grip on actionscripting, I'll be

[Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread Costello, Rob R
yes, this is true in ActionScript referencing or instantiating a singleton class via a static getInstance method, is a different matter to all methods of a class being static The former is calling an instance method and the latter is calling a static method. Instance methods

Re: [Flashcoders] setInterval() and the trouble

2005-10-29 Thread Liam Morley
I imagine you're calling clearInterval with the appropriate interval ID upon each quiz question submittal, and then afterwards recalling setInterval for the new question? How does it fail the second time? Does it just never call it again, or does it call the function at a different interval? Liam

RE: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread zwetan
No need to get hyper about this. The matter stays that this used to be essential in AS1, thus probably why people still like to implicate him in their code. But I agree that putting this in an AS2 Class should be used only when necessary. You do know that it (this.) is being added for

[Flashcoders] How to make a doughnut?

2005-10-29 Thread Navneet Behal
After putting a couple of hours on the problem, I am still in a daze on how would one go about making a doughnut shape (circle with cut-out in the center) using the drawing API. I'm not talking about drawing a circle using: lineStyle(BIGNUMBERHERE, color, alpha); I'd like to put in a

Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Helen Triolo
Here's one I just made (and tested) from a draw circle prototype that then draws another circle in reverse (before the endfill is applied -- necessary to get a cutout): // r1 = radius of outer circle // r2 = radius of inner circle (cutout) // x, y = center of donut

RE: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread (-: Tatactic :-)
In the book of C.Moock, he recommends the redundant use of [this] Sorry, I'm a newbie too but it seems to be a good practice to specify clearly the scope you refer to. It's clearly specified in chapter 6 to be aware about the scope. Essential ActionScript 2.0 O'Reilly Media, Inc, 2004, ISBN

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread JesterXL
As the coffee kicks in, that also looks like Composition, not Singleton. Like, you have a Singleton class instantiating instances and returning them of other classes from within itself. - Original Message - From: JesterXL [EMAIL PROTECTED] To: Flashcoders mailing list

RE: [Flashcoders] Basic idea to use xml in flash

2005-10-29 Thread Pete Hotchkiss
Wassem - what is it in particular you want help with. The subject of your mail would suggest you need something to do with XML - is this correct ? Pete -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Waseem Shahzad Sent: 29 October 2005 11:24 To:

Re: [Flashcoders] setInterval() and the trouble

2005-10-29 Thread JOR
At first glance it looks like you have a potential continuous loop issue? stopwatchComplete() questionComplete() stopwatchComplete() and so on if (id = questions.length) Second is I don't see where id is defined in questionComplete() did you mean to type this instead: if ( questionId

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Martin Wood
but using Composition and a Singleton arent mutually exclusive. Composition is a very broad style of OO architecture, used widely throughout a lot of patterns. You *might* call his example a Singleton Factory, but that probably confuses the issue as its not creating multiple instances of a

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Spike
You're welcome! This has been an interesting thread and I've learned a bit more about ActionScript in the process :-) Spike On 10/29/05, JesterXL [EMAIL PROTECTED] wrote: That makes perfect sense and is a good reason. So, from this 2nd conversation, I've gleaned something else to add to the

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
I'm not picking any sides, The Idea of a getInstance method (Singleton), as you guys have been saying, is to have a static way to get a non-static instance of a class. Also, that way of working makes it easier for the creator of that class to know his class will only get instantiated once.

[Flashcoders] scrolling problem

2005-10-29 Thread Kent Humphrey
Can someone help me with this code? I'm trying to figure out how to scroll an MC up and down based on the position of a scrollbar. What am I doing wrong with this code? I'm finding the ratio between how tall the content is (currentChild) and how tall the scrollbar is: scrollRatio =

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
(*Just looking back at the title of this Thread*) Just in case someone's wonders; creating a Singleton is nothing new in ActionScript, it can be done in AS1, AS2 or AS3. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Spike Sent: October 29, 2005 12:25

Re: [Flashcoders] scrolling problem

2005-10-29 Thread Kent Humphrey
Frédéric v. Bochmann wrote: As you can see I've currently got the slider clip as a child of the scrollBar clip - should I bring it out to the same level? On that matter, I would say, look carefully at your line of code that follows: (scrollBar._height - scrollBar.slider._y) If the slider is

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Weyert de Boer
JesterXL wrote: I didn't know what a Singleton was until AS2 was well underway. I didn't know that it was called a Singleton until Moocks book :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
In AS1, I would write this a bit like that: MyClass = function () { this.someProperty = whatever; } MyClass.instance = null; MyClass.getInstance = function () { if(myClass.instance == null) { MyClass.instance = new MyClass(); } return MyClass.instance; }

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Muzak
Well, actually there is a difference. In AS3, class constructors can not be Private. In AS2 they can. So in AS2 you can do this: class MySingleton { private function MySingleton() { } public static function getInstance() { // bah blah.. } } Which is not allowed in AS3. regards, Muzak

RE: [Flashcoders] Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
Woah, I never noticed you can private your constructor!! Lol -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: October 29, 2005 1:15 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Newbie AS3 question Well, actually there is a

Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Navneet Behal
Too cumbersome to make a simple donut, isn't it :) But thanks for the suggestion JOR.. Helen came up with a pretty elegant one. Regards, Navneet - Original Message - From: JOR [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Saturday, October

Re: [Flashcoders] scrolling problem

2005-10-29 Thread Kent Humphrey
Now for your script, I don't usually go that way of doing it so here is how I'd probably do it myself: var scrollRatio = scrollBar.slider._y / scrollBar.scrollTrack._height; currentChild._y = - scrollRatio * currentChild._height; I'm not 100% sure but I think this should work. Notice the

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread JesterXL
Had I been formerly trained in programming, I'm sure I would of known what a Singleton was years ago, and called it such before AS1 was called AS1. However, since I had to learn how to code as well as advanced programming concepts at the same time, coupled by the fact ActionScript evolves so

RE: [Flashcoders] scrolling problem

2005-10-29 Thread Frédéric v . Bochmann
I forgot something...true. Change it to something like: var scrollRatio = scrollBar.slider._y / scrollBar.scrollTrack._height; var heightToScroll = currentChild._height - currentChildContainerMask._height; if(heightToScroll 0) { heightToScroll = 0; } currentChild._y = - scrollRatio *

Re: [Flashcoders] File under BIZARRE: FIXED

2005-10-29 Thread Christopher Anderson
well, i use xp, firefox1.0.7/IE6, 8.5debug and i got the freezing. moving my trackpad didnt unfreeze it but i don't have a mouse hooked up. On 10/28/05, Rich Rodecker [EMAIL PROTECTED] wrote: i dont know about the bug but you should look into flashObject for the detection:

Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Gregory
Solution is quite simple ;-) Flash drawing / fill methods use XOR logic. Here's what you want (swf and code): http://gousable.com/flash/temp/doughnut1.html frcfc Navneet Behal wrote: After putting a couple of hours on the problem, I am still in a daze on how would one go about making a

Re: [Flashcoders] scrolling problem

2005-10-29 Thread Kent Humphrey
Frédéric v. Bochmann wrote: I forgot something...true. Change it to something like: var scrollRatio = scrollBar.slider._y / scrollBar.scrollTrack._height; var heightToScroll = currentChild._height - currentChildContainerMask._height; if(heightToScroll 0) { heightToScroll = 0; }

RE: [Flashcoders] scrolling problem

2005-10-29 Thread Frédéric v . Bochmann
Happy to hear you solved your problems, including the height of your slider was essential too :) Happy you spotted that one yourself! :D Now the arrow, what you're saying is the simplest way. Something that might be interesting for you to try to implement is to have the scrollContent update its

Re: [Flashcoders] Obfuscation... Was: SWF Decompilers

2005-10-29 Thread JOR
I had an idea. Not sure if it's a good one. Flash is pretty good with optimizing all local var names to shorter ones like _1 and _2 which does make decompiled code a bit tougher to read. What if I took it just a step further and in one or two of my main classes I added something like this:

Re: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread ryanm
The idea is to use it (this) when you have two variables with the same name, usually to distinguish between the class member and a locally declared variable. You must know that :) The compiler won't know to use this or not in those cases, so it is important to use it in those contexts.

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread ryanm
The thought of changing multiple lines of code to go from static to non would really suck; that drives the point home for me. Thanks for taking the time to explain it Spike! That's that whole maintainability thing, which, in commercial software, is usually just as or even more important

Re: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread ryanm
You do know that it (this.) is being added for you at compile time in AS2, right? Who cares? All that means is that there is no semantic difference between the two. Not quite. What it means is that the this is assumed, which is not always what you want. And if you need the reference

Re: [Flashcoders] Newbie AS3 question

2005-10-29 Thread ryanm
Still weirding me out. To me part of the appeal of working with movieclips is their inherent hierarchy, which makes a kind of basic sense that's easy to grasp. To a Flash developer who understands Flash and has been working with it for a long time, that's true. To anyone coming from

[Flashcoders] Xml parsing object

2005-10-29 Thread Weyert de Boer
Does anyone got some nice object/method that transforms a xml data from a xml object into a nice object graph? I would like to ask (trying to avoid reinventing the wheel) before I am starting writing my own solution for parsing xml data into a structure for easier reference. Yours, Weyert de

RE: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread Frédéric v . Bochmann
Hey ryanm, Imagine this: class MyClass { private var myName:String; public function MyClass(myName:String) { this.myName = myName } } Or: class MyClass { public function MyClass(myEventDispatcher) { var myListener = new Object(); myListener.controler = this; myListener.click =

Re: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread ryanm
All that to say, if your going to be putting this in front of every class member in AS2 and in AS3 you'll be missing the neat advantage of simplicity. As it were, the classes I write are rarely self-referential. Properties such as position, visibility, etc, are usually handled elsewhere or

Re: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread ryanm
Of course there exists edge cases where that isnt feasible, but most programs dont implement DES algorithms (to relate this to an earlier post) and a lot of legacy code i have worked with has benefitted from being re-factored. I actually do have classes with methods so large that I had to

Re: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread Robert Tweed
ryanm wrote: You do know that it (this.) is being added for you at compile time in AS2, right? Who cares? All that means is that there is no semantic difference between the two. Not quite. What it means is that the this is assumed, which is not always what you want. You can force

[Flashcoders] Re: Re: Newbie AS3 question

2005-10-29 Thread A.Cicak
Yes, but how do you know order of construction of static clases, if you have more each one init depends on other? JesterXL [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you utilize a static function, it would be called when the class itself is created in ActionScript, before

RE: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Weldon MacDonald
cut the ring with a 1 pixel line, then it's like a c with a pixel opening. You could do this with the drawing api, but if the split shows too badly you might need to patch it -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Navneet Behal Sent: Saturday,

RE: [Flashcoders] Re: Newbie AS3 question

2005-10-29 Thread Scott Hyndman
this can also be used to refer an instance's member variable explicitly. Since scoping rules allow for a local variable (in a method) to be named the same as an instance member variable, this is required to differentiate between the two. (Sorry about the html mail) Scott

[Flashcoders] Open Source Flash MMORPG

2005-10-29 Thread John Mark Hawley
I've ben working on-and-off, though mostly off, on a MMORPG/Roguelike hybrid for a long time now, and would really like to get a team working with me so that I have some impetus to actually get serious on it. I will be open sourcing all the code base (both the AS and backend), and, once at the

Re: [Flashcoders] Re: Re: Newbie AS3 question

2005-10-29 Thread JesterXL
The order is based on inheritance, or #initclip order, which is based on which classes is nested where. #initclip won't work, though, if you're class doesn't extend MovieClip, and if you don't extend something, you have to rely on the compiler. As such, you'll have to utilize an instance, at

Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Navneet Behal
Ah.. reading the code again along with your post I realize the AOL Keyword is BEFORE the end fill is applied which is necessary to make the cut-out. Got it... thanks again. Regards, Navneet - Original Message - From: Helen Triolo [EMAIL PROTECTED] To: Flashcoders mailing list

Re: [Flashcoders] Xml parsing object

2005-10-29 Thread Alain Rousseau
Check out Sephiroth's XML2Object class : http://www.sephiroth.it/file_detail.php?id=129 very nice and easy to use. Weyert de Boer wrote: Does anyone got some nice object/method that transforms a xml data from a xml object into a nice object graph? I would like to ask (trying to avoid

Re: [Flashcoders] Xml parsing object

2005-10-29 Thread Weyert de Boer
Thanks! I will have a look :-) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] How to make a doughnut?

2005-10-29 Thread Helen Triolo
That's a very long keyword. But yes, that's crucial. I decided to write it up so I wouldn't forget again that it's only the mask that requires a reverse cutout: http://flash-creations.com/notes/dynamic_drawingapi.php#cutout Helen Navneet Behal wrote: Ah.. reading the code again along with

Re: [Flashcoders] setInterval() and the trouble

2005-10-29 Thread Eric E. Dolecki
use setTimeout now and you dont need to worry about interval ids. e.dolecki On Oct 29, 2005, at 11:21 AM, Weyert de Boer wrote: JOR wrote: At first glance it looks like you have a potential continuous loop issue? stopwatchComplete() questionComplete() stopwatchComplete() and so on

[Flashcoders] Flash and ASP/MSSQL

2005-10-29 Thread Amanda Kuek
Hello everyone, This is a question about Flash in an ASP form which communicates with an MSSQL db. I'm not really sure how to phrase the question, so I'm afraid that I'll just have to explain the story. Imagine an ASP page about faulty garments. Let's just say that if you had a hole in your

Re: [Flashcoders] Flash and ASP/MSSQL

2005-10-29 Thread Michael Bedar
You would need to call a javascript function from AS when the user clicks the inside swf and set the value of a hidden form field.. then the user can click the HTML send button and send everything. On Oct 30, 2005, at 12:38 AM, Amanda Kuek wrote: Hello everyone, This is a question