Re: [Flashcoders] Weird getURL behavior

2006-08-04 Thread Bernard Poulin
Setup a http proxy (like proxytrace http://www.pocketsoap.com/tcptrace/pt.aspx) on your IE and you can thus see exactly what is being sent -- compare the HTTP headers, the url, the responses, of a working page and a non-working page. You will see exactly what is happening and most likely find

Re: [Flashcoders] Problems getting the brightness of a color returnedfrom getPixel

2006-07-30 Thread Bernard Poulin
In other words, to make your above code to compute brightness work from a value returned by getPixel(), just change the few first line of the HSB method from: RGBtoHSB = function(rgb){ var r = rgb.r var g = rgb.g var b = rgb.b ... to: RGBtoHSB = function(var pixelvalue){ var r = pixelvalue

Re: RE: [Flashcoders] Problems getting the brightness of a colorreturnedfrom getPixel

2006-07-30 Thread Bernard Poulin
hum, I guess you missed my last post(?) Here's the code again: function computeBrightness(pixelvalue) { var r = pixelvalue 16 0xFF; var g = pixelvalue 8 0xFF; var b = pixelvalue 0xFF; var bright = Math.max(Math.max(r,g),b); return Math.round((bright/255)*100); } And for an

Re: [Flashcoders] Attention Recursion Speed Experts

2006-07-24 Thread Bernard Poulin
I am assuming this is for AS2 - right? If you want speed that probably means you are dealing with a lot of data(?) 1- What is the typical recursion level? 2- What is the typical number of items? 3- What is the typical size of sub arrays? In general making a function call is not fast at all.

Re: [Flashcoders] AS3, BitmapData and domain security

2006-07-22 Thread Bernard Poulin
I am not sure this is relevant to the discussion but: Your proxy trick will not work to access resources from local machines within a client's NAT. The flash player could potentially access those since it is already located behind the NAT. What I mean is that the flash player might have network

Re: [Flashcoders] Text Arching...

2006-07-11 Thread Bernard Poulin
uhoh... potential help vampire identified! - Just want to add a detail you did not mention: The Nike uniform builder text style has two different types of arching: #1- normal (letters simply rotated individually following a path) #2- shear (vertical lines stays vertical) -- #1 is easy

Re: [Flashcoders] Text Arching...

2006-07-10 Thread Bernard Poulin
- Your example nike url does not work - I do not see any arching just by visiting their site -- where is that? - I do not see any attachments to this email - you must have a problem sending emails to this list since it appears you sent your email twice When you are saying text arching

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

2006-07-08 Thread Bernard Poulin
Alternative way of instanciating a class without a library and without the __Package hack either. Create a class with this function: function attachClassMovie(parentmc:MovieClip, className:Function, instanceName:String, depth:Number, argv:Array):MovieClip { // Create emptyMovieClip var

Re: [Flashcoders] HashMap?

2006-06-30 Thread Bernard Poulin
a straight hash table. B. 2006/5/16, Ron Wheeler [EMAIL PROTECTED]: Bernard Poulin wrote: If you can not tune a HashMap it will be worse than an ordinary array. It will take more space and more processing time. This will of course depend on the size and usage - it *may* be more efficient

Re: [Flashcoders] Calculate Color on a Gradient Given a Percentage

2006-06-17 Thread Bernard Poulin
this works for me: */** @param factor is between 0 and 1 (if higher/lower, it will clip correctly) */* *public* *static* *function* mixColor(a:*Number*, b:*Number*, factor:*Number *):*Number* { *if*(factor = 1) *return* a; *if*(factor = 0) *return* b; *var* fb:*Number* = 1-factor; *return*

Re: [Flashcoders] Whats the best tooltip component (actionsciptable)

2006-06-09 Thread Bernard Poulin
As an ActionScript programmer, I personally liked this one: http://www.neo-archaic.net/blog/2006/05/09/tooltip.htmSimple and effective: No .mxp, no .fla, no super-complex code to setup, just a single .as file to drop in. Additionally, it seems lots of people are building super-fancy

Re: [Flashcoders] Whats the best tooltip component

2006-06-09 Thread Bernard Poulin
Note: the Firefox issue is a problem in the Demo html page. Not a problem in the tooltip itself of course. About the Width: The width parameter should be named maxwidth. It really does take the size of the text in consideration when computing the width. It simply max it out to the specified

Re: [Flashcoders] Embedding a SWF using base64 and Data: URI scheme

2006-06-03 Thread Bernard Poulin
I believe Outlook uses resources located in mime attachments in the email. I do not think it uses that special data: URI scheme. I did a view source from an email in Outlook and got an image URI like the following: img src='cid:image001.jpg@01C6863F.C5CB6260' It seems that cid: is actually a

Re: [Flashcoders] HashMap?

2006-05-17 Thread Bernard Poulin
. The complete hash is always kept around. regards, B. 2006/5/17, Ron Wheeler [EMAIL PROTECTED]: Bernard Poulin wrote: Funny, I was actually thinking of an implementation which would use a Java-style String objects. In java, all string objects have an int hash data member (computed the first time

Re: [Flashcoders] HashMap?

2006-05-16 Thread Bernard Poulin
Funny, I was actually thinking of an implementation which would use a Java-style String objects. In java, all string objects have an int hash data member (computed the first time it is needed). In that scenario, only a portion of the hash value is used to make the hash lookup. The complete hash

Re: [Flashcoders] HashMap?

2006-05-15 Thread Bernard Poulin
Cc: Subject: Re: [Flashcoders] HashMap? Bernard Poulin wrote: I cannot say for AS3 implementation because I never tried it. (Which is the original subject of this topic.) In AS1, AS2 and javascript, I am pretty sure that all objects (including Arrays) are key/value maps. (i.e

Re: [Flashcoders] Grab IP address

2006-05-15 Thread Bernard Poulin
It also depends which IP you want to display. Do you want to display the IP of the client machine or the external IP as seen on the internet? You have to watch out these are not the same as the user might be behind NATs/proxies. For a client-only solution: (wild guess) I think your only chance

Re: [Flashcoders] HashMap?

2006-05-15 Thread Bernard Poulin
If you can not tune a HashMap it will be worse than an ordinary array. It will take more space and more processing time. This will of course depend on the size and usage - it *may* be more efficient with hashmaps. Do you really think we can generalize being it worse all the time? Keeping an

Re: [Flashcoders] sprouts data structure

2006-05-15 Thread Bernard Poulin
http://mathforum.org/kb/message.jspa?messageID=1091009tstart=0 http://www.pa.uky.edu/~sorokin/stuff/cs650/sprout/SPROUT.CC Somebody did a program called auntbeast which seems to be quite good. I can't find a copy of it nor their source. Might be worth sending an email to them.

Re: [Flashcoders] sprouts data structure

2006-05-15 Thread Bernard Poulin
more googling... This one seems to link to a word document with some high-level explanation. http://www.pa.uky.edu/~sorokin/stuff/cs650/sprout/sprout.html B. 2006/5/15, Bernard Poulin [EMAIL PROTECTED]: http://mathforum.org/kb/message.jspa?messageID=1091009tstart=0 http://www.pa.uky.edu

Re: FW: [Flashcoders] sprouts data structure

2006-05-12 Thread Bernard Poulin
(I am re-sending this message - somehow, I got a disk full error message from the flashcoders server) -- Not sure what you mean by: How do you tell when a dot has been encircled by a line? I do not understand why we need to keep track of cycles? What is the relation with your

Re: FW: [Flashcoders] sprouts data structure

2006-05-12 Thread Bernard Poulin
to prevent an illegal move, but the tougher part will be making the computer move if the best move is a line that loops around other vertices. Or maybe I should forget programming and try my hand at cartooning! On 5/12/06, Bernard Poulin [EMAIL PROTECTED] wrote: (I am re-sending this message

Re: [Flashcoders] HashMap?

2006-05-12 Thread Bernard Poulin
internals could tell for sure. Ron Bernard Poulin wrote: mmm... Are you implying that ActionScript objects are not hashmaps? I thought they were *all* hashmaps (even Arrays are hashmaps). Every method call that you do involves at least one hash lookup. B. 2006/5/10, Ron Wheeler [EMAIL PROTECTED

Re: [Flashcoders] HashMap?

2006-05-10 Thread Bernard Poulin
mmm... Are you implying that ActionScript objects are not hashmaps? I thought they were *all* hashmaps (even Arrays are hashmaps). Every method call that you do involves at least one hash lookup. B. 2006/5/10, Ron Wheeler [EMAIL PROTECTED]: It appears that a HashMap is a Java class that uses

Re: [Flashcoders] Equidistant points on an ellipse!

2006-05-10 Thread Bernard Poulin
yes, this is indeed a duplicate! If you are really hoping to find help - you should always search the archives... Lookup this mailing list for this thread: Position objects evenly around ellipse -- March 16, 2006 happy coding! B. 2006/5/10, Peter Gehring [EMAIL PROTECTED]: I'm really

Re: [Flashcoders] Equidistant points on an ellipse!

2006-05-10 Thread Bernard Poulin
I just finished reading the whole thread - well... there is no real answer in the end :-( How accurate do you need this to be? (how many points typically?) Is this used to draw dashes or simply positioning few objects? B. 2006/5/10, Bernard Poulin [EMAIL PROTECTED]: yes, this is indeed

Re: [Flashcoders] Fitting squares into an area

2006-05-08 Thread Bernard Poulin
Probably this is not what you are looking for but: If your maximum square count is relatively low then you could use some kind of brute-force technique where you could try different cases. This might be the only way if the squares are actually rectangles (i.e. images) with varying ratios: that

Re: [Flashcoders] Fitting squares into an area

2006-05-08 Thread Bernard Poulin
Aaaah, the Monday-effect: Yes, in fact: the problem with Steve's algorithm is that the squares will almost never entirely fill the area. There will always be empty gaps at every line / column and/or the last line will not be filled completely. If you have 5 squares to fill for example, there

Re: [Flashcoders] Fitting squares into an area

2006-05-08 Thread Bernard Poulin
Wow! I just tried your algorithm with my previous example numbers and it does output the correct square size (100) - also, internally it has the right number of columns/lines: e.g. 3x4 (p=3, q=4) As for performance, it took 6 iterations: Since the output was 3x4, the number of iterations was (3

Re: [Flashcoders] coordinates of a scaled movieclip

2006-04-24 Thread Bernard Poulin
The problem is that even if you change the scaling, you are not changing the position of the black box in relation of your local movieclip. Your black box is only moving in relation to the movieclip parent. What you seem to want are the coordinates in relation to the parent movieclip. To get

Re: [Flashcoders] coordinates of a scaled movieclip

2006-04-24 Thread Bernard Poulin
Hey! I may have found a simpler version: MovieClip.getBounds seems to have a parameter for the target space. Example: var bounds = mc.getBounds(_root); ..which, I believe, should convert the bounding rectangle automatically to the _root coordinates. (I think it uses localToGlobal and

Re: [Flashcoders] Forcing XML connection closed from SWF

2006-04-23 Thread Bernard Poulin
Here's some random ideas: - The keep-alive option is a good thing (everything goes faster) and normally does not impose a problem. If you have a problem on the server because of that (too many threads or too many sockets taken), always remember that it is the responsibility of the server to

Re: [Flashcoders] SourceSafe??? Recommendations needed.

2006-04-23 Thread Bernard Poulin
Few Notes: - CVSNT tries to minimize binary file growth. Do not know how it compares to others. - To compare binary documents, you will probably have to find tools tailored for each file type. For example: for Microsoft Word documents, you can use the built-in Word compare utility. I do not

Re: [Flashcoders] Firefox, CSS overflow=scroll, flash buttons bug

2006-04-22 Thread Bernard Poulin
I know there is a problem with: flash + firefox + scrolling regions + mouse coordinates + wmode != window + Windows Operating System (linux seems fine) Have you tried using wmode = window? (it might fix your mouse coordinates - in other words, your buttons may start to work again) B.

Re: [Flashcoders] New wrinkle in IE activation issue...

2006-04-20 Thread Bernard Poulin
Yes absolutely. http://www.unfocus.com/projects/PatentMagic/ In this example, at least on my machine, it drops the flashvars for the object (embed is fine). You can see for yourself if you carefully read the alert box text: the embed tag has its flashvars but the object does not have it (value

Re: [Flashcoders] New wrinkle in IE activation issue...

2006-04-20 Thread Bernard Poulin
to point out that this technique is not 100% bad. It is actually one of the best bang-for-the-buck for existing pages. (unlike the FlashObject which requires much more changes). It is great for many cases - it is a brute-force, extremely low-cost method. B. 2006/4/20, Bernard Poulin [EMAIL PROTECTED

Re: [Flashcoders] Re: New wrinkle in IE activation issue

2006-04-20 Thread Bernard Poulin
We are certainly not reinventing the wheel. (yes, some people are still learning about this whole issue, but this is not the main point of this thread). If you carefully read the first message in this thread (and subsequent messages from from ryanm): I think ryann is saying that it does not work

Re: [Flashcoders] New wrinkle in IE activation issue...

2006-04-19 Thread Bernard Poulin
What you are saying makes me a bit scary: You are saying that using all the latests software from Microsoft and after all the workarounds, it still fails. The following page should normally work with the latest microsoft patches. Does it work for you? http://www.macromedia.com/ You said that

Re: [Flashcoders] Re: Active X and Microsoft IE ...

2006-04-19 Thread Bernard Poulin
with. 2006/04/18, Bernard Poulin [EMAIL PROTECTED] Just a little note about this technique: It will void out the flashvars attribute (and potentially other less-frequently used attributes). If you do not use these special attributes, then this technique is perfectly fine. B. 2005/12/22

Re: [Flashcoders] Re: Active X and Microsoft IE ...

2006-04-18 Thread Bernard Poulin
Just a little note about this technique: It will void out the flashvars attribute (and potentially other less-frequently used attributes). If you do not use these special attributes, then this technique is perfectly fine. B. 2005/12/22, Geoffrey Knutzen [EMAIL PROTECTED]: Here is what I am

Re: [Flashcoders] HTML + flash (html title changes on loadMovie)

2006-04-05 Thread Bernard Poulin
This is a known common problem. This bug has been going for a long time! Very annoying when doing AJAX-style pages where the page state is kept on the URL. It sounds like there is some (debug?) code inside the flash plugin that somehow modifies the window title with the information (???). More