Re: [Flashcoders] encrypt string (fast)

2007-08-18 Thread Tyler Wright
I would think the built-in ByteArray.compress would be much faster than 5-10 seconds for a simple 100k string. But if it doesn't work, a really simple method of encrypting a string is doing a bit-flip on each character ... // your original string (try this out with large files) var str:String =

Re: [Flashcoders] swf and referring domain

2006-11-18 Thread Tyler Wright
, location.href); I always forget that damn import and it kills me wasting time debugging it ;) On 11/17/06, Tyler Wright [EMAIL PROTECTED] wrote: Dave, If you were just using Flash8 ... it's beautiful. var thisDomain:String = flash.external.ExternalInterface(eval, location.href

Re: [Flashcoders] swf and referring domain

2006-11-17 Thread Tyler Wright
Dave, If you were just using Flash8 ... it's beautiful. var thisDomain:String = flash.external.ExternalInterface(eval, location.href); one line, so sweet. Tyler On 11/15/06, Dave Segal [EMAIL PROTECTED] wrote: Is there a way to find the domain of the page that loads my swf. For example,

Re: [Flashcoders] Find item in array

2006-09-20 Thread Tyler Wright
He's right, and declaring the variable i inside of the loop rather than before actually (weirdly) runs faster. I don't know what pcode it produces, but I know CPU doesn't care about pcode. I think the only way to test speed is timing the thing. It's all very interesting, but I doubt even 10 ms of

Re: [Flashcoders] Find item in array

2006-09-19 Thread Tyler Wright
for (var i:String in myArray) { if (myArray[i] == value) return Number(i); } using a for..i..in loop will always be faster. Even more then --a -(-1) iteration. Unless you can guarentee that your element will always be near the beginning of a large array, as the for..i..in starts from

Re: [Flashcoders] Find item in array

2006-09-19 Thread Tyler Wright
:) So, for the sake of another one of those big arguments over what's better where no one ever test, I wrote some code to find out exact results: The following code executes one particular test on my Windows XP machine. For results I got an averate of 347 miliseconds executeing the --i -(-1)

Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-14 Thread Tyler Wright
If you're already using a custom Delegate, why not modify the thing to handle what you've just provided? var clickHandler:Function = MyClass.staticMethod; var args:Array = ['Can', 'pass', 'in', 'any', 'amount']; newBtn.addEventListener(click, Delegate.create2(this, clickHandler, args )); // (I'm

Re: [Flashcoders] Possible Challenge: AS 3.0 Compiler :)

2006-08-08 Thread Tyler Wright
It would be great to have the specs for AS3 just to modify current swfs in other ways (not necessarily compile from scratch). Obfuscation comes to mind ... Someone will do really well with an AS3 compiler ... so, who wants to start an AS3 compiler in AS3?! I'd be interested. Tyler On 8/6/06,

Re: [Flashcoders] Possible Challenge: AS 3.0 Compiler :)

2006-08-04 Thread Tyler Wright
There is an attempt underway to document the SWF 9 bytes for a disassembler. I'm sure this could be the start of a compiler as well. And unfortunately I don't think Adobe will release the specs any time soon. http://osflash.org/swf9dis Tyler On 8/2/06, John Giotta [EMAIL PROTECTED] wrote: It

Re: [Flashcoders] AS3 faster ??

2006-07-10 Thread Tyler Wright
ActionScript 3.0 overview http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html Programming ActionScript 3.0 http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part5_ProgAS.html ActionScript 3.0 Language Reference

Re: [Flashcoders] Re: Programmatically instantiating a class thatextends MovieClip

2006-07-05 Thread Tyler Wright
There's a really light class called Prototype which is free to download at http://codext.com/code/9. It does the same thing except with full constructor support. It also has a really simple/clean API: mc = createEmptyMovieClip(mc, 1); Prototype.makeInstanceof(mc, MyMovieClipClass); thats it!

Re: [Flashcoders] Tabbed Browsing support? htmlText, contextMenu, Javascript?

2006-07-05 Thread Tyler Wright
Note: For those from Adobe that read this list ... With IE7's release and it's support for tabbed browsing, if Flash Player provides no support for opening links in tabs it will be increasing apparent that Flash Player is essentially unaware of tabbed browers.) I believe JavaScript is also

Re: [Flashcoders] Ajax and ActionScript 2.0

2006-07-02 Thread Tyler Wright
Could somebody share with me 1 example where AJAX/XMLHttpRequest succeeds where Flash fails ? The term AJAX is thrown around loosly these days to sometimes mean anything JavaScript. I've seen both Flash using JavaScript and JavaScript using Flash (FJAX) for server communication. I can't say

Re: [Flashcoders] Ajax and ActionScript 2.0

2006-06-28 Thread Tyler Wright
Could somebody share with me 1 example where AJAX/XMLHttpRequest succeeds where Flash fails ? The term AJAX is thrown around loosly these days to simply mean anything JavaScript. For those interested in learning more about Flash and JavaScript drawing on one anothers strengths look for the

Re: [Flashcoders] is extending TextField usable with AS2?

2006-06-16 Thread Tyler Wright
it would seem manuals are written by people. People can be wrong, and are in this case. TextFields, MovieClips and Buttons are all AS classes that can be extended. Each class ships with set of methods and properties that are present in the subclass. However, most of those props/methods will only

Re: [Flashcoders] FlashVars + OOP, Best Practices?

2006-06-07 Thread Tyler Wright
I never really understood how making an anonymous object and it's properties into a dynamic class suddenly made it object oriented. Singleton especially seems to be a vice for that type of thing. The reason you would abstract the FlashVars is to 1) avoid naming conflicts and 2) to make changes

Re: [Flashcoders] FlashVars + OOP, Best Practices?

2006-06-07 Thread Tyler Wright
and they'll be available right from the beginning. I know there are some who will want to argue that this is a dependency but that could be similar to arguing that the MovieClip is a dependency -- it's a documented and supported feature) Tyler On 6/7/06, Tyler Wright [EMAIL PROTECTED] wrote: I never

Re: [Flashcoders] More on shared fonts and embedding

2006-06-05 Thread Tyler Wright
You're right, unless the font is embedded Flash will render it as a system font which means it will hopefully look as good as other aliased fonts in the browser, but not better. My suggestion is to take a look at Rob Taylor's Fontastic, it's pretty ingenious. You might have to subscribe to his

Re: [Flashcoders] Conditional Import Statements

2006-06-05 Thread Tyler Wright
The only way is to compile the classes into a seperate SWF's and at runtime when you make the check load in the appropriate SWF. Not a very simple solution. I've found that a good solution, if you can afford to combine the classes into one, is making a runtime check on functionality.

Re: [Flashcoders] maxDepth for dynamic movieclips?

2006-06-04 Thread Tyler Wright
You'll love using the XT DepthManager - plus if you read the comments on the classes static properties there are exact (verified) numbers for max and min depths supported by the Flash player. You'll find the class at http://codext.com/code/6 Tyler On 6/1/06, Zimmen [EMAIL PROTECTED] wrote:

Re: [Flashcoders] create an object of type defined with a string

2006-06-04 Thread Tyler Wright
If you need an object that already exists to be converted into an instance of the class you can use the XT Prototype class Prototype.makeInstanceof(obj, Array); and using Zimmen's suggestion Prototype.makeInstanceof(obj, _global[tType]); good luck! you'll find the class at

Re: [Flashcoders] SetInterval vs. onEnterFrame

2006-05-24 Thread Tyler Wright
setInterval's use up next to nothing on processor, even if you have 20 of them going. I find that the best judgement of which to use is the task at hand. Because framerate is for animation, I find it best to use onEnterFrame when doing coded animation. Flash will cause an automatic screen redraw

Re: [Flashcoders] hitTest vs onRollOver/onRollOut

2006-05-22 Thread Tyler Wright
. - phaedrus -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tyler Wright Sent: Friday, May 19, 2006 11:02 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] hitTest vs onRollOver/onRollOut phaedrus, You will find that, in the beginning, the hitTests

Re: [Flashcoders] Re: [Off List Response] for (var i in ..) loop interupted by frame change

2006-05-10 Thread Tyler Wright
correctly, goToAndStop() and MoviClip.gotoAndStop() are completely separate functions, and even have different behavior on the root timeline. On May 9, 2006, at 5:47 PM, Tyler Wright wrote: This is Great! What a horrible thing to have to know, it just doesn't make sense that the keyword

[Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
I have sevaral for (var i in .. ) loops running looping through objects that get thrown (interupted OR actually go forever) when I change the frame of a movieClip where one exists. Just as an example: for (var i in listeners) { dispatch(listeners[i].event); { // the listener function

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
?context=Flash_MX_2004file=2443.html Kevin N. Tyler Wright wrote: I have sevaral for (var i in .. ) loops running looping through objects that get thrown (interupted OR actually go forever) when I change the frame of a movieClip where one exists. Just as an example: for (var i

Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
/delegation: mx.events.EventDispatcher http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004file=2443.html Kevin N. Tyler Wright wrote: I have sevaral for (var i in .. ) loops running looping through objects that get thrown

[Flashcoders] Re: [Off List Response] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright
definitions of the function and 'this' makes sure that the actual movieclip is the first one that is examined... Extending MovieClips is always full of suprises man... This is interesting, I'm wondering if it's gonna fix your problem though? M On 5/9/06, Tyler Wright [EMAIL PROTECTED] wrote

Re: [Flashcoders] System.as error ?

2006-05-08 Thread Tyler Wright
I've also had this error, several times. It's simply a Flash IDE bug -- Save your work, close and restart Flash, and the error will go away. Tyler On 5/8/06, MBDI ICSC Rodrigo E. Curiel Salazar [EMAIL PROTECTED] wrote: I am working on a local drive, I have some classes, in them I have this:

Re: [Flashcoders] window.onClose - Flash

2006-04-30 Thread Tyler Wright
If you're using Flash 8 you can skip using the modal dialog box. Because ExternalInterface and JavaScript communicate synchronously the JavaScript waits for Flash to return a value and the window waits for JavaScript. It's a great setup. You gotta love Flash8! Tyler On 4/30/06, g. wygonik

Re: [Flashcoders] press hold

2006-04-26 Thread Tyler Wright
enjoy! Tyler // modified code snippet from my scroll class scrollPause = Delegate.create(this, scrollPause); upArrow.onPress = Delegate.create(this, upArrowPress); upArrow.onRelease = upArrow.onReleaseOutside = Delegate.create(this, arrowRelease); private function scrollUp():Void {

Re: [Flashcoders] Not all MCs get onEnterFrame

2006-04-26 Thread Tyler Wright
you don't need that, it will be availible because its an anon function inside another function, therefore all variables inside the containing function will be availible. Right, because of this every MovieClip is sharing the same variables -- which is why it behaves unexpectedly. That worked

Re: [Flashcoders] PrintJob causes Abort Script error message.

2006-04-03 Thread Tyler Wright
I have over 20 years of programming experience including at assembler level, advanced Java, etc, but thanks for trying to put me in my place :-) There is no error. There is no timeout. Not in the PrintDialog object. I think the FlashCoders list in general has a silly habbit of saying

Re: [Flashcoders] Wherefore the evils of _global?

2006-03-23 Thread Tyler Wright
On 3/23/06, ryanm [EMAIL PROTECTED] wrote: Because global variables are contrary to the basis of OOP, which is all about abstraction and encapsulation. If you need to store variables somewhere so that they can be reached anywhere, use a singleton, or a static class, or an application

Re: [Flashcoders] Z sorting multiple overlapping movie clips

2006-03-10 Thread Tyler Wright
dolecki [EMAIL PROTECTED] wrote: That class imports: import xt.core.*; which is nowhere to be found in the release :/ On 3/8/06, Tyler Wright [EMAIL PROTECTED] wrote: Take a look at the XT DepthManager ( http://codext.com/code/6 ). It makes messing with depths like this really simple

Re: [FlashCoders] textfield swapDepths

2006-03-08 Thread Tyler Wright
I have a DepthManager that will take care of this. It adds the .swapDepths() method to TextField and Button. More specifically, it replaces the MovieClip.removeMovie() and TextField.removeTextField() methods so that they work at whatever depth. The DepthManager is self-instantiating, but you have

Re: [Flashcoders] Can you extend the _y and _height setters of amovie clip?

2006-02-08 Thread Tyler Wright
No, there is no way to do this by extending the MovieClip class. Unfortunately the _x and _y are unique beasts, along with all the other MovieClip properties from the Flash 4 days (such as enabled). You can't watch them, create getters/setters for them, or even over-ride them. You have to have a

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

2006-02-06 Thread Tyler Wright
Why not pick a good, standardized way to manage depths that works in every scenario? ...tag, you're it! Anyway, this has gone on long enough. If you haven't gotten the point yet you're never going to. ...I don't feel like playing anymore. ok, let's not talk down to others who have

Re: [Flashcoders] Re: Setting the last pressed key in the Key class

2006-02-06 Thread Tyler Wright
Define your own static MyKey class and have it subscribe as a listener to Flash's Key. It can then be your applications Key class. Meaning your objects listen to MyKey while MyKey listens to Key. Then MyKey can at anytime listen to something else that feeds it input. There's nothing magic about

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

2006-02-04 Thread Tyler Wright
The whole idea is that you keep things at *predictable*, and whenever possible explicitly defined, depths so that things are easy to manage. If you need getNextHighestDepth, that means you don't know what the current highest depth being used is, and that means you aren't in control of the

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

2006-02-04 Thread Tyler Wright
No, you will have problems with that implementation. True. To make it work, just change up a few things: mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes) { // loadedWeight will increment only once per MC, after it is fully loaded // currentLoaded

Re: [Flashcoders] How to alter all movieClips with as2

2006-02-04 Thread Tyler Wright
? hmmm, we all seem to be speaking in short half sentences, or punctuation. The prototype property is fully accessible in AS2, and because of general shortcommings in Flash. (MovieClips, for example, are a cross-breed of the common prototype-based class and a sprite of magic underscored

Re: [Flashcoders] How to alter all movieClips with as2

2006-02-04 Thread Tyler Wright
The prototype property is fully accessible in AS2, and because of general shortcommings in Flash. uh, it might help to finish my own sentences. correction: ...and because of general shortcomings in Flash it is sometimes necessary, even if not recomended. ...continue Tyler

Re: [Flashcoders] Binary IO ?

2005-12-27 Thread Tyler Wright
Reading yes, in ActionScript 3.0 which is currently in public Alpha and private Beta. In fact, the new DOM for AS3 offers the same power of streaming in files that the player uses for SWF's. So you can ask for a file, stream in a small portion (whatever you need) close the connection, and start

Re: [Flashcoders] SWF 2 PNG

2005-12-27 Thread Tyler Wright
Easiest solution for me would be to import the swfs into the Flash Authoring Environment which has an export image option. It ususally does a decent job from what I remember. If you're talking about batching thousands of these things, perhaps someone has a JSFL script that can tell Flash to do

Re: [Flashcoders] Javascript + flash

2005-12-27 Thread Tyler Wright
Is there security issue? Flash security is a blessing and a curse. It's often difficult to work around for developers. Try setting the allowScriptAccess in both the object and embed tags to always and see if that helps. Tyler ___ Flashcoders

Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-14 Thread Tyler Wright
I should be the one to thank you guys. Anyone also know the link the the MM wish list? Tyler On 12/13/05, Weyert de Boer [EMAIL PROTECTED] wrote: Yeah, looks nice! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-14 Thread Tyler Wright
I haven't checked various pocket devices on MIDI recently, but the problem on desktops has been when you get varying capabilities on various platforms, so that the same MIDI file can sound different on different machines. jd I understand that there are various complications, especially

Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-09 Thread Tyler Wright
I know people who know what they're talking about. ;) I've been fortunate enough to work on a project with some amazing developers and experience the difficulty it is to get Flash to communicate with other applications. Thank you everyone for the great response. I will put together a summary

Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-08 Thread Tyler Wright
We built a MIDI sequencer for the PC that talks to Flash through an XMLSocket (though we just send smaller strings, not XML). On both Mac and Windows versions the code to make a sequencer capable of changing instruments, transposing, changing tempo, and indivudual volume of instruments, etc. was

Re: [Flashcoders] where and how can I learn actionscript bytecode

2005-12-07 Thread Tyler Wright
It's not going to delete because somewhere else in your code you have a reference to that object. For example: var myObj = new A(); myObj.destory(); // won't be deleted until myObj no longer points to the class. If you really have your heart set on following something a little more OOP, try

Re: [Flashcoders] How to make a class instance self-destructible?

2005-12-06 Thread Tyler Wright
mc.onEnterFrame = function() { trace(hit); delete this.onEnterFrame; } Try this one on for size. You'll only get one (1) hit trace out to the output window. If you have actions following the delete they'll still get called before the method is deleted. mc.onEnterFrame = function() {

[Flashcoders] Who wants MIDI in the Flash Player?

2005-12-06 Thread Tyler Wright
The Flash Player has evolved through the ages to provide the most needed functionality. Through each version there have always remained a few common goals. What I have found is that: Flash is small -- from the player itself to the swf file format to the assets it is optimized to load, focus has

[Flashcoders] Re: targeting classes in a loaded swf

2005-12-06 Thread Tyler Wright
, Cole Peterson [EMAIL PROTECTED] wrote: Thanks a lot for your time Tyler Wright. That helped a lot! I have implemented your suggestion. singleton. everything is great. My controller loads in the swfs that make up the diff parts of the app. The only disconnect is that all swfs have to agree

Re: [Flashcoders] targeting classes in a loaded swf

2005-12-03 Thread Tyler Wright
Of course you want to retain a synchronous relationship (much faster than LocalConnection). I'm not sure if this UI object you create is a singleton but the best way to handle this situation is to use it's class to hold a static pointer to the instance. for example class UI { private static

Re: [Flashcoders] Detecting when a swf loses focus

2005-11-23 Thread Tyler Wright
. -Steven -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tyler Wright Sent: Friday, November 11, 2005 2:47 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Detecting when a swf loses focus We are looking for a solution

Re: [Flashcoders] Detecting when a swf loses focus

2005-11-11 Thread Tyler Wright
We are looking for a solution to this issue as well. It would be a great help in DRM (Digital Rights Management) to keep not just test takers honest. Anyone yet have a strong enough knowledge of the browser and JavaScript to crack this one? Tyler On 11/8/05, Muzak [EMAIL PROTECTED] wrote: