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 the cause of
your problem.

good luck!
B.


2006/8/2, Merrill, Jason [EMAIL PROTECTED]:


Did you check your webserver's access log and see what you get when
getURL( )
runs?

I don't have access to that unfortunately.  Big company.  :) But good
idea, I'll see if I can cut through some bureaucracy to get that
information.

Another quick test is to change your .doc extension to .html and see
what
happen.  Maybe your webserver is configured not to serve that file
type? (doesn't
seem like it since you can get it when you try it at the address bar)

No, it doesn't happen on other people's browsers, or if I enter the URL
manually, so that wouldn't be the issue. Thanks though.

Test it on Firefox too and see what happen...

Actually, my site doesn't appear at all in Firefox, not sure why -
probably just the way I am writing out the embed tags from external
Javascript, but this doesn't need to work in Firefox anyway...

Thanks anyway for your ideas.  Any other thoughts?


Jason Merrill
Bank of America
Learning  Organization Effectiveness - Technology Solutions





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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  16  0xFF;
var g = pixelvalue   8  0xFF;
var b = pixelvalue  0xFF;
...


...then call it this way:

var pixel = getPixel();
var hsb = RGBtoHSB(pixel);

then simply use hsb.b

Hope it helps explaining :-)
B.

---

you could even recode the method to just return the brightness alone (no
Hue, no Saturation):  (NOTE: this has not been tested - I simply stripped
off the unnecessary code from the previous method)

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);
}

If I understand correctly, this should return a number from 0 to 100
representing the brightness. Which is in fact only the highest channel
value. (scaled down to the 0-100 range).

2006/7/29, Zeh Fernando [EMAIL PROTECTED]:


 Thanks very much for your response Martin but I don't understand it. I
 don't
 have three vars called R G and B. I just have a number which was retuned
 from getPixel. Am I being stupid? I can't see how I should  do what you
 sugest. Pease explain a little further.

That number you're getting is a color. You're just seeing it in decimal
form, rather than hexadecimal form. It's the same thing. For example, the
value for white is either 16777215 or 0xff (the two are the SAME
number,
just represented in two different ways).

On 0xff, the first ff pair is R, then G, then B. Like when you have
html color, #ff.

To extract the single R G and B values from a color, simply apply Martin's
code to the color.

var color = 0xffc1e2; // or the one returned by getPixel, same thing
var r = color  16  0xFF
var g = color  8  0xFF
var b = color  0xFF

Then R, G, and B will contain the values for each channel, going from 0 to
255.

Calculating brightness from that is one whole different matter, though.



- Zeh

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 optimized/faster version, you could try something like:

function computeBrightness(pixelvalue)
{
  // returns the larger value of r, g or b -- and scale it down to a 0..100
range.
  var r = pixelvalue  16  0xFF;
  var g = pixelvalue  8  0xFF;
  var b = pixelvalue  0xFF;
  var bright = (rg)?((rb)?r:b):((gb)?g:b);
  return (bright/255)*100;  // no rounding.
}

(Again, this is untested code -- but it looks like it should work).

Bernard
2006/7/30, James Deakin [EMAIL PROTECTED]:


HI Guys, Thanks very much to you all for your help and explanations. I
understood that the number represented a colour value but I now have a
much better understanding of how it does so.

In your opinion what is the most efficient way to retrieve the
relative brightness of that colour.

What I need is a value between 0 and 100 where 0 is black and 100 is
white and the numbers in-between represent the shades in-between.

What I am going to try is this.

Split the number into its components RGB

use this code which came from the Flash API project

//colorModel converter RGB-HSB
//returns a hsb object
RGBtoHSB  = function(rgb){
var r = rgb.r
var g = rgb.g
var b = rgb.b
var hsb = new Object();
hsb.b = Math.max(Math.max(r,g),b);
var min = Math.min(Math.min(r,g),b);
hsb.s = (hsb.b = 0) ? 0 : Math.round (100*(hsb.b - min)/hsb.b);
hsb.b = Math.round((hsb.b /255)*100);
hsb.h = 0;
if((r == g)  (g == b)){
hsb.h = 0;
} else if(r = g  g = b){
hsb.h = 60*(g-b)/(r-b);
} else if(g = r  r = b){
hsb.h = 60 + 60*(g-r)/(g-b);
} else if(g = b  b = r){
hsb.h = 120 + 60*(b-r)/(g-r);
} else if(b = g  g = r){
hsb.h = 180 + 60*(b-g)/(b-r);
} else if(b = r  r = g){
hsb.h = 240 + 60*(r-g)/(b-g);
} else if(r = b  b = g){
hsb.h = 300 + 60*(r-b)/(r-g);
} else{
hsb.h = 0;
}
hsb.h = Math.round(hsb.h);
return hsb;
}

to turn it into an object with three values hue saturation and
brightness and then just make use of the brightness.

If there is a better way especially a more efficient way I would
really like to know.

On 7/29/06, Mike [EMAIL PROTECTED] wrote:
 Small correction.

 This:
 This compares each bit in the first number to each bit in the
 second
 number. If both bits are 1 (on), that bit is 1 (on) in the result. If
 both bits are 0 (off), both bits are 0 (off) in the result. So the
 result is:

 ...should be:
 This compares each bit in the first number to each bit in the
 second
 number. If both bits are 1 (on), that bit is 1 (on) in the result. If
 *either bit is* 0 (off), *that bit is* 0 (off) in the result. So the
 result is:
 (emphasis added)
 --
 T. Michael Keesey

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Mike
 Sent: Saturday, July 29, 2006 3:25 PM
 To: 'Flashcoders mailing list'
 Subject: RE: [Flashcoders] Problems getting the brightness of a
 colorreturnedfrom getPixel

 You seem to be thinking of numbers as if they are stored like strings.
 They aren't.

 RGB colors are stored as 3-byte (24-bit) numbers.

 For example, red looks like this in binary:

 b

 ...which is the same thing as this in hexadecimal:

 0xFF

 ... which is the same thing as this in decimal:

 16711680

 To isolate, for example the red portion, you can use SHIFT RIGHT () to
 shift all bits to the right by 16 bits. Binary:

 b  16 = b

 Hexadecimal:

 0xFF  16 = 0xFF

 Decimal:

 16711680  16 = 255

 Generally it's a good idea not to presume that there may not be more
 bits to the left, so you can filter them out using a bitwise AND (). To
 explain, this better, here's how to extract the green value from bright
 cyan (0x7F):

 The binary value of the color:

 0111

 Split into colors:

   0111

 Shift right 8 bits:

 10111b  8 = 

 In hexadecimal, this result is:

 0x

 In decimal, it is:

 65535

 Clearly this is too large, because it includes the red value. To remove
 it, we use a bitwise AND.

 b  0xFF = b = 0xFF

 To illustrate, we are taking this value:

 b (=0x; =65535)

 ...and doing a bitwise AND with this value:

 b (=0x00FF; =255)

 This compares each bit in the first number to each bit in the second
 number. If both bits are 1 (on), that bit is 1 (on) in the result. If
 both bits are 0 (off), both bits are 0 (off) in the result. So the
 result is:

 b (=0xFF; =255)

 ...which is, indeed, the green value of the color.

 So Martin Wood's example (slightly edited):

 var r:Number = color  16  0xFF;
 var g:Number = color  8  0xFF;
 var 

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. Better iterate than
recurse.

B.


2006/7/25, Steven Sacks | BLITZ [EMAIL PROTECTED]:


Is there a way to make this script any faster?

Array.prototype.flatten = function(r) {
if (!r) r = [];
   var l = this.length;
   for (var a = 0; a  l; a++) {
 if (this[a].__proto__ != Array.prototype) {
   r.push(this[a]);
 } else {
   this[a].flatten(r);
   }
}
return r;
}

This function takes an array and flattens it, meaning any nested arrays
will get flattened into a single array.

Example:
x = [a, b, c, [d, e], f, [g, [h]], [[], i], j];
y = x.flatten();
y  [a,b,c,d,e,f,g,h,i,j]

Issues:

Array.reverse() and Array.unshift() are notoriously slow and any speed
gained from doing a reverse while loop would be lost.

I don't see how this script could be sped up, but I'm not a recursion
expert.  The current speed increases I have are:

1) Single character variable names
2) this.length stored in a variable avoids computation every loop.
3) Most common if true (not a nested array) comes first

I'm not clear which, if either, is faster:

if (x != y) vs if (!(x == y))

That's the only other place I can see a spot for a possible speed
improvement.

Thanks!
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 access to some
non-internet-public stuff.

B.


2006/7/22, Paul Neave [EMAIL PROTECTED]:


Thanks jd.

On 22/07/06, John Dowdell [EMAIL PROTECTED] wrote:
 If the foreign data acknowledges you (via a policy declaration on
 their server), or if your own server proxies that data yourself, then
 the ability to get inside that bitmap data is available.

I don't see the point of restricting access to BitmapData from another
server when all you have to do to get at it is use a proxy script on
your own server.  Here's an example:


http://www.neave.com/temp/proxy.php?proxy_url=http://www.google.com/intl/en/images/logo.gif

The image looks as though it's coming from my server but it's actually
coming from a domain I don't have server-side access to.  So from
Flash's point of view, there's no security risk.  In AS3:

var request:URLRequest = new
URLRequest(http://www.google.com/intl/en/images/logo.gif;);
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);

would work fine, but I can't use BitmapData methods on the image.  If
I replace the URL with the proxied one above, I'd be able to use
BitmapData without any problem.  As far as I can see, any potential
hacker could use a proxy script like this so I don't see what
security benefit there is apart from just annoying developers!

I'm now left with two options: 1) either proxy the image so I can
access BitmapData (which costs me bandwidth and is much slower than
direct access, especially if you're accessing many images at once) or
2) don't use BitmapData and put up with having the images pixelated
when scaled or rotated.  Either way it doesn't make me happy :(

Paul.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 to achieve - plenty of libraries, etc.  but,
#2 is more difficult to do -- I personnaly never saw something to do that.
You might have to do a manual shear operation with text rendered onto a
bitmap (would require flash player 8+).

B.

2006/7/11, Ian Thomas [EMAIL PROTECTED]:


Hi Umesh,
You sent this exact same question on the 26th of June, and got 19
replies... I'm not sure why you need to ask it again..?

Old threads here:
http://chattyfig.figleaf.com/pipermail/flashcoders/2006-June/168431.html

and here:
http://chattyfig.figleaf.com/pipermail/flashcoders/2006-June/168483.html

Ian

On 7/10/06, Umesh Patel [EMAIL PROTECTED] wrote:
 Hello,

 I have following question.

 I saw nike's unifrm builder, Nike Uniform
 Builder(http://www.niketeam.com/v2/new/Sport...T=BBMCAT=UNI), they
built
 uniform generator using Flash, the only thing wondering me is, how did
they
 manage to arch the text, if anybody has any clue then I would be very
happy
 to see little bit of action scripting.

 I want different arching with click of a button or something like that,
I am
 attaching a sample of arching that I am looking for!

  If anybody figures it out. thanks,

 Umesh Patel

 Dynamic Team Sports
 416.496.8600
 ---
 This email and any files transmitted with it are confidential and
intended
 solely for the use of the individual or entity to whom they are
addressed.
 If you have received this email in error please notify the sender via
reply
 mail and delete all copies form your records. Any views or opinions
 presented in this email are solely those of the author and do not
 necessarily represent those of the company. Employees of Dynamic Team
Sports
 are expressly required not to make defamatory statements and not to
infringe
 or authorize any infringement of copyright or any other legal right by
email
 communications. Any such communication is contrary to company policy and
 outside the scope of the employment of the individual concerned. The
company
 will not accept any liability in respect of such communication, and the
 employee responsible will be personally liable for any damages or other
 liability arising. The company accepts no liability for any damage
caused by
 any virus transmitted by this email.'







 





 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 I assume you mean displaying text
following a curved path - namely an arc?  Like text going around a
circle?  I also assume that you want to be able to change the content of the
text dynamically.

Since it is possible to rotate text, you could roll your own algorithm and
draw each letter separately -- each of then positioned and rotated correctly
to follow any path you can imagine.

B.

2006/7/10, Umesh Patel [EMAIL PROTECTED]:


Hello,

I have following question.

I saw nike's unifrm builder, Nike Uniform
Builder( http://www.niketeam.com/v2/new/Sport...T=BBMCAT=UNI), they built
uniform generator using Flash, the only thing wondering me is, how did
they
manage to arch the text, if anybody has any clue then I would be very
happy
to see little bit of action scripting.

I want different arching with click of a button or something like that, I
am
attaching a sample of arching that I am looking for!

If anybody figures it out. thanks,

Umesh Patel

Dynamic Team Sports
416.496.8600
---
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.

If you have received this email in error please notify the sender via
reply
mail and delete all copies form your records. Any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company. Employees of Dynamic Team
Sports
are expressly required not to make defamatory statements and not to
infringe
or authorize any infringement of copyright or any other legal right by
email
communications. Any such communication is contrary to company policy and
outside the scope of the employment of the individual concerned. The
company
will not accept any liability in respect of such communication, and the
employee responsible will be personally liable for any damages or other
liability arising. The company accepts no liability for any damage caused
by
any virus transmitted by this email.'













___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 new_mc:MovieClip = parentmc.createEmptyMovieClip(instanceName, depth);

// Save classe prototype
new_mc.__proto__ = className.prototype;

// apply the constructor
className.apply(new_mc, argv);

// return new clip
return new_mc;
}

var mc = attachClassMovie(parent_mc, com.Class, child, 10, [param1,
param2]);


2006/7/7, Julian Bleecker [EMAIL PROTECTED]:


Ian,

Those casting gymnastics definitely help — thanks a lot.

Julian

On Jul 7, 2006, at 9:27 PDT, Ian Thomas wrote:

 On 7/7/06, Julian Bleecker [EMAIL PROTECTED] wrote:
 One other thing occurred to me on this topic, that might actually
 save the trouble of using a hash table, which AS direly needs.

 Is there a way to summon forth a class that's been instantiated in
 any of the ways described below, by name?

 In other words, if I've done this:

 for(var i:Number = 0; i  12; i++) {
   Object.registerClass(symbolName,FooA);
   var clip:FooA=FooA(myMovie.attachMovie
 (symbolName,anInstanceName_+i,depth));
 }

 And elsewhere, I want to summon forth these dynamically in another
 loop or otherwise (something I might normally do by stuffing the
 instances in a hash or map somewhere and using the name as the key) -
 can I do that in some fashion? Is there an AS idiom for obtaining a
 reference to a MovieClip (or other runtime object) by name?

 Julian

 Firstly, Actionscript does have the equivalent of a HashMap.
 Everything derived from Object can be treated like so:

 var obj:Object=new Object();
 obj[someKey]=Hello;
 trace(obj[someKey]); // traces Hello

 The bracket access on an object actually accesses the properties and
 methods of that object.
 Hence:
 var myClip:MovieClip = ...some movieclip...
 trace(myClip._visible);
 trace(myClip[_visible]); // equivalent to the last line
 myClip.doSomething(1,2,3);
 myClip[doSomething](1,2,3); // equivalent to last line.
 myClip._y=20;
 myClip[_y]=20; // again, equivalent

 When you create/attach an instance of a MovieClip to a parent
 movieclip, you are actually creating new properties on that parent
 clip.

 So:
 var myClip:MovieClip=someClip.attachMovie(Symbol,aNewClip,1);
 trace(myClip==this[aNewClip); // traces 'true'

 To get back to your original question, this means you can type:
 var myClip:MovieClip=myMovie[anInstanceName_0];

 to retrieve your clip.

 HTH,
  Ian
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] HashMap?

2006-06-30 Thread Bernard Poulin

For some AVM1 and AVM2 flash representation of objects, fire up this breeze
presentation about the flash player 9.

http://seminars.breezecentral.com/p64058844/

Around minute 28 into the presentation, it talks about AVM1 and AVM2
representation of an object.  Like I suspected, AVM1 uses 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 with hashmaps. Do you really think we can generalize being it
 worse all the time?

I will not be far wrong. If your primary allocation is to small, many
array keys hash to the same spot and you have to search a long linked
list. It is is too big, you waste a lot of space. It is not trivial to
increase the size of the allocation dynamically since you must rehash
all of the entries.
 Keeping an array ordered to be able to do binary searches can
 statistically cost a lot of copying at insertion time.
You are only adjusting links unless you want a balanced tree.
 Binary searches may involves a lot more string comparison. In a binary
 search comparing the string hash value is of no use to know if the
 value
 is greater or lower (to decide for the next search direction). In
 hashmaps, the lookup in the chain after the hash jump can, most of the
 time, skip a string entry without even looking at the characters by
 comparing the 32bit integer hashes.
String hashes are only useful for looking up a specific value. It is
unlikely that the hashes are even stored since once you store the
key/value you no longer have any need for the hash since the position in
the main table is known and you can follow the links in the overflow
back to the main table(usually).

If you are hashed into the overflow, you have to examine each key since
the hashes are identical for everyone in the list (otherwise they would
not be in the list - they would be in another list of collided hashes).

 About Arrays (this is more than slightly OT)  :-)

 I still believe Arrays are implemented as associative arrays. But this
is
 just pure belief since I have no proof and it could easily change from
 one
 version of the VM to the other.

Associative array is not a physical description of the implementation.
It describes the logical way that an Actionscript programmer finds the
value associated with a key. The implementation of Array probably
involves a fairly simple linked list of key objects that point to value
objects. Whether the keys are linked as a tree structure to speed up
access is an interesting question which was raised earlier.
 var a:Array;
 a[0] = 'abc';
 a[123456789] = 'high index value';
 a[this is text] = 'non-integer index';

 trace(a.length);   /// should output 123456790

 Sidenote: I often use this feature of Arrays to make an ordered
 associative array in one single object. This may look a bit like a
 hack -
 but it is perfectly valid. I can both traverse the keys in a fixed
custom
 order and lookup one item with its key directly. Also you can retrieve
 quickly how many items there are using length. For example, when
 inserting
 a new entry, I do something like:

  a[key] = value;
  a[a.length] = key;

 I would really like to have insights into the flash VM implementation
 so I
 could do better choices regarding maps and arrays.

Agreed
 regards,
 B.

 (--snip--rest of previous mail removed to keep it
 shorter---snip---)

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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* a  0xFF)*factor)+((b  0xFF)*fb))  0xFF) +
  a  0x00FF00)*factor)+((b  0x00FF00)*fb))  0x00FF00) +
  a  0xFF)*factor)+((b  0xFF)*fb))  0xFF);
}


2006/6/16, [EMAIL PROTECTED] [EMAIL PROTECTED]:


Hi Jeff,

Here's a class that will generate an array for N elements that blends
between two RGB values.

Example:
   import org.bespoke.color.ColorBlend;
   var myBlender:ColorBlend=new ColorBlend(0xFF,0x00FF00);

   //to get the RGBN value at 46% between the two...
   var resultColor:Number= myBlender.getRGBAt(.46);

   //get the blend in an array of 20 steps
   var myRGBArray:Array=myBlender.getArrayOfLength(20);

Hope this helps,
Cheers,
t


//
import flash.display.BitmapData;
import flash.geom.ColorTransform;
import flash.geom.Matrix;

class org.bespoke.color.ColorBlend extends Object{

   public var start_rgb:Number=0x00;
   public var end_rgb:Number=0xFF;

   private var colorTransform:ColorTransform;
   private var matrix:Matrix;

   public var bmp:BitmapData;
   public var bmp_end:BitmapData;

   function ColorBlend(c1:Number,c2:Number){
   if(c1!=undefined){start_rgb=c1;}
   if(c2!=undefined){end_rgb=c2;}
   bmp=new BitmapData(1,1,true);
   bmp_end=new BitmapData(1,1,true);
   matrix=new Matrix();
   colorTransform=new ColorTransform();
   }

   function getRGBAt(n:Number):Number{
   //n should be a normalised float (0-1.0)
   // although the range -1.0 = 1.0 is valid

   bmp.setPixel(0,0,start_rgb);
   bmp_end.setPixel(0,0,end_rgb);
   colorTransform.alphaMultiplier=n;
   bmp.draw(bmp_end,matrix,colorTransform);
   return bmp.getPixel(0,0);
   }

   function getArrayOfLength(n:Number):Array
   {
   var result:Array=new Array();
for(var i:Number=0;in;i++){
result.push(getRGBAt(i/n));
   }
   return result;
   }
}
//
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 tooltips and
somehow simply forgot the basics(!): It must work well and behave as
expected.

Looking at the source, it sounds like it works with or without the mx
components automagically.

B.

2006/6/8, Rajat Paharia [EMAIL PROTECTED]:


I have been very happy with these:

http://blog.pixelconsumption.com/?p=19
http://www.frogstyle.ch/go.cfm?tooltip_componentlanguage=en

best, - rajat

On 6/8/06, T. van Zantvoort  [EMAIL PROTECTED] wrote:

 Hi there,

 I am looking for a great tooltip component and/or script. I have tried
 several but they just don't qualify. With one I have font problems, with

 the
 other embed problems and another delay, display / don't display problems
 etc. etc.

 Is there something else out there??

 met vriendelijke groeten,


 T. van Zantvoort
 MonTay WebArchitects

 T: +31 (0)40-2300898
 F: +31 (0)40-2954071
 E: [EMAIL PROTECTED]
 W: www.montay.nl
 
 Hardware: www.mlife.nl
 E-shop:   www.vsnet.nl
 Own Site: www.1site2start.nl
 

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




--
Rajat Paharia
[EMAIL PROTECTED]
http://www.bunchball.com
http://www.rootburn.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 size (without being bigger
than the whole Stage width).

B.


2006/6/9, Marc Hoffman [EMAIL PROTECTED]:


Hi Karina,

This has some nice features but some problems viewing the demo. In
FireFox it doesn't show at all. In I.E. 6 it doesn't show and I get a
Flash required message. I was able to view it only by looking at
the source and opening the swf directly.

It would be nice if the tooltip width were dependent on the text
string. That shouldn't be too hard to add, just draw the background
after establishing the textfield.text.width.

Marc

At 10:11 AM 6/9/2006, you wrote:

Hi Weyert,

I posted a fully customizable tooltip component on my blog,
http://www.neo-archaic.net/blog/2006/05/09/tooltip.htm, complete with a
demo
on how to use it.

I hope this is what you were looking for.

Karina


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 standard described in RFC 2392.

Haven said that, anybody tried using  cid: uris in html documents - does
it work?

B.

2006/6/2, Kevin Aebig [EMAIL PROTECTED]:


Does anyone else find it funny that even though IE doesn't support this,
Outlook does? I've received all kinds of stupid emails with encoded
sounds,
images and other objects from relatives...

!k

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jim Cheng
Sent: June 2, 2006 3:01 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Embedding a SWF using base64 and Data: URI
scheme

Tom Lee wrote:

 In the original Microsoft list of workarounds for the Eolas patch, one
of
 the possible workarounds was to base64 encode your swf and embed the
data
 inline in your object tag.  The original page has since been removed,
and
 the only evidence I can now find of this is at
 http://www.mustardlab.com/developer/flash/standards/, a page being kept
 around for archival reasons (see the official fixes section).  Though
I
 don't need this technique as an Eolas workaround, I'm still really
curious
 about it.  Is it possible to base64 encode a swf file and include that
raw
 data in your web page instead of hosting a separate swf file on your
server?


 Anyone have experience with the Data: URI Scheme?  I find it odd that
 Microsoft would include it in their list of workarounds if their browser
 didn't support it, but then again, maybe that's why the page was
removed.
 I'd like to at least get this working in Mozilla browsers.

Tom,

Hey, it's Mustard Lab--that's us.  I actually work with Sean Christmann,
the author of the page that you referred to, and would refer you to him,
but he's out until Monday so I'll take a stab at elaborating on this.

The very short answer to your question is that that the data: URI scheme
(RFC 2397) is not supported by Internet Explorer.  It does, however,
work with most other browsers on the market, including Firefox, Opera
and Safari.  As such, it is not helpful in terms of working around the
recent change in IE to bring it into compliance with the Eolas patent.

To answer your second question, yes it is possible to use this technique
to encode a SWF file within a containing HTML page.  A while back, I
actually managed to write out a second SWF to a HTML page from another
SWF with a bit of Javascript. You can see a working example with source
code here:  http://dev.psalterego.com/datauri/.

Originally, I was experimenting with using the data URI scheme as a
possible means to obfuscate SWFs encoded within an outer wrapper SWF to
make it slightly more difficult for relatively unskilled script
kiddies to quickly recover and decompile the bytecodes for the inner
SWF via a simple attack with a decompiler.  However, as such a scheme
would result in the inner protected SWF being completely inaccessible
to Internet Explorer users, I never pursued this idea further.

Keep in mind that this technique is not particularly efficient in terms
of file size, particularly if the base 64 encoded data is stored in
HTML.  There are also limitations on the maximum possible length of a
URL supported by each browser that effectively limit the size of the
data that you can include via a data URI scheme.

Jim



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] HashMap?

2006-05-17 Thread Bernard Poulin

Ah yes, now that you mention it, I just checked the Java HashMap code and it
is not limited to a power of two, here's a snippet:

index = (hash  0x7FFF) % table.length;

That way, they can still use the same set of 32bit hash values when growing.
There is no maximum that can be declared. 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 it is needed).

 In that scenario, only a portion of the hash value is used to make the
 hash
 lookup. The complete hash stays around since it is part of the String
 object
 and so can still be used to quickly distinguish strings.  Also when
 rehashing you do not need to really compute new hashes - you just
 need
 to re-distribute them based on more bits of the complete hash.

That only works if the hash primary table has a length that is a power
of 2. If your original has maps from 1-5,000 and your increase the size
of the primary storage area to 15,000, you will need more than more
bits, you will need a completely different set of hash values.
Not sure what Java does with its hash. Do you have to declare the
maximum array size when you declare the array?

Ron
 And yes, this
 is still heavier than re-balancing a tree.

 regards,
 B.


 Binary searches may involves a lot more string comparison. In a binary
  search comparing the string hash value is of no use to know if the
  value
  is greater or lower (to decide for the next search direction). In
  hashmaps, the lookup in the chain after the hash jump can, most
 of the
  time, skip a string entry without even looking at the characters by
  comparing the 32bit integer hashes.
 String hashes are only useful for looking up a specific value. It is
 unlikely that the hashes are even stored since once you store the
 key/value you no longer have any need for the hash since the position
in
 the main table is known and you can follow the links in the overflow
 back to the main table(usually).

 If you are hashed into the overflow, you have to examine each key since
 the hashes are identical for everyone in the list (otherwise they would
 not be in the list - they would be in another list of collided hashes).

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 stays around since it is part of the String object
and so can still be used to quickly distinguish strings.  Also when
rehashing you do not need to really compute new hashes - you just need
to re-distribute them based on more bits of the complete hash. And yes, this
is still heavier than re-balancing a tree.

regards,
B.



Binary searches may involves a lot more string comparison. In a binary
 search comparing the string hash value is of no use to know if the
 value
 is greater or lower (to decide for the next search direction). In
 hashmaps, the lookup in the chain after the hash jump can, most of the
 time, skip a string entry without even looking at the characters by
 comparing the 32bit integer hashes.
String hashes are only useful for looking up a specific value. It is
unlikely that the hashes are even stored since once you store the
key/value you no longer have any need for the hash since the position in
the main table is known and you can follow the links in the overflow
back to the main table(usually).

If you are hashed into the overflow, you have to examine each key since
the hashes are identical for everyone in the list (otherwise they would
not be in the list - they would be in another list of collided hashes).


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] HashMap?

2006-05-15 Thread Bernard Poulin

I think there are no tuning parameters simply because the language does
not (and should not) specify how the Objects are implemented (and not
because they are not hashmaps). From what we know so far (i.e. nothing!),
this could be anything - like a straight array up to, say, 3 entries and
switching to another more complex structure after that.

By variable key length did you mean automatically growing the relevant
hash size (i.e. involving re-distribution) - A bit like what is happening
with the Java HashMap implementation ?

B.

2006/5/15, Ron Wheeler [EMAIL PROTECTED]:


The tree would make sense. The garbage collection for an associative
array is an interesting problem with variable key and value lengths.

Ron

Scott Hyndman wrote:
 Well, yes.

 Now that I think about it my test didn't make much sense, since there
would be no way of determining how keys are generated by insertions
alone...I was assuming a uniform distribution, and it can't be done without
knowing more.

 But I believe that the Flash uses a tree to implement its map, for some
of the same reasons you mentioned. It's just a way more efficient structure
to use if your data is unknown, grows well, and stays balanced.

 Scott

 -Original Message-
 From: [EMAIL PROTECTED] on behalf of Ron Wheeler
 Sent: Sat 5/13/2006 2:25 PM
 To:   Flashcoders mailing list
 Cc:
 Subject:  Re: [Flashcoders] HashMap?

 Wouldn't it be true to say that hash maps will get slower as the
 probability of collisions increase? As the primary area fills up, there
 will be more occasions when the new key to be added, hashes to a storage
 location already occupied and a link structure will be needed to store
 the key(s) in the overflow.
 Similarly, lookups will start to hit links rather than data which will
 require that the links into the overflow area be followed.

 This is where tuning comes in.

 The fact that there are no tuning options makes it unlikely that hashing
 is used.
 Defaults would be hard to set without wasting space or turning the whole
 thing into a small set of linked lists which work be long to search.
 It would not be seem to be a very good choice for a default
 implementation of Arrays.

 Ron

 Scott Hyndman wrote:

 You could figure out how it's implemented by doing some experiments.

 Dynamic hash maps have constant insertion (amortized) and lookup time.
If the map is implemented using a B-Tree, then you'll see O(log(n)) times
(so just see if the more properties you add increase the amount of time it
takes to add them).

 Scott

 -Original Message-
 From:[EMAIL PROTECTED] on behalf of Ron
Wheeler
 Sent:Sat 5/13/2006 10:43 AM
 To:  Flashcoders mailing list
 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. Associative arrays)
 http://en.wikipedia.org/wiki/Associative_array#JavaScript

 It is very possible that the internal implementation is not a
hashmap,
 but I still think it is a highly efficient map of some sort because
 this is
 so central to the language.



 I would hope that it is efficient but hashing adds a lot of overhead
and
 wasted space for small arrays and really needs to be tuned to get the
 desired results for larger arrays.
 If the arrays are stored in sorted order, then the normal key lookup
can
 be done as a binary lookup which will be a lot quicker than an
 exhaustive search. The price is paid when a new associative entry is
added.

 Nothing is free.

 None of my work has required has involved large associative arrays
where
 hashing would add a significant improvement in speed but it would be
 nice to have such a class available for those who need it.

 In the early days (1960s) when I was taking Computer Science at
 University, we spent a lot of time worrying about these things since
 memory was scarce (64K word (36 bits per word) computer cost a million
 dollars and supported 16 users) and CPU speeds where not very fast (a
 1MIP computer was state of the art).




 If really had to look carefully at how things got stored and retrieved,
 it you had a large number of them.

 should have been written as

 One really had to look carefully at how things got stored and
retrieved,
 if you had a large number of them.


 ...at least this is what I think.  I might be completely wrong.
 B.

 2006/5/12, Ron Wheeler [EMAIL PROTECTED]:


 I would be a little surprised. There does not seem to be any way to
 control the hash parameters and every array would have a lot of
wasted
 space for nothing and without any way to control the hash size and
the
 percent utilization, you would not get a lot of advantage for the big
 arrays.

 The Java HashMap defaults are pretty modest and would yield less than
 optimal performance with a big array.
 You can set the parameters

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 is to
make a socket connection back to your server and look at some of the
structures involved in the connection?- The external IP might be available
in there (really not sure). I do not know enough about NATs to know if it is
even possible(!). The better/safer way is surely a server-based solution.

If you want the IP of the client machine - then you will have to look at a
flash / javascript / Java solution running on the client machine.

One of the core problem is that some connections might not even use TCP/IP
and thus there are no IPs involved at all.  For example: if you open an html
page located on your local hard drive. So any solution you might have on the
client side will be some kind of hack one way or the other. I think it can't
be standard.

B.

2006/5/15, j.c.wichman [EMAIL PROTECTED]:


Hi,
i'd go with the server side solution instead of depending on java running.
Let's face it, if we all had such great confidence in java we'd be posting
on the javadev list:) (ok erase that comment).
Anywayz, php makes for a good solution i think, but I believe standaard
ssi
env vars will do the trick as well?
eg if ssi is configured for your webserver and you use the vars from
http://hoohoo.ncsa.uiuc.edu/cgi/env.html
see http://httpd.apache.org/docs/1.3/howto/ssi.html as well.

What you are suggesting, if i got it right, to not allow the user to
download the code at all, if his ip was already banned, seems good to me
too:).

grtz
H





 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf
 Of MetaArt
 Sent: Monday, May 15, 2006 1:21 PM
 To: Flashcoders mailing list
 Subject: Re: [Flashcoders] Grab IP address

 Well,
 controversies apart, the Google search don't match good result...
 apparently, JavaScript IP grab can be done only on Mozilla,
 and with Java enabled, and this isn't good for my goal.
 I'm developing a widget, and I need a way to check the owner
 IP, to ban a self, improper, use.
 Cause the way the widget can be inserted in a web page (just
 some rows of code, but necessarily only JavaScript and/or
 Flash embed, because I can't know if the user can modify his
 page(s) to php...), I need an approach that match some simply rules:
 - easy and crossbrowser way to insert in web page(s)
 - a trustwhorty way to identify the owner, to avoid that in
 case he should use the widget I think that the better way to
 achieve this goal is grab the IP.
 Actually, I can grab the IP, via PHP, when the user come to
 get the code...
 but, however, I have always a doubt about it: is this the
 better solution to achieve my goal?
 Tell me your opinion...

 * Enrico Tomaselli
 * web designer
 [EMAIL PROTECTED]
 http://www.metatad.it
 * Skype: MetaArt
 RSS: http://www.metatad.it/mnfeeder.php

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 array ordered to be able to do binary searches can
statistically cost a lot of copying at insertion time.
Binary searches may involves a lot more string comparison. In a binary
search comparing the string hash value is of no use to know if the value
is greater or lower (to decide for the next search direction). In
hashmaps, the lookup in the chain after the hash jump can, most of the
time, skip a string entry without even looking at the characters by
comparing the 32bit integer hashes.

About Arrays (this is more than slightly OT)  :-)

I still believe Arrays are implemented as associative arrays. But this is
just pure belief since I have no proof and it could easily change from one
version of the VM to the other.

var a:Array;
a[0] = 'abc';
a[123456789] = 'high index value';
a[this is text] = 'non-integer index';

trace(a.length);   /// should output 123456790

Sidenote: I often use this feature of Arrays to make an ordered
associative array in one single object. This may look a bit like a hack -
but it is perfectly valid. I can both traverse the keys in a fixed custom
order and lookup one item with its key directly. Also you can retrieve
quickly how many items there are using length. For example, when inserting
a new entry, I do something like:

 a[key] = value;
 a[a.length] = key;

I would really like to have insights into the flash VM implementation so I
could do better choices regarding maps and arrays.

regards,
B.

(--snip--rest of previous mail removed to keep it shorter---snip---)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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.

http://www.geocities.com/chessdp/   *World* *Game* *Of* *Sprouts* *
Association*


2006/5/11, Weldon MacDonald [EMAIL PROTECTED]:


I have a request for a game called sprouts. The game starts with a few
randomly distributed dots. There is one move and 2 restrictions.
Move:   draw a line for a dot to itself (a loop) or to another dot.
Any line drawn has a new dot on it.
Restriction 1: no more than 3 lines from any dot.
Restriction 2: no lines can cross.

Simple game, but the data structure to keep track of the game and in
particular to handle restriction 2 is a bear. How do you tell when a
dot has been encircled by a line?

The game is, of course based on graph theory, and you can represent a
graph in several ways, but how to determine that it remains planar?

I haen't begun to think about the visual part of this, if I don't have
a reasonable data structure I can't teach a computer to play the game.

Any ideas? Hints? Wildly improbable ideas?

--
Weldon MacDonald
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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/~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.

 http://www.geocities.com/chessdp/   *World* *Game* *Of* *Sprouts* *
Association*


2006/5/11, Weldon MacDonald [EMAIL PROTECTED]:

 I have a request for a game called sprouts. The game starts with a few
 randomly distributed dots. There is one move and 2 restrictions.
 Move:   draw a line for a dot to itself (a loop) or to another dot.
 Any line drawn has a new dot on it.
 Restriction 1: no more than 3 lines from any dot.
 Restriction 2: no lines can cross.

 Simple game, but the data structure to keep track of the game and in
 particular to handle restriction 2 is a bear. How do you tell when a
 dot has been encircled by a line?

 The game is, of course based on graph theory, and you can represent a
 graph in several ways, but how to determine that it remains planar?

 I haen't begun to think about the visual part of this, if I don't have
 a reasonable data structure I can't teach a computer to play the game.

 Any ideas? Hints? Wildly improbable ideas?

 --
 Weldon MacDonald
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com





___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 game constraints?  I am assuming these are
straight lines, right?  ...or can they be of any shape?

Essentially what you (seem to) want is simply checking if any line crosses
when the user interacts with a dot or a line. In other words, block the user
from drawing a line that will cross another one.  Just for that, you do not
need to keep track of all the possibilities in advance...

A straight array of dots and lines should be enough for this. ...or I must
be missing something.

I know that doing an intersection check on a complete graph can be a lengthy
task but:

Since this an interactive, human-driven game - you can reduce the
verification processing by just checking one move at a time. The processing
time will be at least linear (e.g. not exponential). So it should not be too
too bad - especially if the number of segments should fit on a screen in a
human-readable form ( 200 ?).

my 0,02$
B.


2006/5/12, Weldon MacDonald [EMAIL PROTECTED]:


My first thought was an adjacency list with something to indicate
forbidden edges (for a dot  inside a cycle), so it might help. The
problem isn't that simple though, as more and more moves are made
whose in what cycle and can make waht move is a good deal less than
clear.

On 5/12/06, André Goliath [EMAIL PROTECTED] wrote:
 FWIW if have written some AS2 classes some time ago that implement a
graph
 by using adjacenty lists.
 If it would help you let me know

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Weldon
 MacDonald
 Sent: Thursday, May 11, 2006 2:49 PM
 To: Flashcoders mailing list
 Subject: [Flashcoders] sprouts data structure

 I have a request for a game called sprouts. The game starts with a few
 randomly distributed dots. There is one move and 2 restrictions.
 Move:   draw a line for a dot to itself (a loop) or to another dot.
 Any line drawn has a new dot on it.
 Restriction 1: no more than 3 lines from any dot.
 Restriction 2: no lines can cross.

 Simple game, but the data structure to keep track of the game and in
 particular to handle restriction 2 is a bear. How do you tell when a
 dot has been encircled by a line?

 The game is, of course based on graph theory, and you can represent a
 graph in several ways, but how to determine that it remains planar?

 I haen't begun to think about the visual part of this, if I don't have
 a reasonable data structure I can't teach a computer to play the game.

 Any ideas? Hints? Wildly improbable ideas?

 --
 Weldon MacDonald
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com



--
Weldon MacDonald
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: FW: [Flashcoders] sprouts data structure

2006-05-12 Thread Bernard Poulin

oh my apologies, I really did not realize that you had to implement an
actual player and thus do all the AI. Actually had no clue about what this
game really looked like. I understand it a bit better now: The game plays
with 2 players, lines are not straight, new dots can be placed anywhere on
the line, one wins when its opponent cannot do a move.

Interestingly enough, the outcome is somehow deterministic: from Wikipedia:
http://en.wikipedia.org/wiki/Sprouts_(game)

[]By enumerating all possible moves, one can show that the first player is
guaranteed a win in games involving three, four, or five spots. The second
player can always win a game started with one, two, or six spots.

At Bell Labs http://en.wikipedia.org/wiki/Bell_Labs in
1990http://en.wikipedia.org/wiki/1990,
David 
Applegatehttp://en.wikipedia.org/w/index.php?title=David_Applegateaction=edit,
Guy 
Jacobsonhttp://en.wikipedia.org/w/index.php?title=Guy_Jacobsonaction=edit,
and Daniel Sleator http://en.wikipedia.org/wiki/Daniel_Sleator used a lot
of computer http://en.wikipedia.org/wiki/Computer power to push the
analysis out to eleven spots. They found that the first player has a winning
strategy when the number of spots divided by six leaves a remainder of
three, four, or five, and conjectured that this pattern continues beyond
eleven spots.[]
Regards,
B.

2006/5/12, Weldon MacDonald [EMAIL PROTECTED]:


The reqiurement is that the software be able to play the game, so I
need a data structure to store the game position for analysis. The
intersection check is moot until I can store the current state of the
game, update it, and analyze the potential moves.
If moves are made that create a cycle, then the possibility of a
vertex, or even a subgraph, being contained by that cycle exists,
which removes the possibility of edges to a vertex outside the cycle,
but not to the vertexes in the cycle. That would have to be
incorperated into the data structure.
I think the adjacency list might store the position, but then the AI
for the game will be very tough to do.
As for the intersection check this will work 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 - 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 game constraints?  I am assuming these are
 straight lines, right?  ...or can they be of any shape?

 Essentially what you (seem to) want is simply checking if any line
crosses
 when the user interacts with a dot or a line. In other words, block the
user
 from drawing a line that will cross another one.  Just for that, you do
not
 need to keep track of all the possibilities in advance...

 A straight array of dots and lines should be enough for this. ...or I
must
 be missing something.

 I know that doing an intersection check on a complete graph can be a
lengthy
 task but:

 Since this an interactive, human-driven game - you can reduce the
 verification processing by just checking one move at a time. The
processing
 time will be at least linear (e.g. not exponential). So it should not be
too
 too bad - especially if the number of segments should fit on a screen in
a
 human-readable form ( 200 ?).

 my 0,02$
 B.


 2006/5/12, Weldon MacDonald [EMAIL PROTECTED]:
 
  My first thought was an adjacency list with something to indicate
  forbidden edges (for a dot  inside a cycle), so it might help. The
  problem isn't that simple though, as more and more moves are made
  whose in what cycle and can make waht move is a good deal less than
  clear.
 
  On 5/12/06, André Goliath [EMAIL PROTECTED] wrote:
   FWIW if have written some AS2 classes some time ago that implement a
  graph
   by using adjacenty lists.
   If it would help you let me know
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf Of
Weldon
   MacDonald
   Sent: Thursday, May 11, 2006 2:49 PM
   To: Flashcoders mailing list
   Subject: [Flashcoders] sprouts data structure
  
   I have a request for a game called sprouts. The game starts with a
few
   randomly distributed dots. There is one move and 2 restrictions.
   Move:   draw a line for a dot to itself (a loop) or to another dot.
   Any line drawn has a new dot on it.
   Restriction 1: no more than 3 lines from any dot.
   Restriction 2: no lines can cross.
  
   Simple game, but the data structure to keep track of the game and in
   particular to handle restriction 2 is a bear. How do you tell when a
   dot has been encircled by a line?
  
   The game is, of course based on graph theory, and you can represent
a
   graph in several ways

Re: [Flashcoders] HashMap?

2006-05-12 Thread Bernard Poulin

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. Associative arrays)
http://en.wikipedia.org/wiki/Associative_array#JavaScript

It is very possible that the internal implementation is not a hashmap,
but I still think it is a highly efficient map of some sort because this is
so central to the language.

...at least this is what I think.  I might be completely wrong.
B.

2006/5/12, Ron Wheeler [EMAIL PROTECTED]:


I would be a little surprised. There does not seem to be any way to
control the hash parameters and every array would have a lot of wasted
space for nothing and without any way to control the hash size and the
percent utilization, you would not get a lot of advantage for the big
arrays.

The Java HashMap defaults are pretty modest and would yield less than
optimal performance with a big array.
You can set the parameters if you have a big array and know a bit about
the randomness of your keys to get fast lookups with a reasonable
trade-off in wasted space

Perhaps someone who knows the Flash Player 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]:

 It appears that a HashMap is a Java class that uses a hash on the key
 to store its keys and values.
 http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html
 This would speed up lookup if you have a large set of keys.
 If you do not need the speed or do not have a large collection of keys
 to store, an array object would seem to give the same functionality in
 ActionScript.
 This leaves the implementation of the array to Flash and it is likely a
 simple structure that has to be searched sequentially (by the Flash VM)
 to get the associated value.

 It you really need a hashing array that can handle large numbers of
 key/value pairs, you probably have to write one. This is an old concept
 and you can likely find a few design ideas and probably some code if
you
 search for it.

 If you are converting code and want to create a HashMap class that has
 the same methods as HashMap in Java, you could fake the internal
storage
 technology with a simple Array. it would be faster for a small set of
 values and would get a bit slower as the number of keys increased.
 You could start with a dumb HashMap class and then make it a true
 hashing data store later without having to rewrite your code.
 HashMap was only added to Java in Java 1.1 and they lived without it
 before then.

 Ron

 Joshua Graham wrote:
  Bit strange, but that works, thanks.
 
  Joshua
 
  On 10 May 2006, at 12:06, Lee McColl-Sylvester wrote:
 
  Well, in AS2, it's called an object ;)
 
  Lee
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
 Joshua
  Graham
  Sent: 10 May 2006 11:19
  To: flashcoders@chattyfig.figleaf.com
  Subject: [Flashcoders] HashMap?
 
  Is there an AS3 equivalent of the java HashMap?
 
  Basically, I just need the ability to set key/value pairs quickly/
  easily.
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 
 
 
 


 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com

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 a hash on the key
to store its keys and values.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/HashMap.html
This would speed up lookup if you have a large set of keys.
If you do not need the speed or do not have a large collection of keys
to store, an array object would seem to give the same functionality in
ActionScript.
This leaves the implementation of the array to Flash and it is likely a
simple structure that has to be searched sequentially (by the Flash VM)
to get the associated value.

It you really need a hashing array that can handle large numbers of
key/value pairs, you probably have to write one. This is an old concept
and you can likely find a few design ideas and probably some code if you
search for it.

If you are converting code and want to create a HashMap class that has
the same methods as HashMap in Java, you could fake the internal storage
technology with a simple Array. it would be faster for a small set of
values and would get a bit slower as the number of keys increased.
You could start with a dumb HashMap class and then make it a true
hashing data store later without having to rewrite your code.
HashMap was only added to Java in Java 1.1 and they lived without it
before then.

Ron

Joshua Graham wrote:
 Bit strange, but that works, thanks.

 Joshua

 On 10 May 2006, at 12:06, Lee McColl-Sylvester wrote:

 Well, in AS2, it's called an object ;)

 Lee



 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Joshua
 Graham
 Sent: 10 May 2006 11:19
 To: flashcoders@chattyfig.figleaf.com
 Subject: [Flashcoders] HashMap?

 Is there an AS3 equivalent of the java HashMap?

 Basically, I just need the ability to set key/value pairs quickly/
 easily.
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




 

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 hoping someone can help...

I need to plot points at an equal distance along the circumfrence of an
Ellipse.
As it turns out, I'm pretty bad at geometry, which doesn't help.

I can plot the ellipse, but because I'm using sine/cos and incrementing
with
theta the points are crunched towards the outside of the major radius.
I've tried a bunch of different approaches- recording lots (5000) of
points,
then stepping through each to compare actual distance but I'm not getting
nearly accurate results this way.
I've looked at drawing dotted/dashed curves from drawing api/custom
classes
but no luck.

If I could affect theta at the same rate the ellipse is plotted I think
I'd
be ok, but I can't quite grasp it.

I've read all sorts of impossiblilites about this,and a lot of people
having
miserable experience with this sort of thing (one guy spent 8 years trying
to fit an equal-sided polygon in to an ellipse).

But- at the end of the day I can go to the Flash IDE and draw an ellipse
and
stroke it with an equally spaced dotted line!  I just need to do this
dynamically and record the points...

Any thoughts?

Thanks much,

Peter

[sorry if this is a duplicate]
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 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 hoping someone can help...

 I need to plot points at an equal distance along the circumfrence of an
 Ellipse.
 As it turns out, I'm pretty bad at geometry, which doesn't help.

 I can plot the ellipse, but because I'm using sine/cos and incrementing
 with
 theta the points are crunched towards the outside of the major radius.
 I've tried a bunch of different approaches- recording lots (5000) of
 points,
 then stepping through each to compare actual distance but I'm not
 getting
 nearly accurate results this way.
 I've looked at drawing dotted/dashed curves from drawing api/custom
 classes
 but no luck.

 If I could affect theta at the same rate the ellipse is plotted I think
 I'd
 be ok, but I can't quite grasp it.

 I've read all sorts of impossiblilites about this,and a lot of people
 having
 miserable experience with this sort of thing (one guy spent 8 years
 trying
 to fit an equal-sided polygon in to an ellipse).

 But- at the end of the day I can go to the Flash IDE and draw an ellipse
 and
 stroke it with an equally spaced dotted line!  I just need to do this
 dynamically and record the points...

 Any thoughts?

 Thanks much,

 Peter

 [sorry if this is a duplicate]
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 way, each line could have a different
height to maximize the screen space. But that's probably OT... :)

My 0.02 $
B.

2006/5/8, Mike Mountain [EMAIL PROTECTED]:


All my squares need to be the same size - so for example what's the best
way of laying out 'n' equal squares in an areas x,y so the squares are as
big as they can be. There must be an algo for this kind of thing.

M

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf
 Of Kerem Gülensoy
 Sent: 08 May 2006 13:59
 To: 'Flashcoders mailing list'
 Subject: AW: [Flashcoders] Fitting squares into an area

 you could divide the area, divide one half again, divide the
 other half, and so on...n-times...

 cheers | kerem

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Im Auftrag
 von Mike Mountain
 Gesendet: Montag, 8. Mai 2006 14:51
 An: Flashcoders mailing list
 Betreff: [Flashcoders] Fitting squares into an area

 Anyone got any script to cover the following problem:
 Given an area (x,y)  what's the best way of filling it with
 'n' squares?
 Cheers
 M
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 will be some space lost
somewhere. Unless it exactly fits a 5x1 or 1x5 ratio.

Danny:  I do not understand your algorithm - could you shed some more
(high-level) light on what it is doing?

hey! this is actually fun! I love these little algorithms.

To compute the square size:  I am thinking that we should work with the area
ratio somehow. Just to be sure I understand what you want:

I am assuming that this is showing a list of things and that it is okay
that the last line has less items. If the area is width=305 height=400 and N
is 10,  it will result in square size is 100 -- the first 2 lines will be
almost full (5 pixels gap on each line) and the last line is 1/3 full.
Visually:

1   2   3
4   5   6
7   8   9
10   -   -

Here we are showing a 3x4 rectangle which is the best ratio to fit 10
squares in 305x400.

...is this what you are looking for?

B.


2006/5/8, Steve Webster [EMAIL PROTECTED]:


Mike,

 All my squares need to be the same size - so for example what's the
 best way of laying out 'n' equal squares in an areas x,y so the
 squares are as big as they can be. There must be an algo for this
 kind of thing.


I might be being a little stupid, but since it's a square, and since
width x height = height x width, why not just:

// Calculate max area of each square
var area:Number = Math.floor((x * y) / n);

// Calculate side length from area
var sideLength:Number = Math.sqrt(area);


PS. It is Monday, so forgive me if the above doesn't work.

--
Steve Webster
Head of Development

Featurecreep Ltd.
http://www.featurecreep.com
14 Orchard Street, Bristol, BS1 5EH
0117 905 5047


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 + 4 -
1) = 6. (it started at 1x1 and did 6 iterations: something like:  1x1, 1x2,
2x2, 2x3, 3x3, 3x4)

For N = 100, the number of iteration depends on the ratio: it could be
anywhere from 19 (10x10-1) to 100 iterations (worst case happens if the
output is a single line or a single column).  So that would make N
iterations (in worst cases) and ~2*SQRT(N)-1 best case.

I took the liberty of optimizing the method a little bit and renaming a few
internal variables to my personal liking. ;-)  -- I did not do any real
life testing on this. But it seems to work on paper.

/**
* computes the largest N square size (and layout) that can fit an area
(width,height).
*
* @return an Object containing 'squareSize' and the number of 'cols' and
'rows'.
*
* 98% of the credits goes to Danny Kodicek
*/
function computeLargestSquareSizeAndLayout(width:Number, height:Number,
Nsquares:Number): Object
{
  var cols:Number = 1;
  var rows:Number = 1;
  var swidth:Number = width;
  var sheight:Number = height;
  var next_swidth:Number = width/(cols+1);
  var next_sheight:Number = height/(rows+1);
  while (true)
  {
   if (cols*rows = Nsquares)
   {
   var squareSize:Number = Math.min(swidth, sheight);
   return { squareSize:squareSize, cols:cols, rows:rows };
   }

   if (next_swidth  next_sheight)
   {
   cols++;
   swidth = next_swidth;
   next_swidth = width/(cols+1);
   }
   else
   {
   rows++;
   sheight = next_sheight;
   next_sheight = height/(rows+1);
  }
   }
}


B.

2006/5/8, Danny Kodicek [EMAIL PROTECTED]:


Danny:  I do not understand your algorithm - could you shed some more
(high-level) light on what it is doing?

Sure. The idea is that the optimal size will always be an exact fraction
of
either the width or the height. So what we do is drop down by multiples of
these until we get to the first size that will contain N or more squares.
At
any particular width, we keep track of the two 'next-smallest' widths and
drop down to the largest of these. Run through the algorithm with a few
sample numbers and it should make sense.

It may be that there's a more algebraic approach. The problem is, though,
that there is no simple relationship between floor(x), floor(y) and
floor(xy), which would be needed to come up with any truly useful
solution.
In the end, it turns into quite a complex optimisation problem, and given
that the brute force algorithm is actually pretty fast, it hardly seems
worth the effort :)

Danny

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 that, you have to convert the coordinates values from your local
movie-clip to its parent.  In short: get the bounding rectangle and convert
xMin,xMax, etc.  There are methods specifically for that
(localToGlobal/GlobalToLocal). It will do all the dirty computation
(translation, scaling, rotation).

good luck!
B.

2006/4/24, Mark Winterhalder [EMAIL PROTECTED]:

 Hi,

 as far as I know, there is no clean solution to this problem.

 However, if you feel hackish, this /could/ work:

 var w = myClip._width;
 var h = myClip._height;
 var clip = myClip.createEmptyMovieClip( foobar,
 myClip.getNextHighestDepth() );
 with( clip ) {
 beginFill( 0x00ff00, 100 ) {
 lineTo( w, 0 );
 lineTo( w, h );
 endFill();
 }
 var x = myClip._width - w;
 var y = myClip._height - h;
 clip.removeMovieClip();

 Now, (x, y) should be the coordinates of your origin (i.e., top left
 is at (-x, -y)).

 Maybe. I haven't tested it.

 Good luck...
 Mark



 On 4/24/06, Meinte van't Kruis [EMAIL PROTECTED] wrote:
  Hi folks,
 
  I have a problem correctly figuring out the actual x value of the
 top-left
  corner of a movieclip when scaling it.
  To demonstrate to this:
 
  put movieclip t on stage(a black box). Edit it, so that it's left top
 corner
  isn't on the movieclip centerpoint.
 
  this code on stage:
 
  onEnterFrame=function(){
  t._xscale++;
  trace(t._x);
  trace(t.getBounds().xMin);
  trace(t.getRect().xMin);
  }
 
  if you execute it, you can clearly see the top-left corner is in fact
  moving, due to the scaling.
  But the values never change. So my question is:
 
  how do I know the coordinates of the topleft corner of an (off-centered)
  movieclip, or
  the coordinates of the topright corner of a centered movieclip while
 scaling
  it?
 
  I'm really stuck on this, help would be very much appreciated.
 
  greetings,
  Meinte
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 


 --
 http://snafoo.org/
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 globalToLocal
internally).

cheers,
B.



2006/4/24, Zeh Fernando [EMAIL PROTECTED]:

  When I found this out It confused the hell out of me as
  localToGlobal had never worked like that before - I just
  assumed I'd never used it with anything scaled by hand before
  and wrote that off as the reason.
  Now if what you're saying is true then it gets even more confusing.
 
  One difference may be that I'm actually attaching an MC to point MC and
  trying to get it's coords? I bet when you attach an MC it doesn't
  inherit the transform matrix info from its parent.

 Maybe - or maybe because you're loading content from an outside SWF.

 I've never tested localToGlobal with both attaching and loading; I'd guess
 it should work, but I can't test it right now to really know. I'll keep it
 in mind if I have problems with localToGlobal in the future though; thanks
 for the info, it has made me curious.


 - Zeh

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 control this and not
the client (browser).

 - Note that the connection should disconnect by itself after some time. Did
you measure how much time you had to wait? (probably a couple of minutes). I
think it should never be foreever.  Maybe you did not realize this timeout
potentially makes this less of a problem. (?)

For Internet Explorer, the keepalivetimeout registry setting is
KeepAliveTimeout under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings

- If you just want to turn off keep-alive temporarily just to do a test on
your machine, it is possible that you can turn it off in your browser's
options (set it to not use HTTP 1.1) or by modifying a registry key. Or
else, you can try to find a proxy or tcptunnel that could force it off.

- A potential brute-force solution (not sure it is really reliable): I
know that you can control the keep-alive on a request-basis by modifying the
http headers (at least in IE). You can try to use XMLHttpRequest (from
javascript) and force to turn off the keep-alive option by setting HTTP
Headers. That is - after you finished doing your XML query. -- that's on the
client (browser) side - Make many connections to be sure you saturate all
the available connections (something like 2, 3 or 4).

- Make sure you use a keep-alive-friendly proxy (or tcp tunnel) to really
test that the connections are kept alive and that your method really makes
a difference.

- I do not know if we can control the HTTP Headers from within flash - if
you can, try to modify the headers to shutoff the keep-alive option. It
*might* be possible with the recent flash player 8 (raw sockets).

hope this helps,
B.

2006/4/21, Nathanial Thelen [EMAIL PROTECTED]:

 Thank you for the idea on that one.  I am particularly looking for a
 browser
 side only solution in this case.

 Thanks,
 Nate


 On 4/21/06 2:57 PM, David Rorex [EMAIL PROTECTED] wrote:

  On 4/21/06, Nathanial Thelen [EMAIL PROTECTED] wrote:
 
  I was wondering if anyone out there know how to force a XML connection
  closed once the onLoad has happened?  The way it works currently is
 that
  if
  the webserver has keep-alives on, the connection to the server stays
 open.
  I am pretty sure that the browser controls this, but would love to hear
  any
  ideas on the topic.
 
 
  Possibly you could use a php file (or whatever server scripting language
 you
  use ) on the server, which does only 2 simple things:
  1. Send a HTTP header that indicates not to use keep-alive. Keep-alive:
 no
  or something? look up the exact command. This will tell the browser not
 to
  use that feature.
  2. Print out the xml file, which will be received by flash.
 
 
  -David R
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com


 --
 Nathanial Thelen
 Partner
 Userplane
 LA: 323-938-4401 x203
 www.userplane.com

 AOL: natethelen
 MSN: [EMAIL PROTECTED]
 --




 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 know if anybody tried that, but for SWF files (or even FLAs?) , you
could maybe try to convert it to a text file of some sort for the purpose
of comparing - there are few tools that can do that (at least for swf files
you can use swfmill - not sure for FLA files). Although that technique is
not very visual for comparing changes in graphic elements. You can at
least know that this graphic named abc changed.

Also, for FLA files, we put virtually no code in the files (only a single
import statement for the Main class). All the code is stored in
external .AS text files - which are easy to compare and update.

Bottom line - whatever decision you take:  even the worse source-control
system will be a far better than nothing.

good luck!
B.

2006/4/21, [EMAIL PROTECTED] [EMAIL PROTECTED]:

 Now I will be upfront and state clearly that I don't neccessarily believe
 that StarTeam has done a lot on the to minimize binary file growth other
 then to apply compression to the file. What I mean by that is if you were to
 say take a text file in CVS and look at how it stores it. It does so by
 saving all the changes into a single text file and uses a markup and
 indexing system to track what the latest version should be and who made
 all the individual changes up to that point. Something that can be easily
 done in text files is not something that can be so easily done with a binary
 file. As Jester points out, all version control systems to date cannot tell
 you what changed between saves of an fla or for that matter a swf.


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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.

2006/4/21, Mike Guerrero [EMAIL PROTECTED]:

 So I am having a weird problem. I have a fullscreen flash displayed in on
 html page using flashobject from this example:
 http://blog.deconcept.com/flashobject/fullpage.html

 I wanted to have scrollbars appear in case it didn't fit the browser
 window.
 So I changed my css as follow.

 /*

 html {
height: 100%;
overflow: hidden;
}

 To

 html {
height: 100%;
overflow: scroll;
}


 **/


 In IE if you shrink the window, you can scroll the page and click any of
 the
 flash buttons. In Firefox the buttons do not work. When you try to
 rollover
 them, the cusor stays as an arrow and the buttons flicker. I believe this
 a
 bug with firefox. Oh well.



 MikeG

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 is an
empty string).

B.


2006/4/20, Geoff Stearns [EMAIL PROTECTED]:

 doesn't this method break flashvars and other params?



 On Apr 20, 2006, at 1:23 PM, Kevin Newman wrote:

  I didn't want to have to redefine all the stuff that has already
  been defined in the html object. So I made this: :-)
 
  http://www.unfocus.com/projects/PatentMagic/
 
  A super tiny js file include and a stylesheet takes care of all
  object activation. It's a bit brute force, but it should get the
  job done if you are looking for a quick fix and are using static
  embedded html. If anyone has any ideas on how to make this more
  robust, please let me know. :-)
 
 
  Kevin N.
 
 
  Geoff Stearns wrote:
  you could do this with flashobject really easily.
 
  just call fo.write() whenever you want and it will replace the
  object you target with your flash movie.
 
 
 
  On Apr 20, 2006, at 11:04 AM, Kevin Newman wrote:
 
  I prefer solutions that try to hide IE's lack of conformity, like
  Dean Edwards's IE 7 script:
  http://dean.edwards.name/IE7/
 
  There are just too many installations to realistically ignore them.
 
  Speaking of hacking on IE, is there a way to prevent an object
  from loading? By that I mean, I want to use Object tags to embed
  a Swf, but I don't want it to download or load in the background
  until I tell it to via a script interaction (vbscript or
  javascript). Will hiding it via css do the trick, or will I need
  to take further steps to keep it from loading?
 
  Thanks,
 
  Kevin N.
 
 
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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

2006-04-20 Thread Bernard Poulin
Another drawback: (that might be problematic in some cases). This technique
has the double run problem. I mean, the flash movie might start running,
before the javascript had a change to do its magic of replacing it.
Depending on what the flash movie is doing and timing, the result might do a
sudden blink.

I didn't do extensive testing, but I suspect it might impact the load time
of the page since loading a flash movie in IE always seems to hangs the
browser for a split second. (depending on the complexity of the flash movie)
- so the hanging time would be doubled presumably.

I want 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]:

  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 is an
 empty string).

 B.


 2006/4/20, Geoff Stearns [EMAIL PROTECTED]:

  doesn't this method break flashvars and other params?
 
 
 
  On Apr 20, 2006, at 1:23 PM, Kevin Newman wrote:
 
   I didn't want to have to redefine all the stuff that has already
   been defined in the html object. So I made this: :-)
  
   http://www.unfocus.com/projects/PatentMagic/
  
   A super tiny js file include and a stylesheet takes care of all
   object activation. It's a bit brute force, but it should get the
   job done if you are looking for a quick fix and are using static
   embedded html. If anyone has any ideas on how to make this more
   robust, please let me know. :-)
  
  
   Kevin N.
  
  
   Geoff Stearns wrote:
   you could do this with flashobject really easily.
  
   just call fo.write() whenever you want and it will replace the
   object you target with your flash movie.
  
  
  
   On Apr 20, 2006, at 11:04 AM, Kevin Newman wrote:
  
   I prefer solutions that try to hide IE's lack of conformity, like
   Dean Edwards's IE 7 script:
   http://dean.edwards.name/IE7/
  
   There are just too many installations to realistically ignore them.
  
   Speaking of hacking on IE, is there a way to prevent an object
   from loading? By that I mean, I want to use Object tags to embed
   a Swf, but I don't want it to download or load in the background
   until I tell it to via a script interaction (vbscript or
   javascript). Will hiding it via css do the trick, or will I need
   to take further steps to keep it from loading?
  
   Thanks,
  
   Kevin N.
  
  
  
   ___
   Flashcoders@chattyfig.figleaf.com
   To change your subscription options or search the archive:
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
   Brought to you by Fig Leaf Software
   Premier Authorized Adobe Consulting and Training
   http://www.figleaf.com
   http://training.figleaf.com
 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 under certain circumstances.
There is no known solution (FlashObject, UFO, plain external .js file or
script-disabling checkbox). He's suspecting a bug in MS patch. He said he
tested it with many different setup and machines.

I can't reproduce the problem myself, but others experienced it.

cheers,
B.


2006/4/20, Steve Killingbeck, MMCP, ACE [EMAIL PROTECTED]:

 Wow I am surprised you guys keep talking about this subject (Re: New
 wrinkle
 in IE activation issue)

 Just use flashobject: http://blog.deconcept.com/flashobject

 Its very robust, easy to use...

 Its not perfect but pretty darn close, and its code base has been tested
 by
 many people and platforms over the last year...

 It solves the eolas patent problem with IE
 Its friendly to search engines
 It supports express install

 Take 5 minutes and look into it...

 http://blog.deconcept.com/flashobject/

 http://blog.deconcept.com/2006/03/13/modern-approach-flash-seo/

 http://blog.deconcept.com/2005/12/15/internet-explorer-eolas-changes-and-the

 -flash-plugin/


 But hey if you guys want to reinvent the wheel that cool too

 --
 Flash4Hire
 http://www.flash4hire.com
 

 Steve Killingbeck, MMCP, ACE
 Technical Director
 Certified Flash Developer  Designer

 [EMAIL PROTECTED]
 612.709.6515
 --




 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 there are people on the web right now who are seeing this
problem. Can you give us some pointers as this is the only thread I can
find about this.

thanks!
Bernard

2006/4/18, ryanm [EMAIL PROTECTED]:

  You need to load your flash into your HTML from an external
  .js file.  See adobe/macormedia's site for more information.
 
No, we all know about that. This is happening *after* using the
 innerHtml method to write object tags. All of the workarounds fail in some
 cases, apparently diue to an MS bug.

 ryanm

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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

2006-04-19 Thread Bernard Poulin
I am sorry, I didn't try your version explicitely but another similar
technique. Probably I jumped on conclusions too fast.

To be precise, what I found is calling innerHTML on an parent object of an
object tag (on IE) does not renders all the attributes correctly. You
could see it by looking at the resulting string in a debugger.

But there are differences that could explain this. The parent object was not
a noscript tag like yours. Also maybe there was a question of timing: I
was calling my external javascript from the end of the page - it was
taking care of all flash objects on the page at once. (unlike your
technique).

I do not recall the exact IE version I was using (probably a very recent
one) and I do not have a quick test bed to try it out again now.

 Another drawback I saw is the double initialization of all my flash
movies. Each movie would load and run twice.

hope that helps,
B.

2006/4/18, Geoff Knutzen [EMAIL PROTECTED]:


 I am using flashvars with this technique and am having no troubles at all

 Is there some circumstance where the flashvars wouldn't work?
 I don't know what I am missing here. This has worked for me on every test
 that I have come up 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, Geoffrey Knutzen [EMAIL PROTECTED]:
 
 
  Here is what I am using:
 
  !--[if IE]noscript id=flash1![endif]--object
  classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
  codebase=
 

 http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#versio
 n=6,0,0,0
  
  width=435 height=270 id=flash_home align=middle
  param name=allowScriptAccess value=sameDomain /
  param name=movie value=flash.swf /
  param name=loop value=false /
  param name=quality value=best /
  param name=bgcolor value=# /
  embed src=flash.swf loop=false quality=best bgcolor=#ff
  width=435 height=270 name=flash_home align=middle
  allowScriptAccess=sameDomain type=application/x-shockwave-flash
  pluginspage=http://www.macromedia.com/go/getflashplayer; /
  /object!--[if IE]/noscriptscript language=JavaScript
  type=text/javascriptwriteExCtrl('flash1')/script![endif]--
 
  and then in an exteranl .js file:
  function writeExCtrl(id){
  if(document.getElementById  document.getElementById(id) 
  document.getElementById(id).innerHTML){
  document.write(document.getElementById(id).innerHTML.replace(/gt;/gi,
  '').replace(/lt;/gi, ''));
  }
  }
 
  Basically, everything is the same as it always was for every browser
 other
  than ie
  using the ie conditional comments,
 
 
 

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 using:

 !--[if IE]noscript id=flash1![endif]--object
 classid=clsid:d27cdb6e-ae6d-11cf-96b8-44455354
 codebase=
 http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0
 
 width=435 height=270 id=flash_home align=middle
 param name=allowScriptAccess value=sameDomain /
 param name=movie value=flash.swf /
 param name=loop value=false /
 param name=quality value=best /
 param name=bgcolor value=# /
 embed src=flash.swf loop=false quality=best bgcolor=#ff
 width=435 height=270 name=flash_home align=middle
 allowScriptAccess=sameDomain type=application/x-shockwave-flash
 pluginspage=http://www.macromedia.com/go/getflashplayer; /
 /object!--[if IE]/noscriptscript language=JavaScript
 type=text/javascriptwriteExCtrl('flash1')/script![endif]--

 and then in an exteranl .js file:
 function writeExCtrl(id){
 if(document.getElementById  document.getElementById(id) 
 document.getElementById(id).innerHTML){
 document.write(document.getElementById(id).innerHTML.replace(/gt;/gi,
 '').replace(/lt;/gi, ''));
 }
 }

 Basically, everything is the same as it always was for every browser other
 than ie
 using the ie conditional comments,

 http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp
 ,
 put in noscript tags around the call to the flash file. So if the user is
 using ie and has javascript turned off, they will still see the flash, but
 will have to click on it to enable it. This is as good as it can get for a
 non javascript ie user.
 If they do have javascript, the function reads the innerHTML of the
 noscript
 tag and writes it out to the page and all is good.

 It might be possible to get a bit more specific on the conditional
 comments,
 like perhaps only targeting ie6, but I am not sure if microsoft will be
 rolling out this fix to ie 5 or not, so I have bee playing it safe for
 now.




  Can anyone answer this:
 
  What happens if a user doesn't have javascript enabled in their browser
  for the recommended Macromedia solution (see link:
  http://www.macromedia.com/devnet/activecontent/articles/devletter.html)
 to
  this whole Active X debacle ?
 
  ???
 
  Please answer this if you can. It has me stressed.
 
  Thanks,
  Stephen.

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


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 info here:

http://neo.dzygn.com/archive/2004/09/flash-bug-in-ie

The only workaround I found as of today is to reset the window title after
every movie loads. (which is difficult to track - I personally execute a
javascript method from flash on the first frame).

regards,
Bernard

2006/4/5, elibol [EMAIL PROTECTED]:

 Can you share the code in your html file and the code segment that
 loads/preloads and initializes the movieclip? You've described the problem
 very clearly, however, I've never heard of such a problem; it doesn't seem
 common. There is no quick answer I could give you.

 M.


 On 4/5/06, Tarjinder Kumar [EMAIL PROTECTED] wrote:
 
  Hi
 
  i have my main.swf file embedded in html page.
  The swf file conatins 4-5 movieclip. On the click of a particular
  movieclip a new swf file is loaded in my main.swf file.
  I am using loadMovie to load swf.
  The problem is when i click on a particular movieclip to load swf file
  the html page title changes to # sign.
 
  Pls help
  Thanks in advance.
  Tarjinder
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training
  http://www.figleaf.com
  http://training.figleaf.com
 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training
 http://www.figleaf.com
 http://training.figleaf.com

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com