Re: [Flashcoders] Question regarding use of Delegate in a class

2006-02-21 Thread Nathan Derksen
There is another way of doing it as well, FYI, that doesn't use the delegate class. You can take advantage of the fact that handler functions can see local variables and use a local variable to make reference to the class. The line: var parent = this; (or fully typed, var

Re: [Flashcoders] hiding datagrid columns?

2006-02-08 Thread Nathan Derksen
Use removeColumnAt() and addColumn()/addColumnAt() var dataArray:Array = new Array(); dataArray.push({foo:1, bar:2, baz:3}); dataArray.push({foo:1, bar:2, baz:3}); dataArray.push({foo:1, bar:2, baz:3}); dataArray.push({foo:1, bar:2, baz:3}); dataArray.push({foo:1, bar:2, baz:3});

Re: Re[4]: [Flashcoders] Q:getter setters vs accessor methods

2006-02-08 Thread Nathan Derksen
The line in the constructor: this._size = 2; is calling the setter. Maybe you meant to call this.__size = 2; Setters will trigger regardless of whether the property is set by code within the class itself or from external code. Nathan http://www.nathanderksen.com On Feb 8, 2006, at 5:31

Re: Re[4]: [Flashcoders] Q:getter setters vs accessor methods

2006-02-08 Thread Nathan Derksen
Sorry, ignore me, I misread the question. setter != getter Nathan http://www.nathanderksen.com On Feb 8, 2006, at 9:58 PM, Nathan Derksen wrote: The line in the constructor: this._size = 2; is calling the setter. Maybe you meant to call this.__size = 2; Setters will trigger regardless

Re: [Flashcoders] dynamic text field whoas

2006-02-07 Thread Nathan Derksen
putting anything into the field, should solve that issue. HTH, Ian On 2/7/06, Nathan Derksen [EMAIL PROTECTED] wrote: You need to re-apply setTextFormat() every time you change the .text or .htmlText properties of a text field: snip percent.text = percentNum; percent.setTextFormat(ldrFormat); snip

Re: [Flashcoders] How do you code your Flash applications?

2006-02-06 Thread Nathan Derksen
You make it sound like I'm forcing it to work. I'm not forcing it, it works as a nice byproduct of how I normally setup and group my movie clips. I see this as being good coding practice. Things that are grouped together share a parent movie clip, making control of the group easier and

Re: [Flashcoders] How do you code your Flash applications?

2006-02-05 Thread Nathan Derksen
Then I create a placeholder movie clip in the order I intend for it to go, then put the new movie clips in that clip later. The parent clip holds the depth, so no matter how many child clips I create, they are always ordered relative to the rest of the content as intended. I always group

Re: [Flashcoders] using MCL to keep track of total bytes loaded.

2006-02-04 Thread Nathan Derksen
No, you will have problems with that implementation. You can't just add loadedBytes to your total. Say you are loading just one movie clip, you start off with zero, then 10 bytes come in, so loadedWeight is now 10. Next, 10 more come in so loadedBytes reports 20, which is added to your

Re: [Flashcoders] How do you code your Flash applications?

2006-02-03 Thread Nathan Derksen
getNextHighestDepth() is your friend :-) Nathan http://www.nathanderksen.com On Feb 3, 2006, at 2:05 AM, ryanm wrote: Another little bit of advice you may find useful, don't put depths right next to each other, leave room between them. When developing a UI, I often put them 10

Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Nathan Derksen
Ah yes, that's a fun issue. Unfortunately, once you load an SWF inside another, there is no way that I know of to get the original published stage size. I would love to be proved wrong, though, but I have looked hard for a way to do that as well. All you can really do is keep xscale and

Re: [Flashcoders] How do you code your Flash applications?

2006-02-03 Thread Nathan Derksen
] on behalf of Nathan Derksen Sent: Fri 2/3/2006 11:07 AM To: Flashcoders mailing list Cc: Subject:Re: [Flashcoders] How do you code your Flash applications? getNextHighestDepth() is your friend :-) Nathan http://www.nathanderksen.com On Feb 3, 2006, at 2:05 AM, ryanm wrote

Re: [Flashcoders] How do you code your Flash applications?

2006-02-03 Thread Nathan Derksen
the _root. It will give depths at which you can't remove movieclips. 2006/2/3, Scott Hyndman [EMAIL PROTECTED]: It's not when you don't want the movieclip to be on the highest depth. Scott -Original Message- From: [EMAIL PROTECTED] on behalf of Nathan Derksen Sent: Fri 2/3/2006 11:07

Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Nathan Derksen
Not that I know of. If the first frame was representative of the size as a whole, then iterating through the movie clips looking for clips with negative x/y values could be done, however it's sort of a moot point as soon as everything moves around in subsequent frames. I also don't think

Re: [Flashcoders] How do you code your Flash applications?

2006-02-03 Thread Nathan Derksen
. Less staring at the sun), and se|py has line highlighting that's black, making the current line invisible ;P Couldn't work with that. Funny how simple i am. - Andreas Nathan Derksen wrote: Yah, I really like it too, but it does the same thing for me. I save constantly anyways, so I rarely

Re: [Flashcoders] XML Driven Application Driving me crazy :)

2006-02-01 Thread Nathan Derksen
This is a problem that has been addressed numerous times. I suggest that you search the archives at http://chattyfig.figleaf.com/ pipermail/flashcoders/ The summary is that the speed problem usually has little to do with the actual xml handling and more to do with how you are updating the

Re: [Flashcoders] Tell me more about _global

2006-02-01 Thread Nathan Derksen
line. On frame one of the root timeline: _global.APP = {}; Wow. That was so hard. APP.someglobal APP.someotherglobal APP.etc Nathan Derksen nderksen at sfu.ca wrote: I generally keep at least one singleton class which is responsible for storing global properties. I make those properties

Re: [Flashcoders] XML Driven Application Driving me crazy :)

2006-02-01 Thread Nathan Derksen
Yah, agreed. I just know from experience on the various boards that one of the most common mistakes for people to make is to update a combo-box or data grid for each iteration of the xml parsing loop rather than waiting until the end. That can lock up the player tight, while if you wait

Re: [Flashcoders] XML Driven Application Driving me crazy :)

2006-02-01 Thread Nathan Derksen
To answer your question a bit more, there are a couple of approaches. One approach is to build in the filtering server-side, so that when you need a subset of the data for something, you send a request to the server, which does the filtering and only sends what is relevant as XML. This is

Re: [Flashcoders] Tell me more about _global

2006-02-01 Thread Nathan Derksen
Coolness, I missed that before. The actual page that this is shown is http://livedocs.macromedia.com/labs/1/flex/langref/migration.html for those who don't want to search through the docs. Nathan http://www.nathanderksen.com On Feb 1, 2006, at 6:29 PM, David Peek wrote: Besides, you don't

Re: [Flashcoders] What native events do (AS2, but not V2) components implement?

2006-01-31 Thread Nathan Derksen
Take a look in the Flash help panel under Components Language Reference - UIComponent Class and UIObject Class. Most components inherit from UIComponent, which in turn inherits from UIObject, so all the properties/methods/events listed for these two classes will apply. When you create your

Re: [Flashcoders] Tell me more about _global

2006-01-31 Thread Nathan Derksen
I generally keep at least one singleton class which is responsible for storing global properties. I make those properties accessible with getters and setters so that I can allow changes in those properties to trigger events. You can't really do that if you use _global to store your data.

Re: [Flashcoders] avoiding a stack of lists

2006-01-30 Thread Nathan Derksen
Well, regardless of whether or not you use listeners, you still need to create the data relationship. I don't think encoding the relationships into 25 listeners is necessarily a good idea, either. An associative array, indexed by ID, could store the IDs of the other list items that are

Re: [Flashcoders] avoiding a stack of lists

2006-01-30 Thread Nathan Derksen
(selectedItemData[i]); } } I hope this helps. Nathan http://www.nathanderksen.com On Jan 30, 2006, at 9:26 AM, Kent Humphrey wrote: On 30 Jan 2006, at 17:13, Nathan Derksen wrote: Well, regardless of whether or not you use listeners, you still need to create the data relationship. I

Re: [Flashcoders] Problems with Flash Plugin Switcher 2.1.0

2006-01-22 Thread Nathan Derksen
Yup, works great. I wish there was a version for the Mac as well. Nathan http://www.nathanderksen.com On Jan 22, 2006, at 4:35 PM, Johannes Nel wrote: not an insatller just an executable and it works like a charm. On 1/22/06, Adrian Lynch [EMAIL PROTECTED] wrote: I'm just about to install

Re: [Flashcoders] Final Class Question

2006-01-21 Thread Nathan Derksen
A few points: First, you are not actually setting the amMessage and pmMessage properties anywhere. The variables that you are passing through the constructor actually obscure those two properties because they share the same variable name; they don't copy any data. Second, it's a better

Re: [Flashcoders] how does ExternalInterface behave in Flash 7 and earlier

2006-01-20 Thread Nathan Derksen
ExternalInterface requires Flash 8, it won't compile back to v7. You can use the integration kit just fine. There is a distinction between extending an open source project and using it as a library. In this case, you are using it unmodified as a library, which does not require you to make

Re: [FlashCoders] FSCommand Problems with Mac

2006-01-20 Thread Nathan Derksen
Yup, fscommand is not supported on many/most Mac browsers: http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_14159 Depending on what you want to do, the alternatives are to use getURL (javascript:foo()); to call a javascript function (no return data allowed), to use the Flash 8

Re: [Flashcoders] my old problem... with big loads of swf's

2006-01-18 Thread Nathan Derksen
Have you tried loading them into movie clips instead of levels? I generally try staying away from levels when at all possible. Also, you can use the movie clip loader class to make the movie clip loads sequential, loading the next movie after the previous movie generates an onLoadInit

Re: [Flashcoders] embed SWF with PHP

2006-01-17 Thread Nathan Derksen
A DOM viewer, such as the one that comes with Firefox, can easily allow you to get the URL of anything on the page, dynamic or not. To my knowledge, there is no way of hiding from that. You can then put that URL directly in the address bar, and retrieve the SWF file with save as...

Re: [Flashcoders] reducing build times

2006-01-11 Thread Nathan Derksen
In the Flash IDE, you can convert movie clips in the library into compiled clips. Select your movie clips, right click, and select Convert to Compiled Clip. This will pre-compile these movie clips, and their linkage IDs (if any) will also remain intact. I've done this in the past with

Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen
I would say to hell with the VB coders (and I used to be one). What if you want to change your implementation later on? What if this functionality changes with AS3? Without an API, you open yourself up to all sorts of fun stuff that may force the user to have to change their code later on.

Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen
Well, consider how an object can be manipulated. var myObject:Object = new Object(); myObject.foo = bar; or var myObject:Object = new Object(); myObject[foo] = bar; Those are equivalent syntaxes. Everything basically inherits from Object, so this is valid syntax throughout, including your

Re: [Flashcoders] Singleton as associative array - yucky icky?

2005-12-30 Thread Nathan Derksen
On 12/30/05, Nathan Derksen [EMAIL PROTECTED] wrote: while that is true, i thought that was what the dynamic keyword was to allow, and without it, you'd get some sort of error... That's the theory, but as the XML example shows, using the associative array syntax gets around the compile-time

Re: [Flashcoders] JavaScript to Flash Communication Compatability

2005-12-29 Thread Nathan Derksen
I haven't seen an up-to-date chart either. You may be interested in knowing that Macromedia already has two ways for you to do this. The first is the Flash JavaScript Integration Kit: http://weblogs.macromedia.com/flashjavascript/ This uses legacy techniques to make what you are doing work

Re: [Flashcoders] NumericStepper

2005-12-29 Thread Nathan Derksen
At the end of your change() handler, save the stepper value to a timeline variable or class property, then next time compare the stepper value with that previous value. Lather, rinse, repeat. Nathan http://www.nathanderksen.com On Dec 29, 2005, at 12:03 PM, Mike Boutin wrote: I have a

Re: [Flashcoders] Flash Class Array bug - Please verify

2005-12-29 Thread Nathan Derksen
Yes, when you assign an initial value to a property, it is basically like a static assignment. Do the initialization in the constructor instead. This works for me: class myClass { // initialize the array in the declarations var myArray:Array; function myClass() { myArray =