Re: [Flashcoders] How to know coordinates of letters in non fixed-width fonts

2009-02-24 Thread ali drongo
Thanks for all of your responses guys,I ended up using getCharBoundaries and
it works a treat.
FYI I created a text field at the position I wanted the letters to finally
go then stored the rectangle object for each char in an array and then
cycled through the array as Glen suggested.

Only thing is, when I use a multiline textfield my function will only gather
the char boundaries for the first line:
If anyone can suggest why it would be a help.
Cheers!
Ali




public static function letterPosAr(t:TextField):Array
{
trace(letterPosAr);
var retA:Array = new Array();
for (var i:int = 0; i  t.text.length; i++){
var rect:Rectangle = t.getCharBoundaries(i);
trace(---index+i+  char:+t.text.substr(i, 1)+  x:+rect.x+
y:+rect.y+ w:+rect.width);
retA[i] = rect;
}
return retA;
 }

On Tue, Feb 24, 2009 at 7:02 AM, Matt Gitchell m...@moonbootmedia.comwrote:

 the AS2 one is a cool idea!

 On Mon, Feb 23, 2009 at 10:16 PM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:

  and for as2:
  http://objectpainters.com/blog/2008/10/12/finding-character-positions/
 
  On Tue, Feb 24, 2009 at 1:24 AM, Matt Gitchell m...@moonbootmedia.com
  wrote:
 
   Is this AS3? you can use TextField.getCharBoundaries()
  
   I used it in an experiment a while back here to pretty good effect:
   http://www.moonbootmedia.com/interactive/m/textcompare.html
  
   --Matt
  
  
  
   On Mon, Feb 23, 2009 at 3:01 PM, Glen Pike postmas...@glenpike.co.uk
   wrote:
  
Hi,
   
  You should be able to get the width of each sprite with the single
   letter
in???
   
  Maybe mask the stream area out.  Start each letter at x -
  letterWidth,
increase the x after each interval, when the letter reaches x=0,
 create
  
show the next one, add it to your array.
Loop through the array each timer increasing the x position of
 the
letters, removing them when they reach the other side???
Something like that??/
Glen
   
ali drongo wrote:
   
Hi there, I'm animating some letters that are dynamically created in
   their
own sprites across the screen as if they are being fired in a
 stream.
Currently I am using a fixed width font so it's straight forward to
  find
their final position. My problem is that I need to use a non
  fixed-width
font and I don't know how to calculate the position of each letter.
   
Any ideas very gratefully received!
   
Thanks :)
Ali
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   
   
   
   
   
--
   
Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk
   
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to know coordinates of letters in non fixed-width fonts

2009-02-24 Thread Glen Pike

Hi,

   Can you get text metrics for characters / lines in the text field???

   Glen

ali drongo wrote:

Thanks for all of your responses guys,I ended up using getCharBoundaries and
it works a treat.
FYI I created a text field at the position I wanted the letters to finally
go then stored the rectangle object for each char in an array and then
cycled through the array as Glen suggested.

Only thing is, when I use a multiline textfield my function will only gather
the char boundaries for the first line:
If anyone can suggest why it would be a help.
Cheers!
Ali




public static function letterPosAr(t:TextField):Array
{
trace(letterPosAr);
var retA:Array = new Array();
for (var i:int = 0; i  t.text.length; i++){
var rect:Rectangle = t.getCharBoundaries(i);
trace(---index+i+  char:+t.text.substr(i, 1)+  x:+rect.x+
y:+rect.y+ w:+rect.width);
retA[i] = rect;
}
return retA;
 }

On Tue, Feb 24, 2009 at 7:02 AM, Matt Gitchell m...@moonbootmedia.comwrote:

  

the AS2 one is a cool idea!

On Mon, Feb 23, 2009 at 10:16 PM, Hans Wichman 
j.c.wich...@objectpainters.com wrote:



and for as2:
http://objectpainters.com/blog/2008/10/12/finding-character-positions/

On Tue, Feb 24, 2009 at 1:24 AM, Matt Gitchell m...@moonbootmedia.com
  

wrote:

Is this AS3? you can use TextField.getCharBoundaries()


I used it in an experiment a while back here to pretty good effect:
http://www.moonbootmedia.com/interactive/m/textcompare.html

--Matt



On Mon, Feb 23, 2009 at 3:01 PM, Glen Pike postmas...@glenpike.co.uk


wrote:
  
Hi,


  You should be able to get the width of each sprite with the single
  

letter


in???

  Maybe mask the stream area out.  Start each letter at x -
  

letterWidth,
  

increase the x after each interval, when the letter reaches x=0,
  

create



  

show the next one, add it to your array.
Loop through the array each timer increasing the x position of
  

the


letters, removing them when they reach the other side???
Something like that??/
Glen

ali drongo wrote:

  

Hi there, I'm animating some letters that are dynamically created in


their


own sprites across the screen as if they are being fired in a


stream.


Currently I am using a fixed width font so it's straight forward to


find
  

their final position. My problem is that I need to use a non


fixed-width
  

font and I don't know how to calculate the position of each letter.

Any ideas very gratefully received!

Thanks :)
Ali
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Remote Fonts and Sandbox?

2009-02-24 Thread Mike Grunwald

Hello All,

I've run into a confusing issue:

I've created several font SWFs that contain only the characters that  
I need for a particular language and I was loading them in using a  
FontLoader class that I pass a language parameter to. After the  
FontLoader class loads the proper font (Event.COMPLETE), It calls a  
method that had Font.registerFont in it, to add it to the list of  
available fonts.


This was working perfectly until the client threw a wrench into the  
gears. I now have to have the font files on a different server  
because the CMS that they're using only allows them to upload a  
single SWF into the page (no assets are allowed).  I added the proper  
Security.allowDomain stuff and I know the fonts are loading because  
they trace out, but now when I try to register the font, I get this  
error:


ArgumentError: Error #1508: The value specified for argument font is  
invalid.

at flash.text::Font$/registerFont()
at com.johnsoncontrols.bsrbanner.utils::FontLoader/registerFont()


Here's my registerFont method that used to work:

private function registerFont(e:Event):void
{
			 var FontLibrary:Class = e.target.applicationDomain.getDefinition 
(ArialUnicode_ + _language);


 Font.registerFont(FontLibrary[ArialUnicode_ + 
_language]);

 _loadedFont = FontLibrary[ArialUnicode_ + _language];

trace(FONTS:  + Font.enumerateFonts());
}


...And here's the document class of the font SWF I'm loading in:

package
{
import flash.display.Sprite;
import flash.system.Security;
import flash.text.Font;


public class ArialUnicode_ENG extends Sprite
{

		[Embed(source='/Users/mike/MCDILL FONTS/A/Arial Unicode/Arial  
Unicode.ttf', fontName='ArialUnicode_ENG', unicodeRange='U+0041-U 
+0041,U+0042-U+0042,...')]



public static var ArialUnicode_ENG:Class;


public function ArialUnicode_ENG()
{
Security.allowDomain(*);
}   
}
}


Anybody know what the problem might be?

Thanks for any help in advance,
_mike


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] is this the getURL bug?

2009-02-24 Thread Mattheis, Erik (MIN - WSW)
Suddenly a few weeks ago, getURL actions in several dozen swfs began to
fail consistently when served from a particular server. The SWFs will
work when viewed outside of HTML as well locally or on any other server.
The content-length of the SWF is correct on the problematic server.

Adding a _blank target to the getURL fixes it, but

  nextFrame();
  getURL('mailto:em...@domain.org');

does not.

Two questions:

Is this the odd getURL/FSCommand bug or something else?

How can I work around this for getURL with mailto: without leaving a new
browser window open in IE?

Thanks.

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Glen Pike

Think I fixed it by using a URLRequest rather than getURL - AS3 though...

I do remember this being a problem in IE before that.  (Apologies if you 
are still on AS2).


The other way maybe to try _self instead of _blank???

Mattheis, Erik (MIN - WSW) wrote:

Suddenly a few weeks ago, getURL actions in several dozen swfs began to
fail consistently when served from a particular server. The SWFs will
work when viewed outside of HTML as well locally or on any other server.
The content-length of the SWF is correct on the problematic server.

Adding a _blank target to the getURL fixes it, but

  nextFrame();
  getURL('mailto:em...@domain.org');

does not.

Two questions:

Is this the odd getURL/FSCommand bug or something else?

How can I work around this for getURL with mailto: without leaving a new
browser window open in IE?

Thanks.

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Mattheis, Erik (MIN - WSW)
Yes, these are many AS 2 SWFs that suddenly stopped working when served
from a particular. getURL fails without a _blank target consistently
with FP 8-10. Adding the _blank is a fine fix for all links other than
mailto: which leaves a new browser window open in IE.

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 11:29 AM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Think I fixed it by using a URLRequest rather than getURL - AS3
though...

I do remember this being a problem in IE before that.  (Apologies if you

are still on AS2).

The other way maybe to try _self instead of _blank???

Mattheis, Erik (MIN - WSW) wrote:
 Suddenly a few weeks ago, getURL actions in several dozen swfs began
to
 fail consistently when served from a particular server. The SWFs will
 work when viewed outside of HTML as well locally or on any other
server.
 The content-length of the SWF is correct on the problematic server.

 Adding a _blank target to the getURL fixes it, but

   nextFrame();
   getURL('mailto:em...@domain.org');

 does not.

 Two questions:

 Is this the odd getURL/FSCommand bug or something else?

 How can I work around this for getURL with mailto: without leaving a
new
 browser window open in IE?


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Mattheis, Erik (MIN - WSW)
Yes, that sounds similar although these movies had been working as
expected for years and they still work everywhere except when served by
one particular server. Unfortunately, the server they're stored on.

It also is similar to this:
http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in
-Flash-Player-9 

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 2:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Don't know if this helps, but it sounds like it might be similar to your

problem??

http://www.sitepoint.com/forums/showthread.php?t=157581


Mattheis, Erik (MIN - WSW) wrote:
 Yes, these are many AS 2 SWFs that suddenly stopped working when
served
 from a particular. getURL fails without a _blank target consistently
 with FP 8-10. Adding the _blank is a fine fix for all links other than
 mailto: which leaves a new browser window open in IE.

 --
 Erik Mattheis
 Senior Interactive Developer
 Weber Shandwick Digital Minneapolis

 ph: 952 346 6610 cell: 612 377 2272


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
 Pike
 Sent: Tuesday, February 24, 2009 11:29 AM
 To: Flash Coders List
 Subject: Re: [Flashcoders] is this the getURL bug?

 Think I fixed it by using a URLRequest rather than getURL - AS3
 though...

 I do remember this being a problem in IE before that.  (Apologies if
you

 are still on AS2).

 The other way maybe to try _self instead of _blank???

 Mattheis, Erik (MIN - WSW) wrote:
   
 Suddenly a few weeks ago, getURL actions in several dozen swfs began
 
 to
   
 fail consistently when served from a particular server. The SWFs will
 work when viewed outside of HTML as well locally or on any other
 
 server.
   
 The content-length of the SWF is correct on the problematic server.

 Adding a _blank target to the getURL fixes it, but

   nextFrame();
   getURL('mailto:em...@domain.org');

 does not.

 Two questions:

 Is this the odd getURL/FSCommand bug or something else?

 How can I work around this for getURL with mailto: without leaving a
 
 new
   
 browser window open in IE?
 


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


   

-- 

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Glen Pike

Hi,

   Do you have a URL that you can send??

   Is it IE7 / IE6 / both / +others??
  
   Glen


Mattheis, Erik (MIN - WSW) wrote:

Yes, that sounds similar although these movies had been working as
expected for years and they still work everywhere except when served by
one particular server. Unfortunately, the server they're stored on.

It also is similar to this:
http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in
-Flash-Player-9 


--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 2:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Don't know if this helps, but it sounds like it might be similar to your

problem??

http://www.sitepoint.com/forums/showthread.php?t=157581


Mattheis, Erik (MIN - WSW) wrote:
  

Yes, these are many AS 2 SWFs that suddenly stopped working when


served
  

from a particular. getURL fails without a _blank target consistently
with FP 8-10. Adding the _blank is a fine fix for all links other than
mailto: which leaves a new browser window open in IE.

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 11:29 AM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Think I fixed it by using a URLRequest rather than getURL - AS3
though...

I do remember this being a problem in IE before that.  (Apologies if


you
  

are still on AS2).

The other way maybe to try _self instead of _blank???

Mattheis, Erik (MIN - WSW) wrote:
  


Suddenly a few weeks ago, getURL actions in several dozen swfs began

  

to
  


fail consistently when served from a particular server. The SWFs will
work when viewed outside of HTML as well locally or on any other

  

server.
  


The content-length of the SWF is correct on the problematic server.

Adding a _blank target to the getURL fixes it, but

  nextFrame();
  getURL('mailto:em...@domain.org');

does not.

Two questions:

Is this the odd getURL/FSCommand bug or something else?

How can I work around this for getURL with mailto: without leaving a

  

new
  


browser window open in IE?

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  



  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Glen Pike

Or this maybe...

http://groups.google.com/group/macromedia.flash/browse_thread/thread/4a8f27962bab6a0e


Mattheis, Erik (MIN - WSW) wrote:

Yes, that sounds similar although these movies had been working as
expected for years and they still work everywhere except when served by
one particular server. Unfortunately, the server they're stored on.

It also is similar to this:
http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in
-Flash-Player-9 


--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 2:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Don't know if this helps, but it sounds like it might be similar to your

problem??

http://www.sitepoint.com/forums/showthread.php?t=157581


Mattheis, Erik (MIN - WSW) wrote:
  

Yes, these are many AS 2 SWFs that suddenly stopped working when


served
  

from a particular. getURL fails without a _blank target consistently
with FP 8-10. Adding the _blank is a fine fix for all links other than
mailto: which leaves a new browser window open in IE.

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 11:29 AM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Think I fixed it by using a URLRequest rather than getURL - AS3
though...

I do remember this being a problem in IE before that.  (Apologies if


you
  

are still on AS2).

The other way maybe to try _self instead of _blank???

Mattheis, Erik (MIN - WSW) wrote:
  


Suddenly a few weeks ago, getURL actions in several dozen swfs began

  

to
  


fail consistently when served from a particular server. The SWFs will
work when viewed outside of HTML as well locally or on any other

  

server.
  


The content-length of the SWF is correct on the problematic server.

Adding a _blank target to the getURL fixes it, but

  nextFrame();
  getURL('mailto:em...@domain.org');

does not.

Two questions:

Is this the odd getURL/FSCommand bug or something else?

How can I work around this for getURL with mailto: without leaving a

  

new
  


browser window open in IE?

  

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


  



  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Mattheis, Erik (MIN - WSW)
An example:

Illustration of getURL not working without a _blank parameter when
served from a problematic server, but fine on another:

http://weber10.ws-wr.com/em/swftest/test_badServer.html
http://weber10.ws-wr.com/em/swftest/test_thisServer.html

Also illustrated IE (6 and 7) leaving a window open when there's a
_blank parameter in a getURL call to a mailto: address - I'm assuming
this isn't a bug, but just the expected behavior. Wondering if there's
anything else I can do that wouldn't require JS.

Thanks.


--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 3:46 PM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Hi,

Do you have a URL that you can send??

Is it IE7 / IE6 / both / +others??
   
Glen


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Remote Fonts and Sandbox?

2009-02-24 Thread Ashim D'Silva
Might be a sandbox issue that needs a crossdomain file. Try adding one and
see what happens. The crossdomain file sits in the root of the server that
is serving the assets.
Eg: http://twitter.com/crossdomain.xml

2009/2/25 Mike Grunwald mgrunw...@mcdilldesign.com

 Hello All,

 I've run into a confusing issue:

 I've created several font SWFs that contain only the characters that I need
 for a particular language and I was loading them in using a FontLoader class
 that I pass a language parameter to. After the FontLoader class loads the
 proper font (Event.COMPLETE), It calls a method that had Font.registerFont
 in it, to add it to the list of available fonts.

 This was working perfectly until the client threw a wrench into the gears.
 I now have to have the font files on a different server because the CMS that
 they're using only allows them to upload a single SWF into the page (no
 assets are allowed).  I added the proper Security.allowDomain stuff and I
 know the fonts are loading because they trace out, but now when I try to
 register the font, I get this error:

 ArgumentError: Error #1508: The value specified for argument font is
 invalid.
at flash.text::Font$/registerFont()
at com.johnsoncontrols.bsrbanner.utils::FontLoader/registerFont()


 Here's my registerFont method that used to work:

private function registerFont(e:Event):void
{
 var FontLibrary:Class =
 e.target.applicationDomain.getDefinition(ArialUnicode_ + _language);

 Font.registerFont(FontLibrary[ArialUnicode_ +
 _language]);

 _loadedFont = FontLibrary[ArialUnicode_ +
 _language];

trace(FONTS:  + Font.enumerateFonts());
}


 ...And here's the document class of the font SWF I'm loading in:

package
{
import flash.display.Sprite;
import flash.system.Security;
import flash.text.Font;


public class ArialUnicode_ENG extends Sprite
{

[Embed(source='/Users/mike/MCDILL FONTS/A/Arial
 Unicode/Arial Unicode.ttf', fontName='ArialUnicode_ENG',
 unicodeRange='U+0041-U+0041,U+0042-U+0042,...')]


public static var ArialUnicode_ENG:Class;


public function ArialUnicode_ENG()
{
Security.allowDomain(*);
}
}
 }


 Anybody know what the problem might be?

 Thanks for any help in advance,
 _mike


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
The Random Lines
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] is this the getURL bug?

2009-02-24 Thread Mattheis, Erik (MIN - WSW)
That explains it precisely and allowScriptAccess=always fixes it.

http://weber10.ws-wr.com/em/swftest/test_fix.html

Thanks!

--
Erik Mattheis
Senior Interactive Developer
Weber Shandwick Digital Minneapolis

ph: 952 346 6610 cell: 612 377 2272


-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
Pike
Sent: Tuesday, February 24, 2009 4:27 PM
To: Flash Coders List
Subject: Re: [Flashcoders] is this the getURL bug?

Or this maybe...

http://groups.google.com/group/macromedia.flash/browse_thread/thread/4a8
f27962bab6a0e


Mattheis, Erik (MIN - WSW) wrote:
 Yes, that sounds similar although these movies had been working as
 expected for years and they still work everywhere except when served
by
 one particular server. Unfortunately, the server they're stored on.

 It also is similar to this:

http://www.northcode.com/blog.php/2007/09/11/FSCommand-and-getURL-Bug-in
 -Flash-Player-9 

 --
 Erik Mattheis
 Senior Interactive Developer
 Weber Shandwick Digital Minneapolis

 ph: 952 346 6610 cell: 612 377 2272


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
 Pike
 Sent: Tuesday, February 24, 2009 2:57 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] is this the getURL bug?

 Don't know if this helps, but it sounds like it might be similar to
your

 problem??

 http://www.sitepoint.com/forums/showthread.php?t=157581


 Mattheis, Erik (MIN - WSW) wrote:
   
 Yes, these are many AS 2 SWFs that suddenly stopped working when
 
 served
   
 from a particular. getURL fails without a _blank target consistently
 with FP 8-10. Adding the _blank is a fine fix for all links other
than
 mailto: which leaves a new browser window open in IE.

 --
 Erik Mattheis
 Senior Interactive Developer
 Weber Shandwick Digital Minneapolis

 ph: 952 346 6610 cell: 612 377 2272


 -Original Message-
 From: flashcoders-boun...@chattyfig.figleaf.com
 [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen
 Pike
 Sent: Tuesday, February 24, 2009 11:29 AM
 To: Flash Coders List
 Subject: Re: [Flashcoders] is this the getURL bug?

 Think I fixed it by using a URLRequest rather than getURL - AS3
 though...

 I do remember this being a problem in IE before that.  (Apologies if
 
 you
   
 are still on AS2).

 The other way maybe to try _self instead of _blank???

 Mattheis, Erik (MIN - WSW) wrote:
   
 
 Suddenly a few weeks ago, getURL actions in several dozen swfs began
 
   
 to
   
 
 fail consistently when served from a particular server. The SWFs
will
 work when viewed outside of HTML as well locally or on any other
 
   
 server.
   
 
 The content-length of the SWF is correct on the problematic server.

 Adding a _blank target to the getURL fixes it, but

   nextFrame();
   getURL('mailto:em...@domain.org');

 does not.

 Two questions:

 Is this the odd getURL/FSCommand bug or something else?

 How can I work around this for getURL with mailto: without leaving a
 
   
 new
   
 
 browser window open in IE?
 
   
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


   
 

   

-- 

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to know coordinates of letters in non fixed-width fonts

2009-02-24 Thread Matt Gitchell
TextField has a getLineMetrics() function, which returns a TextLineMetrics
object.
Check out the AS3 Reference stuff for TextField and the TextLineMetrics
class for the breakdown, there's all kinds of good, fun stuff in there.

--Matt

On Tue, Feb 24, 2009 at 6:36 AM, Glen Pike g...@engineeredarts.co.ukwrote:

 Hi,

   Can you get text metrics for characters / lines in the text field???

   Glen


 ali drongo wrote:

 Thanks for all of your responses guys,I ended up using getCharBoundaries
 and
 it works a treat.
 FYI I created a text field at the position I wanted the letters to finally
 go then stored the rectangle object for each char in an array and then
 cycled through the array as Glen suggested.

 Only thing is, when I use a multiline textfield my function will only
 gather
 the char boundaries for the first line:
 If anyone can suggest why it would be a help.
 Cheers!
 Ali




 public static function letterPosAr(t:TextField):Array
 {
 trace(letterPosAr);
 var retA:Array = new Array();
 for (var i:int = 0; i  t.text.length; i++){
 var rect:Rectangle = t.getCharBoundaries(i);
 trace(---index+i+  char:+t.text.substr(i, 1)+  x:+rect.x+
 y:+rect.y+ w:+rect.width);
 retA[i] = rect;
 }
 return retA;
  }

 On Tue, Feb 24, 2009 at 7:02 AM, Matt Gitchell m...@moonbootmedia.com
 wrote:



 the AS2 one is a cool idea!

 On Mon, Feb 23, 2009 at 10:16 PM, Hans Wichman 
 j.c.wich...@objectpainters.com wrote:



 and for as2:
 http://objectpainters.com/blog/2008/10/12/finding-character-positions/

 On Tue, Feb 24, 2009 at 1:24 AM, Matt Gitchell m...@moonbootmedia.com


 wrote:
Is this AS3? you can use TextField.getCharBoundaries()

 I used it in an experiment a while back here to pretty good effect:
 http://www.moonbootmedia.com/interactive/m/textcompare.html

 --Matt



 On Mon, Feb 23, 2009 at 3:01 PM, Glen Pike postmas...@glenpike.co.uk


 wrote:
  Hi,

  You should be able to get the width of each sprite with the single


 letter


 in???

  Maybe mask the stream area out.  Start each letter at x -


 letterWidth,


 increase the x after each interval, when the letter reaches x=0,


 create


 


 show the next one, add it to your array.
Loop through the array each timer increasing the x position of


 the


 letters, removing them when they reach the other side???
Something like that??/
Glen

 ali drongo wrote:



 Hi there, I'm animating some letters that are dynamically created in


 their


 own sprites across the screen as if they are being fired in a


 stream.


 Currently I am using a fixed width font so it's straight forward to


 find


 their final position. My problem is that I need to use a non


 fixed-width


 font and I don't know how to calculate the position of each letter.

 Any ideas very gratefully received!

 Thanks :)
 Ali
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






 --

 Glen Pike
 01326 218440
 www.glenpike.co.uk http://www.glenpike.co.uk

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders





 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders