Re: [Flashcoders] Dynamic class instantiation

2008-04-04 Thread Alan MacDougall
Here is the class I use for dynamic instantiation. Note that it throws a custom exception type, you'll have to create that type yourself or alter that line of code. I copied the instantiation technique from Drew Cummins at blog.generalrelativity.org. class

Re: [Flashcoders] books for flash programming

2008-04-01 Thread Alan MacDougall
On 3/24/08, Naveen Bhaskar [EMAIL PROTECTED] wrote: Hi, I am a flash designer and I am in intermediate in programming.(AS2). anybody pls tellme what are the good books I can refer. And remember, just learning Actionscript in particular will not teach you programming in general.

[Flashcoders] [cross-post] Expert contractor needed, green-field project, telecommuting, not a headhunter

2008-02-20 Thread Alan MacDougall
, and performing regular checkins to our source control system for code reviews. Please respond to [EMAIL PROTECTED] Thank you! Alan MacDougall The Phoenix Group ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman

[Flashcoders] DropShadowFilter rendering issue

2007-08-24 Thread Alan MacDougall
After I create a clip with attachMovieClip, I attempt to write a DropShadowFilter to it using the following code: var shadow:DropShadowFilter = new DropShadowFilter( 5,// distance 45,// angle 0x66,// color

Re: [Flashcoders] DropShadowFilter rendering issue: SOLVED

2007-08-24 Thread Alan MacDougall
Alan MacDougall wrote: After I create a clip with attachMovieClip, I attempt to write a DropShadowFilter to it using the following code: var shadow:DropShadowFilter = new DropShadowFilter( 5,// distance 45,// angle 0x66

Re: [Flashcoders] DropShadowFilter rendering issue: SOLVED

2007-08-24 Thread Alan MacDougall
Hal Leonard wrote: Yeah in CS3 that's the case - regardless of whether you are using AS2 or AS3. But to my knowledge, in Flash 8, it is still 0 to 100. No, that was the problem: In the Flash 8 authoring environment, you set a 0-100 percentage. But in Actionscript 2.0, the

Re: [Flashcoders] DropShadowFilter rendering issue: SOLVED

2007-08-24 Thread Alan MacDougall
Muzak wrote: AFAIK, both are between 0 and 1. The default value for strength = 1, meaning 100% strength. If strength would take a value between 0 and 255 a default of 1 would make no sense at all (well at least not to me). Well, the docs are correct: you can set absurd strength values

Re: [Flashcoders] Big size Image and Thumbnail

2007-08-23 Thread Alan MacDougall
julian atienza wrote: To avoid loading twice times the image (first in 100% and second in thumbnail navigation image) ... how could i copy content of first movieclip to second one with fixed size I did something similar to this while trying to implement my own Bitmap-based magnifying glass

Re: [Flashcoders] Big size Image and Thumbnail

2007-08-23 Thread Alan MacDougall
Dave Mennenoh wrote: To avoid loading twice times the image (first in 100% and second in thumbnail navigation image) ... how could i copy content of first movieclip to second one with fixed size? You can't really, but since the image is cached once it's downloaded the first time, loading it

Re: [Flashcoders] Big size Image and Thumbnail

2007-08-23 Thread Alan MacDougall
julian atienza wrote: Image is 72Mb. This is your first problem. I can't think of a single reason you would have to load a 72 MB image into Flash. Could you tell us a little more about your application? ___ Flashcoders@chattyfig.figleaf.com To

Re: [Flashcoders] Big size Image and Thumbnail

2007-08-23 Thread Alan MacDougall
julian atienza wrote: but i'm not sure if it's going ok... at least now i haven't to make another load but... i think the thumbnail is scaling the portion of big image i see in screen, not the whole image... That might be a limitation of Flash. I'm not sure what happens when MovieClips

[Flashcoders] This is not Java: property accessors

2007-08-22 Thread Alan MacDougall
Further derail! What are people's thoughts on implicit vs. explicit accessors? I prefer explicit ones, but I confess that it's almost entirely because I learned Java before Actionscript. You can't argue that explicit setters are required for a serious language, because C# prefers implicit

Re: [Flashcoders] This is not Java: property accessors

2007-08-22 Thread Alan MacDougall
And another point: Suppose you start out making something as a public field and then later realize you need to restrict its value in some way. With properties, this change will make absolutely no difference to the rest of your code. Without properties, you will have to change every instance of

Re: [Flashcoders] save swf

2007-08-21 Thread Alan MacDougall
Jer Brand wrote: Coming from someone who's never done this, and doesn't know if it's possible, but: Would it be possible to capture your user created design in BitmapData (I was fairly sure there's a method to extract pixel info from a MovieClip, correct?) then transmit that back to the server

Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Alan MacDougall
Start small and work your way up. You don't need classes until the functions start to get unmanageable. That won't happen until you've thoroughly covered variables and control structures. By the time classes are necessary, the students should be relieved to have a way to organize their forest

Re: [Flashcoders] Intro to OOP using ActionScript

2007-08-21 Thread Alan MacDougall
I don't think you need to call it procedural. Just call it the basic building blocks that they will need for OOP (or procedural, for that matter). There's not that much difference, really, between OOP and procedural. OOP just encapsulates chunks of procedural code and its data. This is the

Re: [Flashcoders] save swf

2007-08-21 Thread Alan MacDougall
Jer Brand wrote: Uncompressed, yeah, that'd be ugly. But how does something like the following (guesswork code) perform? foo:BitmapData = new BitmapData() ; /* put your image data in there, with whatever method */ bar:ByteArray = foo.getPixels(myImageRect) ; var.compress() ; Again, mostly

Re: [Flashcoders] Intro to OOP using ActionScript: patterns derail!

2007-08-21 Thread Alan MacDougall
Dave Mennenoh wrote: Lots of programmers never need design patterns as they don't help much unless your architecting large apps, and lots of Flash programmers aren't developing those kinds of apps. Keeping your code organized however should be taught from day one and certain oop concepts are

Re: [Flashcoders] save swf

2007-08-20 Thread Alan MacDougall
bassam mohaisen wrote: Hi all I'm trying to do e-tshirt design where the user can desgin his shirt and add text or images so I need to know how can I save the design as image or swf for the design how can I take screenshot , if somebody know the concept and the code . all the text and photos

Re: [Flashcoders] [OT] Improve my design skills

2007-08-17 Thread Alan MacDougall
Marcelo de Moraes Serpa wrote: Hello folks, I'm currently mainly a coder, but I also love graphics design and design in general. I would love to improve my overall design awareness. Does anyone have any book (or any other resource such as website, magazine, mailing list, whatever) to recommend

Re: [Flashcoders] [OT] Improve my design skills

2007-08-17 Thread Alan MacDougall
Ron Wheeler wrote: One of the best books is Head First Design Patterns. Really nice code. Well explained and shows how to get a lot of mileage out of code through thoughtful design. It will make you a better coder and get you thinking about design in new ways. He was talking about graphic

[Flashcoders] AS 2.0 constructor inheritance

2007-08-14 Thread Alan MacDougall
Compare these two situations: class SuperClass { private var list:Array; public function SuperClass() { list = new Array(); } } class SubClass extends SuperClass { // when instantiated, the list variable is automatically initialized } This is as it should be. The

Re: [Flashcoders] AS 2.0 constructor inheritance

2007-08-14 Thread Alan MacDougall
Hans Wichman wrote: Hi, when the superclass has a default contructor without parameters, there is no need to call it explicitly. I'd like to turn it around though, no matter what or how you have defined them, always call them explicitly for clarity's sake and self documentation. So if the

Re: [Flashcoders] Q: Including class at compile w/o explicitly instantiating it

2007-08-13 Thread Alan MacDougall
Steven Sacks wrote: If you do not do anything with an imported class, Flash will not compile it. Or, to take it a step further, make a class named ClassRegistry (or some such), which defines but does not instantiate private static instances of every class you want to load dynamically. Then

Re: [Flashcoders] Preloading problem

2007-08-08 Thread Alan MacDougall
Omar Fouad wrote: is there a way attach a library item from a loaded swf. I think this would be the best solution... This suggestion hits close to the correct answer. Really, if your library is so big that it's killing your app's startup time, your wisest option is to load the items on

Re: [Flashcoders] Lines in textArea

2007-08-06 Thread Alan MacDougall
Volker Scarpatetti - Advertis Interactiva wrote: Hi ! Is there a way to know how many lines are written in a textArea component when filling it up dynamically ? This is not a perfect solution, but if you know the TextField.textHeight when there is a single line, you should be able to do a

Re: [Flashcoders] [FP8, AS2] Rules of thumb: Coding tips?

2007-07-29 Thread Alan MacDougall
Micky Hulse wrote: Pedro Taranto wrote: if you want to return diferent types in one function you dont specify any return data type Ah, sounds good to me. I was not sure if it was bad practice to not specify a type. Well, if you want to write strictly, and if you're interested in exactly

Re: [Flashcoders] Searching within XML

2007-07-25 Thread Alan MacDougall
Omar Fouad wrote: I am doing some application on flash that uses an XML file to store data... This application has a search form. I understand how to get through the xml by loops but i can't figure out how to get flash to know if this word is included within the xml nodes or not... Any simple

[Flashcoders] RESOLVED: Flash 8 exception handling

2007-07-25 Thread Alan MacDougall
Alan MacDougall wrote: This looks completely straightforward and identical to Java... but when I do it, it catches the generic error. Now, obviously an Error instance is getting caught, which means one is getting thrown, which means my InvalidPathFormatException IS being recognized

Re: [Flashcoders] Searching within XML

2007-07-25 Thread Alan MacDougall
Omar Fouad wrote: com.xfactorstudio.xml.xpath??? where can i get it??? Well, XPath is just one way of searching through an XML document to get specific nodes. As you might guess from the package name, this particular implementation can be found at www.xfactorstudio.com . You can learn more

Re: [Flashcoders] CDATA Html Text not working

2007-07-24 Thread Alan MacDougall
Chris W. Paterson wrote: this.firstChild.childNodes[i].firstChild.childNodes[j].childNodes;--- this is how I am trying to access the content of that node. First off, I'm guessing I should use .nodeValue? Will that give me the entire node with ![CDATA[]]? Is it even possible to read the html

[Flashcoders] Flash 8 exception handling

2007-07-24 Thread Alan MacDougall
Okay, here's one for you. I extended Error with a very simple specific error type, like this: class com.mycompany.exceptions.InvalidPathFormatException extends Error { public function InvalidPathFormatException(message:String) { if (message != null) { this.message =

Re: [Flashcoders] swf obfuscation - new challenge

2007-07-23 Thread Alan MacDougall
Danny Kodicek wrote: The only method I can think of that might do what you're looking for is to have some of the actual code work on the server. So for example you'd do something that has a fundamental effect in the game, but you make its code run on your server instead of on the client and

[Flashcoders] obfuscation swf, and client demands

2007-07-18 Thread Alan MacDougall
There's a constant demand for SWF obfuscation -- any good application, especially things like standalone games, is a ripe target for theft and rebranding. *cough ebaumsworld cough* And business clients are often afraid of plagiarism by real or imagined rivals: if they didn't want to be the

Re: [Flashcoders] real time QA

2007-07-17 Thread Alan MacDougall
Van Tuck wrote: List - A client is inquiring about a web-based system that would allow the user to type in a question, have the algorithm compare the input character-by-character to a predefined list of answers until all but one answer had been removed and the correct answer returned.

Re: [Flashcoders] Using createEmptyMovieClip to create MovieClips within MovieClips

2007-07-17 Thread Alan MacDougall
2007/7/16, John laPlante [EMAIL PROTECTED]: I'm writing a component and have created a MovieClip with createEmptyMovieClip. When I try to create sub-MovieClip inside the first MC with createEmptyMovieClip, it is undefined. This must be a basic Flash thing. I haven't used

Re: [Flashcoders] Help for a Java Guy: Instantiating a MovieClip with a linked class and calling class methods

2006-07-07 Thread Alan MacDougall
Julian Bleecker wrote: That's great Ian — thanks for the help! Each of those little idioms makes sense when described — I never would've figured these out just whacking at various permutations, particularly the very baroque incantation leveraging the invisible symbol names. You may find

Re: [Flashcoders] How much do you charge for a Flash application?

2006-02-12 Thread Alan MacDougall
Karthik wrote: Mates, I have a prospective client who wants to have a Flash application (AMFPHP). This is the first time for me so I need to know how much I should charge him. Can we please keep the list on topic? This is a coding-related list. Topics such as this and Outsourcing etc.

Re: [Flashcoders] opportunity - paypal flash cart

2006-02-09 Thread Alan MacDougall
Rich Rodecker wrote: check out flashkart. On 2/8/06, stone larsen [EMAIL PROTECTED] wrote: I am looking to hire someone for a fully functional apparel based flash cart using paypal as the merchant. Key needs: XML powered, easily updateable. If interested please hit me back, I'm not

Re: [Flashcoders] avoiding a stack of lists

2006-01-30 Thread Alan MacDougall
Kent Humphrey wrote: I've made a single item work with my initial solution, which was to have a list for each item that lists which items in the other lists should highlight. But by the time I've made 25 lists for my 25 (current) items, that seems like a lot of redundant and duplicated

Re: [Flashcoders] avoiding a stack of lists

2006-01-30 Thread Alan MacDougall
That sounds to me like you want to use events -- the items which light up should listen to the items that trigger them. When the triggering item gets moused over, the listening item(s) can decide whether to react. This might just take your redundancy and put it somewhere else, but it

Re: [Flashcoders] Q: All OOP or ??????

2006-01-28 Thread Alan MacDougall
What I ask myself on new projects is what parts of this can I reuse? Can I put this behavior in a class or a component? It's more work up front to make your classes for your daily tasks (not much more work) but on project 2 or project 3 your work will pay off. What's more, OOP design

Re: [Flashcoders] Documenting my code

2006-01-18 Thread Alan MacDougall
Ian Thomas wrote: We've jsut started using AS2API - http://www.badgers-in-foil.co.uk/projects/as2api/ - which works fine for us on Windows (but had issues on Linux, sadly, although I think that's because our Linux box needs a good cleanup). Perhaps you could share how you got it working? I

Re: [Flashcoders] Documenting my code

2006-01-18 Thread Alan MacDougall
Ian Thomas wrote: Hi Alan, That one's pretty simple - we didn't even try. I too get the huge barf of 'no definition' output for the MX classes. But I didn't need to document the MX classes, so didn't bother looking into how to do so - the output from as2api _without_ those classes is

Re: [Flashcoders] An Issue of Encapsulation

2006-01-17 Thread Alan MacDougall
Chris Kennon wrote: Hi, If my understanding of encapsulation is misguided, please correct. In the following code snippet, should in the interest if encapsulation, the Good Morning/Afternoon strings be called from another function? That depends on exactly how you interpret formatTime. The

Re: [Flashcoders] SEO, flash site, url and text in this movie tags

2006-01-11 Thread Alan MacDougall
Martin Weiser wrote: Hello, does these tags really work for search bots? !-- URL's used in the movie-- !-- text used in the movie-- No way. Google is way too smart these days. White text on a white background, meta tag text, text in comments, text anywhere a user can't read it -- Google

Re: [Flashcoders] Advice on how to build a click and drag selector

2006-01-09 Thread Alan MacDougall
I'm about to begin on a project for work where a user has the ability to select areas on a map by clicking and dragging his mouse over and area. When the person is finished they will let go of the mouse button and a nice little square will appear on the map where they have selected. Just

Re: [Flashcoders] Advice on how to build a click and drag selector

2006-01-09 Thread Alan MacDougall
Alan MacDougall wrote: I'm about to begin on a project for work where a user has the ability to select areas on a map by clicking and dragging his mouse over and area. When the person is finished they will let go of the mouse button and a nice little square will appear on the map where

[Flashcoders] MTASC with v2 components

2006-01-08 Thread Alan MacDougall
I have two MTASC issues: First, MTASC cannot compile MM's source for v2 components, because that source itself does not comply to pure, strict AS 2.0. The workaround is to use the -mx flag, which causes MTASC to use the precompiled .aso objects for v2 components. That's all well and good,

Re: [Flashcoders] what happens to exceptions i throw in async functions.

2006-01-05 Thread Alan MacDougall
i am not able to catch this error in either the anon function or the function delegate. has anybody have any idea of how to handle asynchranous exception handeling in flash? I don't think you can do what you're planning, there; it appears that XML.load() starts a new execution thread, which

Re: [Flashcoders] Pathfinding

2006-01-04 Thread Alan MacDougall
franto wrote: http://www.franto.com/blog2/as3-pathfinder-in-big-mazes with as2 and as3 sources, in as3 it's 100 times faster :) Yeah, I'm resigned to having to rework my entire application once ActionScript 3 hits the general-purpose Flash Player level. Unfortunately, you can never just

Re: [Flashcoders] Object repository and instancing a object

2006-01-01 Thread Alan MacDougall
Weyert de Boer wrote: Hello I made a simple class to registers a class name and which should be able to instantiate a instance of a registered class. For example: TilesRepository = new ObjectRepository(); TilesRepository.registerObject( DefaultTile ); // create instance tileInstance

Re: [Flashcoders] Pathfinding

2005-12-22 Thread Alan MacDougall
of this too, if you'd like.) Alan MacDougall ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] Importing custom components via Actionscript

2005-12-22 Thread Alan MacDougall
[EMAIL PROTECTED] wrote: I wanted to load these cells from the library on the fly, but I get an error. Here is the code I use: import colorblock; c = _root.createClassObject(colorblock, blankClip + i, (i + 1), {colorParam:hexArray[i]}); Are you able to instantiate a new object of the

Re: [Flashcoders] Comment/documentation debate

2005-12-21 Thread Alan MacDougall
Some of this debate may be a matter of preference or perception, too. It's very true that good code should be self-documenting, but once you have a class more or less done, you shouldn't have to analyze its code to figure out what its methods and their signatures are, or how it interacts with

Re: [Flashcoders] controlling the framerate of a swf file at runtime

2005-12-19 Thread Alan MacDougall
Anyone know if it's possible to control the framerate of a movie at runtime? As far as I know, framerate is built into the SWF; it's a base property. If this has changed in the last one or two versions, I haven't heard about it. In a frame-by-frame animation, there'd be workarounds -- for

Re: [Flashcoders] Displacement Maps, and Button actions

2005-12-17 Thread Alan MacDougall
Howard Nager wrote: Mini update - I've simplified and am loading an image in to a movieclip and applying the distortion filter to the movieclip. Much easier...anyhow, before applying the distortion i am creating a button in that movieclip. The problem now is that the button visually distorts