Re: [Flashcoders] Creating And Printing String With AS3
On Fri, Nov 20, 2009 at 2:40 PM, David Hunter wrote: > > i think there are a number of different ways to embed fonts in flash. but > the way i do it is by creating a "new font" from the library panel and then > setting the linkage so it is "export for actionscript" and then giving it a > class name. this definitely works for me and works with your code (without > the tweenLite stuff). only a couple other modifications to the code. you can > see the code at: http://pastebin.com/m401946d0 > Thanks for the code! Can you tell me how to create a font in my library and give it a class name? That one lost me. We're not making the font an object, such as an mc, are we? > all this stuff is on the adobe docs i think, written somewhere. > Oh, I'm sure it is. I'm reading it now. All 750+ pages of it. But not all in one day ;) TIA, beno ___ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Creating And Printing String With AS3
i think there are a number of different ways to embed fonts in flash. but the way i do it is by creating a "new font" from the library panel and then setting the linkage so it is "export for actionscript" and then giving it a class name. this definitely works for me and works with your code (without the tweenLite stuff). only a couple other modifications to the code. you can see the code at: http://pastebin.com/m401946d0 all this stuff is on the adobe docs i think, written somewhere. hope that sorts it. > Date: Fri, 20 Nov 2009 10:45:22 -0800 > Subject: Re: [Flashcoders] Creating And Printing String With AS3 > From: [email protected] > To: [email protected] > > it looks like you're not calling the init() method so the code is set > up correctly but none of it is ever called. > > when you have a problem like that, it's good to break it down into > little pieces; instead of debugging three methods, comment two out and > focus on just one. if that doesn't work, take out vars, math etc and > keep breaking it down until you find the problem, then add back on. > > working in this manner is a great way to develop, and doing so will > cut down your frustration considerably. > > > > > > > > > On Fri, Nov 20, 2009 at 10:24 AM, beno - wrote: > > On Fri, Nov 20, 2009 at 12:45 PM, Glen Pike > > wrote: > > > >> Hi, > >> > >> This might help: > >> > >> > >> http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0234.html > >> > > > > That doc states: > > > > Create a TextFormat object, set its fontFamily property to the name of the > > embedded font, and apply the TextFormat object to the TextField. When > > specifying an embedded font, the fontFamily property should only contain a > > single name; it cannot use a comma-delimited list of multiple font names. > > > > So I changed my code as follows: > > > >public function blurClient():void > > { > > trace('blurClient'); > > var client:TextField = new TextField(); > > this.addChild(client); > > var clientString:String = 'Joel Holt'; > > client.text = clientString; > > client.embedFonts = true; > > client.x = 100; > > client.y = 100; > > client.height = 20; > > client.width = 200; > > var clientFormat:TextFormat = new TextFormat(); > > clientFont:fontFamily = 'Arial'; > > clientFormat.color = 0xff; > > clientFormat.size = 20; > > clientFormat.font = 'Arial'; > > client.defaultTextFormat = clientFormat; > > TweenMax.to(client, 1, {blurFilter:{blurX:20}}).reverse(); > >} > > > > and got the complaint that there is no such thing as "fontFamily". What > > should I use instead? > > > >> > >> Simply: > >> > >> Put a TextField off the stage somewhere. Put some random text in it, set > >> it to "Dynamic Text", set the font face to Arial (size doesn't matter) > >> Choose "Embed" and select your character ranges - (Basic Latin is > >> useful). If you animate text, change the Aliasing to "...Animation". > >> > >> When you create a text field, set embedFonts to true: > > > > > >> e.g. > >> atty.embedFonts = true; > >> > > > > I did all of this. > > > > David Hunter asked about the bgcolor. It's black > > Jared Stanley suggested another list and it's archives. I will plumb them. > > Thank you all and I await further input. > > beno > > ___ > > Flashcoders mailing list > > [email protected] > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > ___ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Got more than one Hotmail account? Save time by linking them together http://clk.atdmt.com/UKM/go/186394591/direct/01/___ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
it looks like you're not calling the init() method so the code is set
up correctly but none of it is ever called.
when you have a problem like that, it's good to break it down into
little pieces; instead of debugging three methods, comment two out and
focus on just one. if that doesn't work, take out vars, math etc and
keep breaking it down until you find the problem, then add back on.
working in this manner is a great way to develop, and doing so will
cut down your frustration considerably.
On Fri, Nov 20, 2009 at 10:24 AM, beno - wrote:
> On Fri, Nov 20, 2009 at 12:45 PM, Glen Pike wrote:
>
>> Hi,
>>
>> This might help:
>>
>>
>> http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0234.html
>>
>
> That doc states:
>
> Create a TextFormat object, set its fontFamily property to the name of the
> embedded font, and apply the TextFormat object to the TextField. When
> specifying an embedded font, the fontFamily property should only contain a
> single name; it cannot use a comma-delimited list of multiple font names.
>
> So I changed my code as follows:
>
> public function blurClient():void
> {
> trace('blurClient');
> var client:TextField = new TextField();
> this.addChild(client);
> var clientString:String = 'Joel Holt';
> client.text = clientString;
> client.embedFonts = true;
> client.x = 100;
> client.y = 100;
> client.height = 20;
> client.width = 200;
> var clientFormat:TextFormat = new TextFormat();
> clientFont:fontFamily = 'Arial';
> clientFormat.color = 0xff;
> clientFormat.size = 20;
> clientFormat.font = 'Arial';
> client.defaultTextFormat = clientFormat;
> TweenMax.to(client, 1, {blurFilter:{blurX:20}}).reverse();
> }
>
> and got the complaint that there is no such thing as "fontFamily". What
> should I use instead?
>
>>
>> Simply:
>>
>> Put a TextField off the stage somewhere. Put some random text in it, set
>> it to "Dynamic Text", set the font face to Arial (size doesn't matter)
>> Choose "Embed" and select your character ranges - (Basic Latin is
>> useful). If you animate text, change the Aliasing to "...Animation".
>>
>> When you create a text field, set embedFonts to true:
>
>
>> e.g.
>> atty.embedFonts = true;
>>
>
> I did all of this.
>
> David Hunter asked about the bgcolor. It's black
> Jared Stanley suggested another list and it's archives. I will plumb them.
> Thank you all and I await further input.
> beno
> ___
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
On Fri, Nov 20, 2009 at 12:45 PM, Glen Pike wrote:
> Hi,
>
> This might help:
>
>
> http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0234.html
>
That doc states:
Create a TextFormat object, set its fontFamily property to the name of the
embedded font, and apply the TextFormat object to the TextField. When
specifying an embedded font, the fontFamily property should only contain a
single name; it cannot use a comma-delimited list of multiple font names.
So I changed my code as follows:
public function blurClient():void
{
trace('blurClient');
var client:TextField = new TextField();
this.addChild(client);
var clientString:String = 'Joel Holt';
client.text = clientString;
client.embedFonts = true;
client.x = 100;
client.y = 100;
client.height = 20;
client.width = 200;
var clientFormat:TextFormat = new TextFormat();
clientFont:fontFamily = 'Arial';
clientFormat.color = 0xff;
clientFormat.size = 20;
clientFormat.font = 'Arial';
client.defaultTextFormat = clientFormat;
TweenMax.to(client, 1, {blurFilter:{blurX:20}}).reverse();
}
and got the complaint that there is no such thing as "fontFamily". What
should I use instead?
>
> Simply:
>
> Put a TextField off the stage somewhere. Put some random text in it, set
> it to "Dynamic Text", set the font face to Arial (size doesn't matter)
> Choose "Embed" and select your character ranges - (Basic Latin is
> useful). If you animate text, change the Aliasing to "...Animation".
>
> When you create a text field, set embedFonts to true:
> e.g.
> atty.embedFonts = true;
>
I did all of this.
David Hunter asked about the bgcolor. It's black
Jared Stanley suggested another list and it's archives. I will plumb them.
Thank you all and I await further input.
beno
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
you might want to check this list out: http://chattyfig.figleaf.com/mailman/listinfo/flashnewbie there are tons of archives you can go through, most all of your questions are answered in there. On Fri, Nov 20, 2009 at 9:07 AM, David Hunter wrote: > > beno, > > > > is the background color of the swf white? your textformat is setting the text > color to 0xff, also white. > >> Date: Fri, 20 Nov 2009 12:29:11 -0400 >> Subject: Re: [Flashcoders] Creating And Printing String With AS3 >> From: [email protected] >> To: [email protected] >> >> On Fri, Nov 20, 2009 at 8:52 AM, David Hunter >> wrote: >> >> Glen Pike says I need to embed fonts, but David Hunter didn't mention that. >> Is it so? If so, is there a good tutorial on this? >> >> >> > quickly scanning the code, i can't see where you have assigned a string to >> > any of your textfields.eg. >> > var myString:String = "this is my string";var myTF:TextField = new >> > TextField();myTF.text = myString; >> > >> >> Here's the new code: >> >> package >> { >> import flash.text.* >> import flash.display.MovieClip; >> import com.greensock.*; >> import com.greensock.plugins.*; >> import com.greensock.easing.*; >> public class Holt extends MovieClip >> { >> public function Holt():void >> { >> } >> public function init():void { >> blurName(); >> easeOfc(); >> easeAtty(); >> } >> public function blurName():void >> { >> trace('blurName'); >> var name:TextField = new TextField(); >> this.addChild(name); >> var nameString:String = 'Joel Holt'; >> name.text = nameString; >> name.x = 100; >> name.y = 100; >> name.height = 20; >> name.width = 200; >> var nameFormat:TextFormat = new TextFormat(); >> nameFormat.color = 0xff; >> nameFormat.size = 20; >> nameFormat.font = 'Arial'; >> name.defaultTextFormat = nameFormat; >> TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse(); >> } >> public function easeOfc():void >> { >> trace('easeOfc'); >> var ofc:TextField = new TextField(); >> this.addChild(ofc); >> var ofcString:String = 'Joel Holt'; >> ofc.text = ofcString; >> ofc.x = 100; >> ofc.y = 150; >> ofc.height = 20; >> ofc.width = 200; >> var ofcFormat:TextFormat = new TextFormat(); >> ofcFormat.color = 0xff; >> ofcFormat.size = 20; >> ofcFormat.font = 'Arial'; >> ofc.defaultTextFormat = ofcFormat; >> TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn}); >> } >> public function easeAtty():void >> { >> trace('easeAtty'); >> var atty:TextField = new TextField(); >> this.addChild(atty); >> var attyString:String = 'Joel Holt'; >> atty.text = attyString; >> atty.x = 100; >> atty.y = 200; >> atty.height = 20; >> atty.width = 200; >> var attyFormat:TextFormat = new TextFormat(); >> attyFormat.color = 0xff; >> attyFormat.size = 20; >> attyFormat.font = 'Arial'; >> atty.defaultTextFormat = attyFormat; >> TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn}); >> } >> } >> } >> >> It doesn't print anything in the swf either :( >> TIA, >> beno >> ___ >> Flashcoders mailing list >> [email protected] >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > _ > Use Hotmail to send and receive mail from your different email accounts > http://clk.atdmt.com/UKM/go/186394592/direct/01/___ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Creating And Printing String With AS3
beno, is the background color of the swf white? your textformat is setting the text color to 0xff, also white. > Date: Fri, 20 Nov 2009 12:29:11 -0400 > Subject: Re: [Flashcoders] Creating And Printing String With AS3 > From: [email protected] > To: [email protected] > > On Fri, Nov 20, 2009 at 8:52 AM, David Hunter wrote: > > Glen Pike says I need to embed fonts, but David Hunter didn't mention that. > Is it so? If so, is there a good tutorial on this? > > > > quickly scanning the code, i can't see where you have assigned a string to > > any of your textfields.eg. > > var myString:String = "this is my string";var myTF:TextField = new > > TextField();myTF.text = myString; > > > > Here's the new code: > > package > { > import flash.text.* > import flash.display.MovieClip; > import com.greensock.*; > import com.greensock.plugins.*; > import com.greensock.easing.*; > public class Holt extends MovieClip > { > public function Holt():void > { > } > public function init():void { > blurName(); > easeOfc(); > easeAtty(); > } > public function blurName():void > { > trace('blurName'); > var name:TextField = new TextField(); > this.addChild(name); > var nameString:String = 'Joel Holt'; > name.text = nameString; > name.x = 100; > name.y = 100; > name.height = 20; > name.width = 200; > var nameFormat:TextFormat = new TextFormat(); > nameFormat.color = 0xff; > nameFormat.size = 20; > nameFormat.font = 'Arial'; > name.defaultTextFormat = nameFormat; > TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse(); > } > public function easeOfc():void > { > trace('easeOfc'); > var ofc:TextField = new TextField(); > this.addChild(ofc); > var ofcString:String = 'Joel Holt'; > ofc.text = ofcString; > ofc.x = 100; > ofc.y = 150; > ofc.height = 20; > ofc.width = 200; > var ofcFormat:TextFormat = new TextFormat(); > ofcFormat.color = 0xff; > ofcFormat.size = 20; > ofcFormat.font = 'Arial'; > ofc.defaultTextFormat = ofcFormat; > TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn}); > } > public function easeAtty():void > { > trace('easeAtty'); > var atty:TextField = new TextField(); > this.addChild(atty); > var attyString:String = 'Joel Holt'; > atty.text = attyString; > atty.x = 100; > atty.y = 200; > atty.height = 20; > atty.width = 200; > var attyFormat:TextFormat = new TextFormat(); > attyFormat.color = 0xff; > attyFormat.size = 20; > attyFormat.font = 'Arial'; > atty.defaultTextFormat = attyFormat; > TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn}); > } > } > } > > It doesn't print anything in the swf either :( > TIA, > beno > ___ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Use Hotmail to send and receive mail from your different email accounts http://clk.atdmt.com/UKM/go/186394592/direct/01/___ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
Hi,
This might help:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0234.html
Simply:
Put a TextField off the stage somewhere. Put some random text in
it, set it to "Dynamic Text", set the font face to Arial (size doesn't
matter)
Choose "Embed" and select your character ranges - (Basic Latin is
useful). If you animate text, change the Aliasing to "...Animation".
When you create a text field, set embedFonts to true:
e.g.
atty.embedFonts = true;
Also, I see you use "name" for the name of an instance of something
- try not to use "name" because this is a property of things like
"DisplayObject", MovieClip, etc. so you might get complaints...
HTH
Glen
beno - wrote:
On Fri, Nov 20, 2009 at 8:52 AM, David Hunter wrote:
Glen Pike says I need to embed fonts, but David Hunter didn't mention that.
Is it so? If so, is there a good tutorial on this?
quickly scanning the code, i can't see where you have assigned a string to
any of your textfields.eg.
var myString:String = "this is my string";var myTF:TextField = new
TextField();myTF.text = myString;
Here's the new code:
package
{
import flash.text.*
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
public class Holt extends MovieClip
{
public function Holt():void
{
}
public function init():void {
blurName();
easeOfc();
easeAtty();
}
public function blurName():void
{
trace('blurName');
var name:TextField = new TextField();
this.addChild(name);
var nameString:String = 'Joel Holt';
name.text = nameString;
name.x = 100;
name.y = 100;
name.height = 20;
name.width = 200;
var nameFormat:TextFormat = new TextFormat();
nameFormat.color = 0xff;
nameFormat.size = 20;
nameFormat.font = 'Arial';
name.defaultTextFormat = nameFormat;
TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse();
}
public function easeOfc():void
{
trace('easeOfc');
var ofc:TextField = new TextField();
this.addChild(ofc);
var ofcString:String = 'Joel Holt';
ofc.text = ofcString;
ofc.x = 100;
ofc.y = 150;
ofc.height = 20;
ofc.width = 200;
var ofcFormat:TextFormat = new TextFormat();
ofcFormat.color = 0xff;
ofcFormat.size = 20;
ofcFormat.font = 'Arial';
ofc.defaultTextFormat = ofcFormat;
TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn});
}
public function easeAtty():void
{
trace('easeAtty');
var atty:TextField = new TextField();
this.addChild(atty);
var attyString:String = 'Joel Holt';
atty.text = attyString;
atty.x = 100;
atty.y = 200;
atty.height = 20;
atty.width = 200;
var attyFormat:TextFormat = new TextFormat();
attyFormat.color = 0xff;
attyFormat.size = 20;
attyFormat.font = 'Arial';
atty.defaultTextFormat = attyFormat;
TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn});
}
}
}
It doesn't print anything in the swf either :(
TIA,
beno
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
On Fri, Nov 20, 2009 at 8:52 AM, David Hunter wrote:
Glen Pike says I need to embed fonts, but David Hunter didn't mention that.
Is it so? If so, is there a good tutorial on this?
> quickly scanning the code, i can't see where you have assigned a string to
> any of your textfields.eg.
> var myString:String = "this is my string";var myTF:TextField = new
> TextField();myTF.text = myString;
>
Here's the new code:
package
{
import flash.text.*
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
public class Holt extends MovieClip
{
public function Holt():void
{
}
public function init():void {
blurName();
easeOfc();
easeAtty();
}
public function blurName():void
{
trace('blurName');
var name:TextField = new TextField();
this.addChild(name);
var nameString:String = 'Joel Holt';
name.text = nameString;
name.x = 100;
name.y = 100;
name.height = 20;
name.width = 200;
var nameFormat:TextFormat = new TextFormat();
nameFormat.color = 0xff;
nameFormat.size = 20;
nameFormat.font = 'Arial';
name.defaultTextFormat = nameFormat;
TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse();
}
public function easeOfc():void
{
trace('easeOfc');
var ofc:TextField = new TextField();
this.addChild(ofc);
var ofcString:String = 'Joel Holt';
ofc.text = ofcString;
ofc.x = 100;
ofc.y = 150;
ofc.height = 20;
ofc.width = 200;
var ofcFormat:TextFormat = new TextFormat();
ofcFormat.color = 0xff;
ofcFormat.size = 20;
ofcFormat.font = 'Arial';
ofc.defaultTextFormat = ofcFormat;
TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn});
}
public function easeAtty():void
{
trace('easeAtty');
var atty:TextField = new TextField();
this.addChild(atty);
var attyString:String = 'Joel Holt';
atty.text = attyString;
atty.x = 100;
atty.y = 200;
atty.height = 20;
atty.width = 200;
var attyFormat:TextFormat = new TextFormat();
attyFormat.color = 0xff;
attyFormat.size = 20;
attyFormat.font = 'Arial';
atty.defaultTextFormat = attyFormat;
TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn});
}
}
}
It doesn't print anything in the swf either :(
TIA,
beno
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Creating And Printing String With AS3
quickly scanning the code, i can't see where you have assigned a string to any of your textfields.eg. var myString:String = "this is my string";var myTF:TextField = new TextField();myTF.text = myString; hope i've helped. > Date: Fri, 20 Nov 2009 07:32:15 -0500 > From: [email protected] > To: [email protected] > Subject: [Flashcoders] Creating And Printing String With AS3 > > Hi; > I am confused as to how to create a string, define its properties and print > it in Flash. The following code doesn't throw any errors, and it nicely > prints out my traces, but it doesn't print out the lines I want. Please > advise. > TIA, > beno > > package > { > import flash.text.* > import flash.display.MovieClip; > import com.greensock.*; > import com.greensock.plugins.*; > import com.greensock.easing.*; > public class Holt extends MovieClip > { > public function Holt():void > { > } > public function init():void { > blurName(); > easeOfc(); > easeAtty(); > } > public function blurName():void > { > trace('blurName'); > var name:TextField = new TextField(); > // var name:String = 'Joel Holt'; > this.addChild(name); > name.x = 100; > name.y = 100; > name.height = 20; > name.width = 200; > var nameFormat:TextFormat = new TextFormat(); > nameFormat.color = 0xff; > nameFormat.size = 20; > nameFormat.font = 'Arial'; > // name.defaultTextFormat = nameFormat; > TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse(); > } > public function easeOfc():void > { > trace('easeOfc'); > var ofc:TextField = new TextField(); > // var ofc:String = 'The Offices Of...'; > this.addChild(ofc); > ofc.x = 100; > ofc.y = 150; > ofc.height = 20; > ofc.width = 200; > var ofcFormat:TextFormat = new TextFormat(); > ofcFormat.color = 0xff; > ofcFormat.size = 20; > ofcFormat.font = 'Arial'; > // ofc.defaultTextFormat = nameFormat; > TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn}); > } > public function easeAtty():void > { > trace('easeAtty'); > var atty:TextField = new TextField(); > // var atty:String = 'Attorney At Law'; > this.addChild(atty); > atty.x = 100; > atty.y = 200; > atty.height = 20; > atty.width = 200; > var attyFormat:TextFormat = new TextFormat(); > attyFormat.color = 0xff; > attyFormat.size = 20; > attyFormat.font = 'Arial'; > // atty.defaultTextFormat = nameFormat; > TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn}); > } > } > } > ___ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Have more than one Hotmail account? Link them together to easily access both http://clk.atdmt.com/UKM/go/186394591/direct/01/___ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Creating And Printing String With AS3
You probably need to embed the fonts in your Flash file - put a text
field on stage with Arial characters embedded and set the "embedFonts"
property on your text field to "true". You need to use embedded fonts
for Tweening...
Glen
beno - wrote:
Hi;
I am confused as to how to create a string, define its properties and print
it in Flash. The following code doesn't throw any errors, and it nicely
prints out my traces, but it doesn't print out the lines I want. Please
advise.
TIA,
beno
package
{
import flash.text.*
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
public class Holt extends MovieClip
{
public function Holt():void
{
}
public function init():void {
blurName();
easeOfc();
easeAtty();
}
public function blurName():void
{
trace('blurName');
var name:TextField = new TextField();
// var name:String = 'Joel Holt';
this.addChild(name);
name.x = 100;
name.y = 100;
name.height = 20;
name.width = 200;
var nameFormat:TextFormat = new TextFormat();
nameFormat.color = 0xff;
nameFormat.size = 20;
nameFormat.font = 'Arial';
// name.defaultTextFormat = nameFormat;
TweenMax.to(name, 1, {blurFilter:{blurX:20}}).reverse();
}
public function easeOfc():void
{
trace('easeOfc');
var ofc:TextField = new TextField();
// var ofc:String = 'The Offices Of...';
this.addChild(ofc);
ofc.x = 100;
ofc.y = 150;
ofc.height = 20;
ofc.width = 200;
var ofcFormat:TextFormat = new TextFormat();
ofcFormat.color = 0xff;
ofcFormat.size = 20;
ofcFormat.font = 'Arial';
// ofc.defaultTextFormat = nameFormat;
TweenLite.to(ofc, 1, {x:58, y:229, ease:Circ.easeIn});
}
public function easeAtty():void
{
trace('easeAtty');
var atty:TextField = new TextField();
// var atty:String = 'Attorney At Law';
this.addChild(atty);
atty.x = 100;
atty.y = 200;
atty.height = 20;
atty.width = 200;
var attyFormat:TextFormat = new TextFormat();
attyFormat.color = 0xff;
attyFormat.size = 20;
attyFormat.font = 'Arial';
// atty.defaultTextFormat = nameFormat;
TweenLite.to(atty, 1, {x:58, y:229, ease:Circ.easeIn});
}
}
}
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

