Flash Professional Arabic TextAria support - actionscript-3

how can I add TextAria with Arabic support
i.e.
dir="rtl"
align="right"
Please I need Flash Professional source code, I don't use Flash Builder of Flex systems.
Thank you.

To do what you are looking for, you have to start by embedding your font, for that take a look here, then you can do like this :
// your embedded font
var font:Font = new MyFont();
var text_format:TextFormat = new TextFormat();
text_format.font = font.fontName;
text_format.align = 'right';
var text_area:TextArea = new TextArea();
text_area.setStyle('textFormat', text_format);
text_area.width = 300;
text_area.height = 200;
addChild(text_area);
Hope that can help.

Related

add equalizer for online flash radio

i have tried add equalizer my online radio. i was used http://www.everyday3d.com/blog/index.php/2008/03/26/classic-sound-equalizer-in-flashas3/
flash source file . it's working fine when i am worked in flash ide. but on my server the equalizer doesnot show. but if the playing file is mp3 format it will worked but if we play the stream url it's not working. i dont know how can i fix this. i am using as3, i am new to flash. please help any one. thanks advance
the equalizer code
var es:EqualizerSettings = new EqualizerSettings();
es.numOfBars = 80;
es.height = 30;
es.barSize = 3;
es.vgrid = true;
es.hgrid = 2;
es.colorManager = new GradientBarColor(0xffff4444);
es.effect = EqualizerSettings.FX_REFLECTION;
var e:Equalizer = new Equalizer();
e.update(es);
e.x = 100;
e.y = 60;
addChild(e);
addEventListener(Event.ENTER_FRAME, e.render);
What Gio said, SoundMixer.computeSpectrum-based approach, such as the one linked in your question, suffers from security problems. But there are alternatives, for example check this code: http://wonderfl.net/c/euIb/read (some of stream URLs in it are dead, and it might not work right away - so try it with your own stream URL)

How to use a font embedded in a SWC

I exported a SWC from Flash CS3 with a font embedded.
Now I want use it in some TextFields, but I don't know how to use the font.
Done! Here's my solution:
[Embed(source="res/guardanapo.otf", fontName="guardanapo", fontFamily="guardanapo", unicodeRange="U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E", advancedAntiAliasing="false", embedAsCFF="false")]
public static const fonte:Class;
I wanted to embed the font from SWC, but now it isn't necessary anymore. But answer if you know how to do that, maybe someone is serching for it now.
Give this a try. myLoader is the loader that you loaded your swf/swc with the font in its library. myTextField is a pre-existing text field. I set embedFonts to true, but you may not need it.
var MyFont:Class = myLoader.contentLoaderInfo.applicationDomain.getDefinition("FontClassName");
var embeddedFont:Font = new MyFont();
var textFormat:TextFormat = new TextFormat();
textFormat.font = embeddedFont.fontName;
textFormat.size = 24;
myTextField.setTextFormat(textFormat);
myTextField.embedFonts = true;
Maybe you can include a font-fetching class in the swf with the font(s) you want to use. There could be static methods that apply a font to a field, or return the font name given the font's class name. This could help keep the rest of your application cleaner.

Actionscript 3.0 Embed Font - Text Not Appearing

I am creating dynamic TextFields in actionscript 3.0. Like many others, my text disappears when I set .embedFonts = true;
ArialSlim is embedded and exported for actionscript. I have successfully tested with trace(Font.enumerateFonts());
Interestingly enough, when I comment out the embed line (as shown below), the font works properly.
Alternatively, .setTextFormat(); also works properly without the .embedFonts line.
So my questions is, why? Will I run into any issues in this case?
var divArray = new Array();
var x_Lbl_Array:Array = new Array();
var entries:int = 10;
var labelFormat:TextFormat = new TextFormat();
var arial:Font = new ArialSlim();
labelFormat.font = arial.fontName;
labelFormat.size = 10;
var xVar:int = 0;
for(var loop:int = 0; loop < entries; loop++){
x_Lbl_Array[loop] = new TextField();
//x_Lbl_Array[loop].embedFonts = true;
x_Lbl_Array[loop].antiAliasType = AntiAliasType.NORMAL;
x_Lbl_Array[loop].defaultTextFormat = labelFormat;
x_Lbl_Array[loop].x = xVar;
x_Lbl_Array[loop].y = 165;
x_Lbl_Array[loop].text = "test";
mc.addChild(x_Lbl_Array[loop]);
xVar++;
}
Edit:
I just ran this code from frame 1 with .embedFonts = true; and it worked...
Maybe I should mention that I'm having trouble running this code in a method inside an instantiated actionscript class. The class is located in an external .as file. Does this help answer my question?
I tried your code and it worked for me (with the embedded font)
check if you have all the characters included.
You can either set the character range, or create a textfield that has all the characters.
It turns out that I at some point clicked "TLF (DF4)" in the outline format options for my embedded font. When I corrected this, and chose "Classic (DF3)," it fixed my problem.
I guess what I find to be really weird is that the font was showing properly without .embedFonts being set to true
Thank you, Daniel. I appreciate the help.

Embedded fonts not appearing in actionscript created textfields

I would like to preface this wall of text by saying, I am very new at this. I may be missing something obvious.
I'm working in Flash CS5 with Actionscript 3. I'm trying to use actionscript to create a textfield, and populate it with text. I've embedded my font in my project using the "Font Embedding" window. However, when the code to create the textfield is run, if "embedFont = true;", the font is invisible. The cursor still changes when hovering over it, so I know it's there. Or at least its text box is, I guess. Dynamic textfields with embedded text which are already on the stage seem to be unaffected.
I've tried changing the embedded fonts outline format, neither work. I've tried directly embedding the font with the "embed" tag via actionscript, but it doesn't seem to work with CS5, or I don't know what I'm doing. As you can see in the code provided, I've tried "registering" the font, with no success. I've tried using:
var font:Font = new screenfont(); //"screenfont" is the name from Embedding Fonts
var format:TextFormat = new TextFormat();
format.font = screenfont.fontName;
No dice.
I've followed some different tutorials about embedding, and come across a wealth of conflicted, confusing information. I've read a few different posts pertaining to this subject, but haven't found any viable solutions as of yet.
Here's a simple version of my code, where "screenfont" is the name I specified in the Embedding Fonts window:
Font.registerFont(screenfont);
//TextFormat
var listformat:TextFormat = new TextFormat();
listformat.align = TextFormatAlign.LEFT;
listformat.size = 20.8;
listformat.color = 0x0DAC54;
listformat.font="Fixedsys Excelsior 3.01";
//TextField
var photolist:TextField = new TextField();
photolist.x = photos_x;
photolist.y = tempY;
photolist.width = photos_wdth;
photolist.height = photos_hght;
photolist.text = photoname;
photolist.embedFonts = true; //<--- This freakin' guy!
photolist.antiAliasType = AntiAliasType.ADVANCED;
photolist.defaultTextFormat=listformat;
photolist.selectable = false;
photolist.wordWrap = true;
mediapage.photos.addChild(photolist);
I hope this provides a clear picture.
So, how exactly is embedding accomplished in CS5?
You should set the text as the last thing you do. So this line photolist.text = photoname; should be after everything else.
var photolist:TextField = new TextField();
photolist.x = photos_x;
photolist.y = tempY;
photolist.width = photos_wdth;
photolist.height = photos_hght;
photolist.embedFonts = true;
photolist.antiAliasType = AntiAliasType.ADVANCED;
photolist.defaultTextFormat=listformat;
photolist.selectable = false;
photolist.wordWrap = true;
photolist.text = photoname;//<-- set text only after applying all formatting and embedding
mediapage.photos.addChild(photolist);

ActionScript Dynamic HTML Text With Embedded Fonts?

i'm trying to use htmlText on a dynamic text field with embedded fonts. i've searched for an hour for an answer and i still don't have one.
on stage, there is a dynamic text field with no text. i've embedded both regular and bold versions of Myraid Pro. the text field on stage is set to regular (have to choose something). "Render Text As HTML" is selected.
the following code in my document class doesn't work:
myText.autoSize = TextFieldAutoSize.CENTER;
myText.htmlText = "Not Bold <b>Bold</b>";
the html tags only work if the text field on stage is set to "use device fonts" in the anti-alias setting.
unreal.
It may be your embed parameters missing embedAsCFF='false', try something like:
[Embed(source='path/to/foo.otf', fontName='foo', embedAsCFF='false')]
In flex 4 the default is true to take advantage of the new text engine while flash.text.TextField relies on the old engine. There's more details here.
Well i have faced this problem. i forgot the solution but i have clue for you.. Try this way
var myFormat:TextFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.size = 14;
myText.autoSize = TextFieldAutoSize.CENTER;
myText.defaultTextFormat = myFormat;
myText.embedFonts = true;
myText.htmlText = "Not Bold\n";
myText.appendText("Bold");