Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Embedded Fonts In Dynamically Created Textfields


I have a bunch of dynamically created textfields which I set the properties as follows:

with(eval("fieldx" add (scale*xm))){
tempformatx = new TextFormat();
tempformatx.font = "Arial";
tempformatx.size = "10";
tempformatx.bold = true;

type = "dynamic";
selectable = false;
autosize = true;
text = dataarray[0][xm+1];
textColor = "0x000000";
_x = 15 + (colwidth*(xm+1))-(_width/2);
_y =(graphheight-15) + 3

setTextFormat(tempformatx);
}

the problem is that when I insert the line: 'embedFonts = true' the text disapears.

I need the fonts to be embedded so that I can rotate the textfields.

Any ideas.




FlashKit > Flash Help > Flash MX
Posted on: 07-31-2002, 03:30 AM


View Complete Forum Thread with Replies

Sponsored Links:

Embedded Fonts In Dynamically Created Textfields
I have a bunch of dynamically created textfields which I set the properties as follows:

with(eval("fieldx" add (scale*xm))){
tempformatx = new TextFormat();
tempformatx.font = "Arial";
tempformatx.size = "10";
tempformatx.bold = true;

type = "dynamic";
selectable = false;
autosize = true;
text = dataarray[0][xm+1];
textColor = "0x000000";
_x = 15 + (colwidth*(xm+1))-(_width/2);
_y =(graphheight-15) + 3

setTextFormat(tempformatx);
}

the problem is that when I insert the line: 'embedFonts = true' the text disapears.

I need the fonts to be embedded so that I can rotate the textfields.

Any ideas.

View Replies !    View Related
Embeding Fonts For Dynamically Created TextFields
I've tried to search for an answer but i've come up empty handed. I know the embedFont for the text format embeds the font, but i can't get it to work. What is that syntax actually doing...? Is it embedding the font from my harddrive when i publish the movie or is it looking for the font from the users hard drive and embedding it from there?

I'm using pixel font's so this is particularly cruciual.

Thanks

View Replies !    View Related
[F8] Dynamically Created Input Boxes With Embedded Fonts?
As the title says, that's the problem. For starts I should say that everything I describe is created with actionscript, there's nothing on the stage prior to run-time. Anyhow... on my site a have a movieclip called login with 1 large static text field in it. There are 2 text boxes, username and password, which are input boxes but use embedded fonts. The problem here is that the fonts do not seem to embed if the text isn't set at start (all it takes is something like a single space, they just can't be empty). If they aren't set at run-time, the input box doesn't even allow me to write in it! Here's the snippit where I declare the whole login clip:

code:
function drawLogin(target) {
var login = target.createEmptyMovieClip("login", depth(target));
login.lineStyle(1, 0x000000, 100, false, "none", "round", "miter", 255);
login.lineTo(400, 0);
login.moveTo(0, 15);
login.lineTo(400, 15);
login._x = 390;
login._y = main.rightPane._y - 20;
var loginMask = target.createEmptyMovieClip("loginMask", depth(target));
fillGradient(loginMask, [0xFFFFFF, 0x000000, 0xFFFFFF], "linear", "pad", [15, 100, 15], [0, 127, 255], Math.PI, login._x-1, login._y-1, 17, 402);
login.cacheAsBitmap = true;
loginMask.cacheAsBitmap = true;
login.setMask(loginMask);
var txt = login.createTextField("txt", depth(login), 3, -1, 300, 16);
txt.embedFonts = true;
txt.selectable = false;
txt.html = true;
txt.htmlText = "<font color='#FF0000'>LOGIN</font> Username: Password:";
navFormat.align = "left";
txt.setTextFormat(navFormat);
navFormat.color = 0x6e8193;
navFormat.font = "sansFont";
navFormat.size = 10;
var txt2 = login.createTextField("userName", depth(login),105, 0, 60, 15);
txt2.type = "input";
txt2.embedFonts = true;
txt2.border = true;
txt2.text = " ";
txt2.maxChars = 10;
txt2.restrict = "A-Za-z0-9";
txt2.condenseWhite = true;
txt2.setTextFormat(navFormat);
var txt3 = login.createTextField("password", depth(login), 222, 0, 60, 15);
txt3.type = "input";
txt3.embedFonts = true;
txt3.border = true;
txt3.text = " ";
txt3.maxChars = 10;
txt3.password = true;
txt3.restrict = "A-Za-z0-9";
txt3.condenseWhite = true;
txt3.setTextFormat(navFormat);
var loginBtn = login.createEmptyMovieClip("loginBtn", depth(login));
fill(loginBtn, 282, 0, 15, 70, 0x6e8193, 0x000000);
var loginText = loginBtn.createTextField("txt", depth(loginBtn), 3, 0, 64, 15);
loginText.selectable = false;
loginText.embedFonts = true;
loginText.text = "Login";
navFormat.color = 0x000000;
navFormat.align = "center";
loginText.setTextFormat(navFormat);
}


If you notice the first text field, the reason the text looks that way is because I placed the username and password input fields in between the words so I didn't have to create a ton of text fields. Now, like I said, I have to have any text at all in the fields before I run the thing. If not, I can't write in it at all. I do know that when a text box's text is changed, to have to reapply the textFormat with setNewTextFormat. So I guess I'm asking how I need to check to see if the text is changed. It's possible I guess for me to have the login movieclip run and onEnterFrame to see if the textBoxes are not equal to what they were the last frame, but it just seems overly complicated and I figured I'd ask before I potentially cobble something together and do it the hard way. Any ideas?

View Replies !    View Related
EMBEDDED FONTS AND DYNAMIC TEXTFIELDS - Embedded Fonts, Css, Xml, Textfields, Dynamic
I'm dying here trying to figure this out for days.
Here's the scenario:

1) External script.as file dynamically imported to loader.swf file that creates a textfield (createTextField)
2) Content for the text field should be provided by an XML file
3) Content styled by external css file
4) Fonts need to be embedded so as to apply anti-alias

I can get the XML & CSS to apply to the text field, but can't get the content to use the embedded font. It usually comes back "undefined" if the embedded font works. Otherwise, when I comment out the embed font, the content work, but of course, not the anti-aliasing. Ugh. I've tried doing all kinds of forum searches, but nothing has clarified this for me. I'm intermediate at AS and this is something new to me. Any help will be GREATLY appreciated and I will send good juju your way.
Here's a sampling of some of the script I have been using:

ACTIONSCRIPT:

mf = new TextFormat();
mf.font = "arial_font";
Stage.scaleMode = "noScale";

this.createTextField("news_txt", 99, 50, 50, 450, 300);
news_txt.border = true;
news_txt.html = true;
news_txt.multiline = true;
news_txt.wordWrap = true;
news_txt.embedFonts = true;
news_txt.autoSize = true;
news_txt.setNewTextFormat(mf);


// Load CSS
var styles:TextField.StyleSheet = new TextField.StyleSheet();
styles.load("heading.css");

// Load XML apply to headingText
var banner_xml:XML = new XML();
banner_xml.ignoreWhite = true;
banner_xml.onLoad = function(success:Boolean):Void {
if (success) {
news_txt.styleSheet = styles;
news_txt.text = banner_xml;
} else {
trace("Error loading XML.");
}
};
banner_xml.load("heading.xml");



XML:

<story>
<title></title>
<mainBody>
<heading>Heading Text</heading>
<tagline>Clever tagline goes here</tagline>
</mainBody>
</story>



CSS:

heading {
color:#000000;
font-family:"Franklin Gothic Book", Arial, sans-serif;
display: block;

font-size: 50pt;
margin: 0px;
padding: 0px;
letter-spacing: -5px;
}

tagline {
color:#000000;
font-size: 20pt;
font-family:"Franklin Gothic Book", Arial, sans-serif;
display: block;
font-weight: bold;
}

So, if I turn off the xml/css and use htmlText to create content for the text field, the text uses the embedded font and is anti-aliased. If I keep the xml/css but comment out embedFonts, then the content works but is not anti-aliased. I need both of these to work at the same time. PLEASE HELP!!

peace

View Replies !    View Related
Dynamically Created TextFields
Hi
First off I'm sorry this seems to be a very old type of problem. I've spent the last two hours searching the forums for help with this but I just can't get it to work. As far as I can tell I'm doing exactly the same as other threads suggest.

I want to make a list of text items that I can dynamically update at runtime. So I have a MovieClip of a box to hold them and then some AS attached to the MC as follows:


Code:
public function addListItem(itemText:String)
{
var itemHeight = 15;

blackTextFormat = new TextFormat();
blackTextFormat.size = 12;
blackTextFormat.color = 0x000000;

numberOfItems++; // class level variable, starts at 0

this.createTextField("item" + numberOfItems, this.getNextHighestDepth(), 0
((numberOfItems - 1) * itemHeight),
30, itemHeight);

with (["item" + numberOfItems])
{
autoSize = true;
text = itemText;
setTextFormat(blackTextFormat);

trace("The text from with(" + _name + ") = " + text + " and width = " + textWidth + " at " + _x + "," + _y);

} // end with() block for new text item properties
} // end function addListItem()
And then I use it as follows:


Code:
aMenuInstance.addListItem("Barry");
aMenuInstance.addListItem("George");
aMenuInstance.addListItem("Fred");
The containing box is displayed but there is no text on it. The strangest things are that:
1. I have another function that resizes the box around the text once the items have been added - that works perfectly
2. The trace statement in the with() block prints out the text strings (Barry, George & Fred) as expected but the _x, _y, _name & textWidth properties are either 0 or just not printed

What am I doing wrong here? I am using Flash MX 2004 and targeting Flash Player 6

Many thanks
Ross

View Replies !    View Related
Populating Dynamic Textfields With Embedded Fonts
I have created a series of dynamic text fields that i want to populate from a database. I have this working without any problems. Problems arrise however when i want to embed the font which will appear in the textfield. Basically, once i set the embed command the fonts are not appearing at all. I have tried both the methods of including font via library linkage and dummy text field. Without the embed font code works fine. As soon as i put in this line of code nothing appears.

Code is as follows

this.createTextField("tfNewfield", 1, 80, 10, 150, 15);
tfNewfield.text = _global.titlo1;
tfNewfield.selectable = false;
tfNewfield.autoSize = true;
tfNewfield._highquality = 2;
tfNewfield._variable = titolo1;
tfNewfield.textColor = 0x9B603C;
tfNewfield.embedFonts = true; //this is the line which upsets things
fmtEmphasis = new TextFormat();
fmtEmphasis.size = 13;
fmtEmphasis.font = "TradeGothic BoldTwo";
tfNewfield.setTextFormat(fmtEmphasis);


any feedback would be appreciated.

View Replies !    View Related
Masking Dynamically Created Textfields?
Hi there,

who can help me out with the following:

I create textfields, set their properties, all works fine. But I want those fields to be masked. It works just fine when I create the fields on the stage, but not when they are created by code.
I do use .embedFonts = true
the used character is not a systemfont
I think the missing thing is a way to embed characters dynamically?

thnx, mark

View Replies !    View Related
Problem With Dynamically Created TextFields
i am writing a text scroller where i read in a string of text parse it down and assign each line to a dynamically created text field. i will be using this on a website inside another flash movie that loads it into a movieclip. everything on it works except one problem where i press the down arrow to shift the text and hold it to continue to shift the text. this is done on a movieclip onPress onRelease event where the onPress calls the shiftUp function then sets an interval to continue to repeat the function. the onRelease event then clears the interval. the regular call to the function works just fine but the call from the interval does not. even though it is the same function. here is the code for the creation of the textFields, the shifting of the textFields and the events

//Parses the content of the message and adds date in\
//then creates a number of textFields equal to the number of lines\
//and sets the text equal to the equivelant line of the blog\
function getContent() {
var fieldCounter:Number = 0;
for(var i:Number = 0; i < phpReceiver.n; i++){
var tempArray_arr:Array;
tempStr_str = phpReceiver["date"+i.toString()]+ "~" + phpReceiver["msg"+i.toString()];
tempArray_arr = tempStr_str.split("~");
totalLines += tempArray_arr.length;
for(var j = fieldCounter; j < (tempArray_arr.length+fieldCounter); j++){
var tempName:String = "field"+j+"_txt";
this.createTextField(tempName, this.getNextHighestDepth(), 5, (100 + 20 * j), 350, 20);
//this[tempName].html = true;
this[tempName].text = tempArray_arr[j - fieldCounter];
this[tempName].embedFonts = true;
if(j==fieldCounter){
this[tempName].setTextFormat(dateFormat_fmt);
}else{
this[tempName].setTextFormat(txtFormat_fmt);
}
this[tempName].type = "dynamic";
this[tempName]._xscale = 100 - (j*scaleDifference);
this[tempName]._yscale = 100 - (j*scaleDifference);
}
fieldCounter = totalLines;
}
}

//Shifts the text fields up based on the number of iterations passed through\
//The iterations are multiplied by eight so that the textField shifts up 20 pixels\
function shiftUp(iterations:Number){
test2_txt.text = this[field0_txt] + " " + _parent[field0_txt] + " " + _parent[field0_txt] + " " + _root[field0_txt];
for(var j = 0; j <= iterations * 10; j++){
if(this["field"+(totalLines-1)+"_txt"]._y > 100){
for(var i = 0; i < totalLines; i++){
var tempName:String = "field"+i+"_txt";
if(Math.round(this[tempName]._y) > 390 ){
this[tempName]._visible = false;
this[tempName]._y = this[tempName]._y - 2;
this[tempName]._xscale += scaleDifference / 10;
this[tempName]._yscale += scaleDifference / 10;
}else if(Math.round(this[tempName]._y) > 121 && Math.round(this[tempName]._y) <= 390){
this[tempName]._visible = true;
this[tempName]._y = this[tempName]._y - 2;
this[tempName]._xscale += scaleDifference / 10;
this[tempName]._yscale += scaleDifference / 10;
}else if(Math.round(this[tempName]._y) >= 99 && Math.round(this[tempName]._y) <= 121){
this[tempName]._visible = true;
this[tempName]._y = this[tempName]._y - 2;
this[tempName]._xscale = 100;
this[tempName]._yscale = 100;
}else if(Math.round(this[tempName]._y) < 99 && Math.round(this[tempName]._y) >= 0){
this[tempName]._visible = true;
this[tempName]._y = this[tempName]._y - 2;
this[tempName]._xscale -= scaleDifference / 10;
this[tempName]._yscale -= scaleDifference / 10;
}else if(Math.round(this[tempName]._y) < 0){
this[tempName]._visible = false;
this[tempName]._y = this[tempName]._y - 2;
this[tempName]._xscale -= scaleDifference / 10;
this[tempName]._yscale -= scaleDifference / 10;
}
}
}
}
}

//When arrow line down pressed skips down 1 line of text\
//Sets lineInterval so that if button is held down it continues to reiterate function\
arrowLineDown_mc.onPress = function(){
shiftUp(1);
lineInterval = setInterval(shiftUp, 150, 1);
}
//When arrow line down released clears the lineInterval\
arrowLineDown_mc.onRelease = function(){
clearInterval(lineInterval);
}

View Replies !    View Related
Applying CSS To Dynamically Created TextFields?
hi folks.

back again with another quick question!

a quick explanation of what I'm at... I'm working on something at the moment, basically what I have is an external textfile which contains several variables; I am loading these variables into flash using loadVariables().

one of these variables invokes the script to create several buttons on the stage using for() and attachMovie(), and add onRelease() actions for each. when each button is clicked, a new textfield for that button is created on the stage.

the other loaded variables contain appropriately named html-formatted strings of text, which are then loaded into their respective, newly created textFields. pretty straightforward, and everything's working perfectly, the tags are being rendered etc. bold text is turning up bold and links are working correctly.

but, I know nothing about CSS and flash! here's what I'm wondering... although my text is being rendered properly, I currently have no control over the style of my text, so it is rendering as black, times new roman etc. how can I apply CSS styles in order to control font size, type, colour etc.?

does this entail attaching an external stylesheet, or can CSS styles be defined within the movie?

here is my code at the moment:


PHP Code:



// create box for textField for loadingMsg_root.createTextField("loadingMsg", 20, 10, 60, 300, 100);// create empty movie clip to store variables_root.createEmptyMovieClip("myVariables_mc", 1);loadVariables("text.txt", myVariables_mc);function checkVariablesLoaded() {        if (myVariables_mc.myVariablesLoaded != "loaded") {                trace("variables still loading");        loadingMsg.text = "one moment. loading data...";            } else {                trace("variables loaded");                //remove loadingMsg        _root.loadingMsg.removeTextField();                for (i=1; i<=myVariables_mc.numberOfButtons; i++) {                        // attach buttons            _root.attachMovie("clicky_mc", i, 3+i, {_x:i*21-20, _y:1});            eval(i).onRelease = function() {                                // create new textField                _root.createTextField("myTextField"+this._name, 2, 1, 30, 300, 100);                                // define textField properties                eval("_root.myTextField"+this._name).multiline = true;                eval("_root.myTextField"+this._name).wordWrap = true;                eval("_root.myTextField"+this._name).autoSize = "left";                eval("_root.myTextField"+this._name).html = true;                                //                eval("_root.myTextField"+this._name).htmlText = eval(myVariables_mc+".myText"+this._name);                trace(this._name);            }        }        clearInterval(myInterval);    }}var myInterval:Number = setInterval(checkVariablesLoaded, 100); 




and here are the variables, contained in text.txt:

-----

numberOfButtons=3&myText1=<b>hi there</b>. text 1&myText2=hello. <b>text 2</b>&myText3=yo... <b>text three</b> <a href="#">this is a link</a>&myVariablesLoaded=loaded

-----

yeesh... bit long, anyway if anyone has any suggestions as to how I can add a bit of CSS to these textFields I'd be seriously grateful!

thanks for reading! dar

View Replies !    View Related
Reasons Why Embedded Fonts In Dynamic Textfields Disappear?
Hi people,

This is my first post on this forum, so pleased to meet you all...

Here's the issue:

My movie loads a bunch of data from a database via asp. It then duplicates a movieclip once for every record and displays the data in dynamic textfields within these movieclips.
The whole thing has to be scrollable so I embedded all the clips into one big clip and connected some scrollbar code.

But that's not really the point, cause all this works just fine.

The problem is that when I try to embed fonts for some of the dynamic textfields, the text in these fields doesn't show at all. So the embedding doesn't seem to work.

I've been browsing through the flash docs and sites all day but I can't seem to find any reasons why the embedded fonts should not display. Except something about embedded fonts not being able to display html text in bold and italic, but this is not the case.

Has anyone encountered similar problems? I'd appreciate any hints...

Thankx,

ren

View Replies !    View Related
How Do I Load Text Into My Dynamically Created Textfields?
Hi again Flashgurus!

I'm using the following code to create a function that creates a dynamic textfield:

function makeText() {
createTextfield("textBox", 50, 4, 3, 371, 43);
textBox.background = true;
textBox.border = true;
textBox.backgroundColor = 0xFFFFFF;
textBox.borderColor = 0x000000;
textBox.multiline = true;
textBox.wordWrap = true;
textBox.autoSize = true;
textBox.variable = "txt";

// formatering
myFormat = new TextFormat();
myFormat.font = "Impact";
myFormat.size = 15;
myFormat.color = 0x666666;

textBox.setNewTextFormat(myFormat);
}


In my different movieclips I call the function like this:


_root.makeText(this);


and the textfield, "textBox" , with the variable "txt" is created.

As there are different texts to be loaded in different textfields (in different movieclips that are loaded by a random script), I can't use the function "makeText" to load the texts. I must load the right, specific text in the right, specific movieclip when that movieclip is loaded (and the textfield is created, ofcourse).

So here's the question:
How do I load text into "textBox" from my external textfiles?!

I know how this works when I make textfields manually, but now I'm stuck. As I'm using about 40 different movieclips and I want to be able to change the formatting of the textbox I really want to use my function.

Please help me, oh, You FlashGurus!

View Replies !    View Related
Dynamically Created Textfields Aren't That Dynamic...
Bit of a weird one, but it seems dynamically created text fields don't watch the variable they're assigned.

code: _root.createTextField("txt",1,50,50,50,50);
txt.variable = _root.vari;
_root.vari = "hello";//Text field doesn't change

Is this a known bug?

(I'm in bog standard MX btw...)

View Replies !    View Related
Accessing Dynamically Created Input Textfields
Inside a function i dynamically make 10 Input textfields. How do I make them global - that is, how can I access to their .text property from outside the function? The plan is that when a user clicks on a button, the listener function will determine the values in these input textfields, but am stuck in two ways:
1) input textfields are not recognized outside the function (1120: Access of undefined property vnosno.)
2) how to access each of the 10 input textfields, when i create each one with the same variable name (is there a way to create them with successive numbers; e.g. vnosno1,vnosno2,vnosno3...?)

this is how i created the input textfields:

ActionScript Code:
for (var k:int = 0; k < 10; k++) {
    var vnosno:TextField = new TextField();
    vnosno.type = TextFieldType.INPUT;
    vnosno.width = 100;
    vnosno.height = 23;
    vnosno.x = 100;
    vnosno.y = 80 + (k * 30);
    addChild(vnosno);
}

View Replies !    View Related
Font Embeds With AS - Dynamically Created Textfields
OK, so having some problems again this morning with font embeds (I think) with a dynamically created textfield.

Code I'm using (which is not displaying jack):


ActionScript Code:
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.size = 12
my_fmt.font = "Rabiohead";
my_fmt.align = "left"

this.createTextField("res_description", 1, 0, 25, 150, 20);

// res_description.multiline = true;
res_description.wordWrap = true;
res_description.autoSize = true;
res_description.embedFonts = true;
res_description.htmlText = true;
res_description.setTextFormat(my_fmt);
res_description.text = "This is a test";

"Rabiohead" is the font. I've tried adding it to the library and setting it's linkage settings to export for AS. tried the Linkage ID in the my_fmt.font = "Rabiohead"; part, but to no avail.

So far, the only way it's working, is if I set embedFonts to false.

Any ideas?

View Replies !    View Related
XML Based Banner + Dynamically Created Textfields + Loops
Hello everybody!
I have recently started a task, and have some difficulties with it right now. I literally got stuck with that! I'd appreciate if someone could look at my problem "with fresh eyes" and advise me on possible solution(s).

I am using Flash 8

I need to make XML-based banner. XML file itself will contain from 5 up to 30 tags (childNodes). It is supposed that this XML file gonna be edited by the client, so the client can add/remove or change data (that is, quantity of ChildNodes).

I need to take the data out of XML and then display them (animated!) in a flash banner, five at a time. Firts five, then second five, and so on. If, for example, there will be 13 tags, that should be first 5, then second 5 and then the last 3. After that everything should start from the beginning (first five).

XML-file is like this:



Code:
<?xml version = "1.0" encoding = "Windows-1251" ?>
<tariffs>
<tariff where = "Kaliningrad, Russia" howmuch = "1,5$" />
<tariff where = "Khorezm" howmuch = "0,2$" />
<tariff where = "Moscow" howmuch = "2,5$" />
<tariff where = "Kiev" howmuch = "0,4$" />
<tariff where = "Bobruysk" howmuch = "0,3$" />
<tariff where = "Chirchik" howmuch = "0,3$" />
<tariff where = "Tashkent, mobiles" howmuch = "0,3$" />
<tariff where = "Magadan" howmuch = "0,3$" />
<tariff where = "Almaty" howmuch = "0,3$" />
</tariffs>
actionscript is as following:

first frame:


Code:
var indhold:XML = new XML();
indhold.ignoreWhite = true;
var destinations:Array = new Array();
var prices:Array = new Array();
var Format:TextFormat = new TextFormat();

Format.size = 11;
Format.color = 0xffffff;
Format.font = "tahoma";
Format.bold = true;

indhold.load("tarifi.xml");
second frame:


Code:
indhold.onLoad = function(success) {
if (success) {
var tarifiki:Array = this.firstChild.childNodes;
for (i=0; i<tarifiki.length; i++) {
destinations.push(tarifiki[i].attributes.where);
prices.push(tarifiki[i].attributes.howmuch);
}
} else {
trace("error loading xml");
}
};
third frame:


Code:
import mx.transitions.*;
import flash.filters.*;


for (i=0; i<5; i++) {
_root.createTextField("gde"+i, i+3, 16, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false); //this filter is added just for the sake of alpha tween
// which did not work without that!
_root["gde"+i].filters = [ds];
_root["gde"+i].text = destinations[i];
_root["gde"+i].setTextFormat(Format);
var nashTween = new Tween(_root["gde"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}

for (i=0; i<5; i++) {
_root.createTextField("pochem"+i, i+33, 180, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false);
_root["pochem"+i].filters = [ds];
_root["pochem"+i].text = prices[i];
_root["pochem"+i].setTextFormat(Format);
var nashTween = new Tween(_root["pochem"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}
var maskClip:MovieClip = _root.createEmptyMovieClip("opa", 200);
with (maskClip) {

// Draw a mask
beginFill(0x667686, 100);
moveTo(0, 30);
lineTo(Stage.width, 30);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 30);
endFill();
}


var myTransitionManager:TransitionManager = new TransitionManager(opa);
myTransitionManager.startTransition({type:Wipe, direction:Transition.OUT, duration:3, easing:None.easeNone, startPoint:9});
var myListener:Object = new Object();
myListener.allTransitionsOutDone = function(eventObj:Object) {
trace("allTransitionsOutDone event occurred."); // added just to catch the moment when transition is finished, though I am not sure that this is right way to do it.
// i tried to begin second-five-items-display here.. and it did not work.
};
myTransitionManager.addEventListener("allTransitionsOutDone", myListener);


stop(); //added just to be able to see that things look like they should.
and now I got stuck..
how to get the next five nodes to be shown?
i did try to do that on allTransitionsOutDone event, removing old textfields and creating new with new .text values, but with no success... :(
another thing that i can't find out is how to check for the quantity of 5-items-sets already shown and how to calculate for the next 5 (or less) to be shown?
and finally, how to arrange that at the end the entire "show" begin again?

please point me out the directions! =)

View Replies !    View Related
XML Based Banner + Dynamically Created Textfields + Loops
Hello everybody!
I have recently started a task, and have some difficulties with it right now. I literally got stuck with that! I'd appreciate if someone could look at my problem "with fresh eyes" and advise me on possible solution(s).

I need to make XML-based banner. XML file itself will contain from 5 up to 30 tags (childNodes). It is supposed that this XML file gonna be edited by the client, so the client can add/remove or change data (that is, quantity of ChildNodes).

I need to take the data out of XML and then display them (animated!) in a flash banner, five at a time. Firts five, then second five, and so on. If, for example, there will be 13 tags, that should be first 5, then second 5 and then the last 3. After that everything should start from the beginning (first five).

XML-file is like this:



Code:
<?xml version = "1.0" encoding = "Windows-1251" ?>
<tariffs>
<tariff where = "Kaliningrad, Russia" howmuch = "1,5$" />
<tariff where = "Khorezm" howmuch = "0,2$" />
<tariff where = "Moscow" howmuch = "2,5$" />
<tariff where = "Kiev" howmuch = "0,4$" />
<tariff where = "Bobruysk" howmuch = "0,3$" />
<tariff where = "Chirchik" howmuch = "0,3$" />
<tariff where = "Tashkent, mobiles" howmuch = "0,3$" />
<tariff where = "Magadan" howmuch = "0,3$" />
<tariff where = "Almaty" howmuch = "0,3$" />
</tariffs>

actionscript is as following:

first frame:


Code:
var indhold:XML = new XML();
indhold.ignoreWhite = true;
var destinations:Array = new Array();
var prices:Array = new Array();
var Format:TextFormat = new TextFormat();

Format.size = 11;
Format.color = 0xffffff;
Format.font = "tahoma";
Format.bold = true;

indhold.load("tarifi.xml");

second frame:


Code:
indhold.onLoad = function(success) {
if (success) {
var tarifiki:Array = this.firstChild.childNodes;
for (i=0; i<tarifiki.length; i++) {
destinations.push(tarifiki[i].attributes.where);
prices.push(tarifiki[i].attributes.howmuch);
}
} else {
trace("error loading xml");
}
};
third frame:


Code:
import mx.transitions.*;
import flash.filters.*;


for (i=0; i<5; i++) {
_root.createTextField("gde"+i, i+3, 16, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false); //this filter is added just for the sake of alpha tween
// which did not work without that!
_root["gde"+i].filters = [ds];
_root["gde"+i].text = destinations[i];
_root["gde"+i].setTextFormat(Format);
var nashTween = new Tween(_root["gde"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}

for (i=0; i<5; i++) {
_root.createTextField("pochem"+i, i+33, 180, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false);
_root["pochem"+i].filters = [ds];
_root["pochem"+i].text = prices[i];
_root["pochem"+i].setTextFormat(Format);
var nashTween = new Tween(_root["pochem"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}
var maskClip:MovieClip = _root.createEmptyMovieClip("opa", 200);
with (maskClip) {

// Draw a mask
beginFill(0x667686, 100);
moveTo(0, 30);
lineTo(Stage.width, 30);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 30);
endFill();
}


var myTransitionManager:TransitionManager = new TransitionManager(opa);
myTransitionManager.startTransition({type:Wipe, direction:Transition.OUT, duration:3, easing:None.easeNone, startPoint:9});
var myListener:Object = new Object();
myListener.allTransitionsOutDone = function(eventObj:Object) {
trace("allTransitionsOutDone event occurred."); // added just to catch the moment when transition is finished, though I am not sure that this is right way to do it.
// i tried to begin second-five-items-display here.. and it did not work.
};
myTransitionManager.addEventListener("allTransitionsOutDone", myListener);


stop(); //added just to be able to see that things look like they should.
and now I got stuck..
how to get the next five nodes to be shown?
i did try to do that on allTransitionsOutDone event, removing old textfields and creating new with new .text values, but with no success... :(
another thing that i can't find out is how to check for the quantity of 5-items-sets already shown and how to calculate for the next 5 (or less) to be shown?
and finally, how to arrange that at the end the entire "show" begin again?

please point me out the directions! =)

View Replies !    View Related
XML Based Banner + Dynamically Created Textfields + Loops
Hello everybody!
I have recently started a task, and have some difficulties with it right now. I literally got stuck with that! I'd appreciate if someone could look at my problem "with fresh eyes" and advise me on possible solution(s).

I need to make XML-based banner. XML file itself will contain from 5 up to 30 tags (childNodes). It is supposed that this XML file gonna be edited by the client, so the client can add/remove or change data (that is, quantity of ChildNodes).

I need to take the data out of XML and then display them (animated!) in a flash banner, five at a time. Firts five, then second five, and so on. If, for example, there will be 13 tags, that should be first 5, then second 5 and then the last 3. After that everything should start from the beginning (first five).

XML-file is like this:


<?xml version = "1.0" encoding = "Windows-1251" ?>
<tariffs>
<tariff where = "Kaliningrad, Russia" howmuch = "1,5$" />
<tariff where = "Khorezm" howmuch = "0,2$" />
<tariff where = "Moscow" howmuch = "2,5$" />
<tariff where = "Kiev" howmuch = "0,4$" />
<tariff where = "Bobruysk" howmuch = "0,3$" />
<tariff where = "Chirchik" howmuch = "0,3$" />
<tariff where = "Tashkent, mobiles" howmuch = "0,3$" />
<tariff where = "Magadan" howmuch = "0,3$" />
<tariff where = "Almaty" howmuch = "0,3$" />
</tariffs>


actionscript is as following:

first frame:

var indhold:XML = new XML();
indhold.ignoreWhite = true;
var destinations:Array = new Array();
var prices:Array = new Array();
var Format:TextFormat = new TextFormat();

Format.size = 11;
Format.color = 0xffffff;
Format.font = "tahoma";
Format.bold = true;

indhold.load("tarifi.xml");


second frame:

indhold.onLoad = function(success) {
if (success) {
var tarifiki:Array = this.firstChild.childNodes;
for (i=0; i<tarifiki.length; i++) {
destinations.push(tarifiki[i].attributes.where);
prices.push(tarifiki[i].attributes.howmuch);
}
} else {
trace("error loading xml");
}
};

third frame:

import mx.transitions.*;
import flash.filters.*;


for (i=0; i<5; i++) {
_root.createTextField("gde"+i, i+3, 16, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false); //this filter is added just for the sake of alpha tween
// which did not work without that!
_root["gde"+i].filters = [ds];
_root["gde"+i].text = destinations[i];
_root["gde"+i].setTextFormat(Format);
var nashTween = new Tween(_root["gde"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}

for (i=0; i<5; i++) {
_root.createTextField("pochem"+i, i+33, 180, 20*i+30, 200, 30);
var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false);
_root["pochem"+i].filters = [ds];
_root["pochem"+i].text = prices[i];
_root["pochem"+i].setTextFormat(Format);
var nashTween = new Tween(_root["pochem"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}
var maskClip:MovieClip = _root.createEmptyMovieClip("opa", 200);
with (maskClip) {

// Draw a mask
beginFill(0x667686, 100);
moveTo(0, 30);
lineTo(Stage.width, 30);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 30);
endFill();
}


var myTransitionManager:TransitionManager = new TransitionManager(opa);
myTransitionManager.startTransition({type:Wipe, direction:Transition.OUT, duration:3, easing:None.easeNone, startPoint:9});
var myListener:Object = new Object();
myListener.allTransitionsOutDone = function(eventObj:Object) {
trace("allTransitionsOutDone event occurred."); // added just to catch the moment when transition is finished, though I am not sure that this is right way to do it.
// i tried to begin second-five-items-display here.. and it did not work.
};
myTransitionManager.addEventListener("allTransitio nsOutDone", myListener);


stop(); //added just to be able to see that things look like they should.

and now I got stuck..
how to get the next five nodes to be shown?
i did try to do that on allTransitionsOutDone event, removing old textfields and creating new with new .text values, but with no success... :(
another thing that i can't find out is how to check for the quantity of 5-items-sets already shown and how to calculate for the next 5 (or less) to be shown?
and finally, how to arrange that at the end the entire "show" begin again?

please point me out the directions! =)

View Replies !    View Related
XML Based Banner + Dynamically Created Textfields + Loops
Hello everybody!
I have recently started a task, and have some difficulties with it right now. I literally got stuck with that! I'd appreciate if someone could look at my problem "with fresh eyes" and advise me on possible solution(s).

I need to make XML-based banner. XML file itself will contain from 5 up to 30 tags (childNodes). It is supposed that this XML file gonna be edited by the client, so the client can add/remove or change data (that is, quantity of ChildNodes).

I need to take the data out of XML and then display them (animated!) in a flash banner, five at a time. Firts five, then second five, and so on. If, for example, there will be 13 tags, that should be first 5, then second 5 and then the last 3. After that everything should start from the beginning (first five).

XML-file is like this:


Code:

<?xml  version = "1.0" encoding = "Windows-1251" ?>
<tariffs>
<tariff where = "Kaliningrad, Russia"  howmuch = "1,5$" />
<tariff where = "Khorezm"  howmuch = "0,2$" />
<tariff where = "Moscow"  howmuch = "2,5$" />
<tariff where = "Kiev"  howmuch = "0,4$" />
<tariff where = "Bobruysk"  howmuch = "0,3$" />
<tariff where = "Chirchik"  howmuch = "0,3$" />
<tariff where = "Tashkent, mobiles"  howmuch = "0,3$" />
<tariff where = "Magadan"  howmuch = "0,3$" />
<tariff where = "Almaty"  howmuch = "0,3$" />
</tariffs>


actionscript is as following:

first frame:

Code:

var indhold:XML = new XML();
indhold.ignoreWhite = true;
var destinations:Array = new Array();
var prices:Array = new Array();
var Format:TextFormat = new TextFormat();

Format.size = 11;
Format.color = 0xffffff;
Format.font = "tahoma";
Format.bold = true;

indhold.load("tarifi.xml");


second frame:

Code:

indhold.onLoad = function(success) {
    if (success) {
        var tarifiki:Array = this.firstChild.childNodes;
        for (i=0; i<tarifiki.length; i++) {
            destinations.push(tarifiki[i].attributes.where);
            prices.push(tarifiki[i].attributes.howmuch);
        }
    } else {
        trace("error loading xml");
    }
};

third frame:

Code:

import mx.transitions.*;
import flash.filters.*;

   
for (i=0; i<5; i++) {
        _root.createTextField("gde"+i, i+3, 16, 20*i+30, 200, 30);
        var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false); //this filter is added just for the sake of alpha tween
                                                                                                                                                           // which did not work without that!
        _root["gde"+i].filters = [ds];
        _root["gde"+i].text = destinations[i];
        _root["gde"+i].setTextFormat(Format);
        var nashTween = new Tween(_root["gde"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}
   
for (i=0; i<5; i++) {
        _root.createTextField("pochem"+i, i+33, 180, 20*i+30, 200, 30);
        var ds:DropShadowFilter = new DropShadowFilter(5, 45, 0x000000, 100, 1, 3, 0, 1, false, false, false);
        _root["pochem"+i].filters = [ds];
        _root["pochem"+i].text = prices[i];
        _root["pochem"+i].setTextFormat(Format);
        var nashTween = new Tween(_root["pochem"+i], "_alpha", Strong.easeIn, 0, 100, 2, true);
}
        var maskClip:MovieClip = _root.createEmptyMovieClip("opa", 200);
        with (maskClip) {
           
    // Draw a mask
            beginFill(0x667686, 100);
            moveTo(0, 30);
            lineTo(Stage.width, 30);
            lineTo(Stage.width, Stage.height);
            lineTo(0, Stage.height);
            lineTo(0, 30);
            endFill();
        }
       
       
        var myTransitionManager:TransitionManager = new TransitionManager(opa);
        myTransitionManager.startTransition({type:Wipe, direction:Transition.OUT, duration:3, easing:None.easeNone, startPoint:9});
        var myListener:Object = new Object();
        myListener.allTransitionsOutDone = function(eventObj:Object) {
        trace("allTransitionsOutDone event occurred."); // added just to catch the moment when transition is finished, though I am not sure that this is right way to do it.
                                                                              // i tried to begin second-five-items-display here.. and it did not work.
        };
        myTransitionManager.addEventListener("allTransitionsOutDone", myListener);

           
stop(); //added just to be able to see that things look like they should.



and now I got stuck..
how to get the next five nodes to be shown?
i did try to do that on allTransitionsOutDone event, removing old textfields and creating new with new .text values, but with no success... :(
another thing that i can't find out is how to check for the quantity of 5-items-sets already shown and how to calculate for the next 5 (or less) to be shown?
and finally, how to arrange that at the end the entire "show" begin again?

please point me out the directions! =)

View Replies !    View Related
Dynamically Import Fonts For Dynamic Textfields.
OKay here's my question: I want to make an SWF where I can dynamically alter the fonts based on another SWF containing the embedded font movie.

More Specific: I have a movie with dynamic textfields using a particular font (eg. Tahoma), now i want to change the font too another (eg. trebuchet).I don't want to have to recompile an SWF, just have this standard movie and based on Parameters I feed it, it will use 1 font. I'd like to be able to load a movieclip into my parent movie, containing that font embedded into it. This way I can use this movie as a sort of font plug-in.

Is this at all possible using flash?
DO I have to dynamically change the textfield properties first and set it to use a particular font and then load a movie clip wich has that font embedded wich will cause the paretn movie to use this font.?

Hope I don't sound too confusing.

View Replies !    View Related
[F8] Dynamically Created Input Text Field With Embedded Font
I'm creating a high score table for my game and I'm trying to mimic those arcade style high score tables with the scores on the right and the three letter names on the left. Everything works fine except for the line where you input your three letter acronym. If I try and get it to use the embedded font it wont work. If I comment out those lines it does work. If I don't comment them out you can't type into the text field, the I beam cursor shows but you can't type. I know the font is embedded properly because all of the dynamic text boxes are using it just fine.

In addition to this I was wondering if it was possible to replace the standard vertical bar text cursor with a horizontal bar kind of like would you would see at a dos prompt.

Here's my code:

code:
mc_HS.createTextField("name"+i,_root.mc_HS.getNext HighestDepth(), 153, 50+count, 50, 20);
mc_HS["name"+i].type = "input";
mc_HS["name"+i].maxChars = 3;
//mc_HS["name"+i].setTextFormat(lvltxtformat);
//mc_HS["name"+i].embedFonts = true;


It works with those two lines commented but doesn't if I uncomment them.

View Replies !    View Related
Dynamically Embedded Fonts
Hello,

How would I go about creating a simple flash application that can make use of "dynamically embedded" fonts which I provide through an XML file?
I have tried putting the fonts on a shared library on a fonts.swf file which then is loaded on a main.swf, so that textfields on the main.swf can use it (txtField.embedFonts = true), but to no avail.
Any help would be appreciated.

Thanks.

View Replies !    View Related
Dynamically Created Fonts Aliasing Problem
I have dynamically created text fields using Arial...the problem is that if a user's computer has "smooth edges" turned off, or their effects setting set to "Clear Type" the font has pixelated edges. Here's my code:

_parent.createTextField("mytitle",3,24,11,612,33);
_parent.mytitle.text="Natural Mojave Gallery Introduction";//*CHANGE*
_parent.mytitle.selectable = false;
_parent.mytitle.setTextFormat(ttl_fmt);

//Dynamic title formatting *CHANGE*
ttl_fmt = new TextFormat()
ttl_fmt.size = 24;
ttl_fmt.color = 0x65190F;
ttl_fmt.font = "Arial";

Any code I can use to prevent pixelation would be much appreciated! Thanks.

View Replies !    View Related
Embedding Fonts To Dynamically Created Textbox
Hi All,

I am working on a project in which I have created a dynemic Text box using :
_root.tmp.createTextField("dragbacktext0", _root.tmp.getNextHighestDepth(), 10, 10, 100, 100);

I want to embed a fancy font. I have html property as true. The text is coming in this text box from other input text box.
The input textbox's html property is also true.

But, the font did not loaded properly.

Any Idea ?

Thanks in Advance.

View Replies !    View Related
Embedding Fonts Into Dynamically Created Textboxes
Hi,

I want to embed fonts into dynamically created textbox. Is it possible..

What I want is that I am working on a project, where there it should load different languages in the text and different fonts.
The admin will enter the language and font and it will store in an XML. And I want to display the text in the same language and font.

How can I do this..... I don't have an idea where to start with.

Please help me if anybodyknows about this....

Thanks,

View Replies !    View Related
Dynamically Loading External Embedded Fonts
Everything I create has to be translated into multiple languages. We store all the text in XML, and the SWF loads a different XML based on the language setting. This works fine and keeps the translation department happy.

The frustrating part is with the embedded fonts. All textfields use styles loaded from an external CSS file. Which works fine, as long as the font defined in the CSS is embedded within the SWF. Because the fonts are embedded in the SWF and are not externally loaded, we have to make several published copies of the SWF for the different languages that need different embedded fonts, ie: chinese, japanese, etc. That way the english versions do not have to load an extra meg or more so that the chinese characters will show up if needed.

I've been exploring ways to have different external SWFs, for each language that needs different embedded fonts, so that the XML for each language would link a different embedded font SWF to load for that language. I've ran into many road blocks other developers have ran into and fear that the final conclusion is that it can not be done easily.

Ivan Dembicki came up with a way to make it work:
http://www.sharedfonts.com/eng/index.html

But, it can be a little tricky to get this setup and working properly.

Hopefully Macrodobia will add this in the next version.

Has anyone found other methods or ways to get this to work? please share

View Replies !    View Related
TextField And Dynamically Embedded Fonts Issue
I have an app that dynamically loads fonts at runtime. Most of my TextFields look perfectly fine, but a few of them don't display the text properly. On these, the text is displayed on top of the TextField, as if the top border were the baseline. What's more, when they are multi-line TextFields the text does not wrap (wordWrap is set to true). The strange thing is that there is no difference that I can see between the TextFields that work and the ones that don't. In fact, it is the same code that generates these TextFields (they are also dynamic).

When I set embedFonts to false it works fine, just with the wrong font, of course... so I believe it has something to do with this.

View Replies !    View Related
Problem Embedding Fonts In Dynamically-created (code-only) TextField
I've done some other AS3 code-only text fields before, but I think I'm missing something here. With the code shown below, my text shows up, and seems to have the right font embedded in it, but when I uncomment the line that sets the embedFonts property of the TextField to true, all the text disappears. Here's the code section (constructor function) where it happens:


Code:
public function Pflio() {
txt1.color = 0xFFFFFF;
txt2.color = 0xFFFFFF;
txt3.color = 0xFF0000;
txt1.size = txt2.size = txt3.size = _typeSize;
txt1.font = 'Myriad Pro Bold';

for (var i = 0; i < 9; i++) {
grid[i] = new TextField();
//grid[i].embedFonts = true;
grid[i].defaultTextFormat = txt1;
grid[i].text = chars[i];
grid[i].width = 50;
grid[i].height = 50;
grid[i].selectable = false;
addChild(grid[i]);
}
}


I've embedded the font with the Class name 'MyriadProBold,' and there's more code to import packages, declare class properties, set up the TextFormat object, etc., but hopefully what's shown above will let you spot what's wrong, if anything.

View Replies !    View Related
Why Do Embedded Fonts Blur When Non-embedded Fonts Dont?
If someone could offer a suggestion here I'd be much obliged. I'm trying to build a web site using pixel fonts but since very few people have this particular font, I'm trying to embed the font. The problem is that when I don't embed it looks perfectly sharp, but as soon as I embed it blurs them (as if it tries to anti-alias a pixel font.. which I don't want it to do)... any ideas?

View Replies !    View Related
How Do I Put A Dynamically Created Movie Clip Into Another Dynamically Created Mc?
I want to be able to have movie clip A to be inside movie clip B, but both movie clips should be dynamically created.
How should I do that?
is there a function for putting one movie clip inside another?

View Replies !    View Related
Actionscript Created Textfields
I am using Flash 7 and AS 2.0

I have a function as follows that formats a text field

private function setTF():Void {
txf = new TextFormat();
txf.font = "standard 07_55";
txf.bold = false;
txf.size = 8;
}

In another function I have the following code

createTextField("tx"+i, getNextHighestDepth(), 0, 0, 0, 0);
this["tx"+i].setNewTextFormat(txf);
this["tx"+i].embedFonts = false;
this["tx"+i]._y = startY;
this["tx"+i]._x = xspace;
this["tx"+i].selectable = false;
this["tx"+i].border = false;
this["tx"+i].background = false;
this["tx"+i].autoSize = true;
this["tx"+i].text = co[i].label;
this["bg"+i]._alpha = 0;

This code works 100%, however when I code the embedFonts=true then my text disappears in my text box? What is wrong?

View Replies !    View Related
Rotate Dynamic Created Textfields - How?
Hello all!

Need help to rotate some dynamic created textfields!

Here is my code:


PHP Code:




for(d = 0; d < runnerCount; d++) {
runnersTF = "runners" + d;                    
_root.createTextField(runnersTF,d,165+(d*110),20,110,20);    
_root[runnersTF].text = runnerName;
_root.runnersTF._rotation = 90;
}







In my actionscript book it says that for the _rotation funtion to work the textfield have to enclose the font. How can I do that dynamically?

View Replies !    View Related
Interaction With AS Created Movieclip Containing Textfields
I have a MC called textFieldsMC and it contains three textfields which has instance names, one of them is "tipsNamn", I'm just trying to pass a string to it but I cant get it to work



Code:
var tfMC:MovieClip = new textFieldsMC();
var cDepth:int = 100;
tfMC.name = "tipsFieldsMC" + cDepth;
this.textMoverMC.addChild(tfMC);

// this row is where I want to pass text to one of the textFields inside textFieldsMC100
this.textMoverMC.tipsFieldsMC100.tipsNamn.text = "test";

I just dont quite get the new debugger

View Replies !    View Related
On Rollover Fade Dyn. Created Textfields?
Hi all,

Trying to make my dynamic created textfields fade with an onRollOver.

I know the basics i.e. Dyn.
1 -Textfield in a MC and
2 - embed the fonts

So here is a part of my AS

ActionScript Code:
for (child = 3; child < count; child++) {
        //mc's holders for the dyn textfields
        holder = _root.createEmptyMovieClip ("mcLocationHolder" + child, 10 + child);
.....
.....
.....

//here my dynamic textfields
_root.holder.createTextField (["location" + child], 200 + child, 0, (67.5 * position + 20), 301, 47.5);
        with (_root.holder["location" + child]) {
//some format code
            multiline = true;
            wordWrap = true;
.....
....
}
//onrollover fade FX per holder
        _root.holder["location" + child]._alpha = 100;
        _root.holder["location" + child].onRollOver = function () {
            _root.holder["location" + child]._alpha -= 5;
            if (_root.holder["location" + child]._alpha <= 0) {
                delete _root.holder["location" + child].onRollOver;
            }
        };

I have embed the font by New font and linkage.

You guessed it, it ain't working. Any tips???

PS i see my textfield react on

ActionScript Code:
_root.holder["location" + child]._alpha = 100;

when i put embedFonts = true in my with () state

But the onrollover function doesn't work ;(

Grtz,

View Replies !    View Related
Dynamic Height In Textfields Created With AS
Hello people

Well, i'm working on a project of my office and need to create a textField with automatic height. You know that textfields need to apply a number on this way:


ActionScript Code:
_root.createTextField(instanceName:String, depth:Number, x:Number, y:Number, width:Number, [b]height:Number[/b]);

But I need that textfield have the same height of the count of lines of text and not a predetermined number.

Do you know if this is possible ???

Best regards and thank you for any help

View Replies !    View Related
On Rollover Fade Dyn. Created Textfields?
Hi all,

Trying to make my dynamic created textfields fade with an onRollOver.

I know the basics i.e. Dyn.
1 -Textfield in a MC and
2 - embed the fonts

So here is a part of my AS

ActionScript Code:
for (child = 3; child < count; child++) {
        //mc's holders for the dyn textfields
        holder = _root.createEmptyMovieClip ("mcLocationHolder" + child, 10 + child);
.....
.....
.....
 
//here my dynamic textfields
_root.holder.createTextField (["location" + child], 200 + child, 0, (67.5 * position + 20), 301, 47.5);
        with (_root.holder["location" + child]) {
//some format code
            multiline = true;
            wordWrap = true;
.....
....
}
//onrollover fade FX per holder
        _root.holder["location" + child]._alpha = 100;
        _root.holder["location" + child].onRollOver = function () {
            _root.holder["location" + child]._alpha -= 5;
            if (_root.holder["location" + child]._alpha <= 0) {
                delete _root.holder["location" + child].onRollOver;
            }
        };


I have embed the font by New font and linkage.

You guessed it, it ain't working. Any tips???

PS i see my textfield react on

ActionScript Code:
_root.holder["location" + child]._alpha = 100;


when i put embedFonts = true in my with () state

But the onrollover function doesn't work ;(

Grtz,

View Replies !    View Related
Aliasing TextFields Created With CreateTextField?
I have a clip that uses createTextField, supplies a couple values ::
_x:250,_y:200,_width:250,_height:25,html:true,border:true,font:'Bodoni Bd BT',selectable:false

i then insert the text into the field with htmlText=nameToShow;

problem is, the text is not alised, its jagged.

i've tried the previous solution which was to insert a dynamic textfield on the timeline with the same font and selecting the embedFonts option.

i've tried creating a new Font in the library and linking it to actionscript with the same identifier Bodoni Bd BT

I've tried creating a textFormat and applying it to the textfield

i've tried inserting the text through the text value instead of htmlText.


nothing seems to work, ideas?

View Replies !    View Related
Textfields/embedded Font In MX2004
I only have experiene in Flash 6, and would like to know what to expect before getting the new vers. and starting on my next project.

1. In flash 6 a dynamic or input text field couldn't be properly masked unless it had embedded fonts. Is this still the case for MX2004.

2. Because of the above problem, I needed to always embed all fonts... ballooning file size. As far as I could tell, there was no real way to load a new font during runtime into the active library of a swf. But I do remember coming across a link somewhere... some person/group was licensining some product that claimed to empower a swf to do just that with onsite examples.

Is the problem solvable in Flash MX? and how the hell could they have figured out how to make it work in vers. 6.

thnx in advance...

View Replies !    View Related
Listing Objects (TextFields, MovieClips Etc) Created In Authoring Time?
Hi!

I am building an application in flash that allows artist to design swiffs containing framebased animation and textfields or movieClips with textfields. The application will load the artists swf and then work as a tool for them to play the animations they created in the swf. It will also be able to fill the (empty) textFields with text.

The main issue here is that the artists know flash but not ActionScript so that is why the application exists. And that is why I need to, in some way, to:

* extract the frameLabels from the swf (I have read some articles on that)
* if the current frame is labeled check if there are any textFields on the stage and store their names in an Array
* if there are any movieClips on the stage check if they contain any textFields, in that case store the names of the textFields and the path in an Array.

If this is impossible I will need to create some application where the artists define all of the frame labels and all of the textFields and outputs it to xml. But this will make the workflow a lot worse for the artists.

Any suggestions or ideas?

/Andreas

View Replies !    View Related
How Dynamically Change The Image In Dynamically Created Row Of Images?
Hi everybody,
I am wondering if someone can help me to find out on how to replace the images in row of dynamically loaded images. I need on Press of an icon from the row of images replace the image of this icon to new one. Below is the code of creating the images row based on array and XMl data. I create an array based on data taking from XML.

Code:
var numOfImages:Number;
var thumbHeight:Number = 8;
var thumbSpace:Number = 100;
var thumbTotalDistance:Number = thumbHeight+thumbSpace;
var xCounter:Number = 5;
var thumbsCollectionHeight:Number;
var currentImage:Number = 0;
var moveOutDist:Number = 10;
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
var IM_Img:Array = new Array();
var IM_Title:Array = new Array();
//==================================================================================================================
//=============================== THUMBS IMAGE LOADER ==========================================================
//==================================================================================================================

var thumbImgLoader2:MovieClipLoader = new MovieClipLoader();
var thumbImgListener2:Object = new Object();

thumbImgListener2.onLoadProgress = function(target:MovieClip):Void {

};
thumbImgLoader2.addListener(thumbImgListener2);
thumbImgListener2.onLoadComplete = function(target_mc:MovieClip):Void {

};

//==================================================================================================================
//=============================== XML ==================================================================================================
//==================================================================================================================

var totalXML:XML = new XML();

totalXML.ignoreWhite = true;
totalXML.onLoad = function(success) {

var TNnode = this.firstChild.childNodes[1].childNodes;
numOfImages = TNnode.length;

//---------------- ATTACHING THUMBS -----------------
//===========================================================================================================

for (i=0; i<numOfImages; i++) {
var mc:MovieClip = imCollection_mc.thumbs_mc.attachMovie("mcThumb_IM", "thumb_" + i, i);
mc._y = 0;
mc._x = xCounter;

xCounter = xCounter+thumbTotalDistance;
thumbImgLoader2.loadClip(TNnode[i].attributes.thumb,mc.loader_mc);


IM_Title.push(TNnode[i].attributes.title);
imCollection_mc.thumbs_mc["thumb_" + i].mc_title.title_txt.text = IM_Title[currentImage];

mc.id = i;
trace (mc.id);

mc.onPress = mc_im_onPress;

mc.xx = mc._x;
mc.yy = mc._y;

}
};

//-------------------------------------------------------------------------
totalXML.load("images.xml");
Here is onPress event where I was thinking to add this functionality:

Code:
function mc_im_onPress() {

mcToSelect = this;

if(this.id==8){
//here I need to tell to replace the image from mc8 to new image from array to image#34 from xml
}
}
Any advice is highly appreciated. Thanks.

View Replies !    View Related
Problem With Loading Jpegs Dynamically Into Dynamically Created MC's
hey all. I got a problem with loading jpegs dynamically into dynamically created MC's. I've been using NEIL WEBB's tutorial on dynamic creation with event handling through the LISTENER component, which you can see here http://www.actionscript.org/tutorial...MX_2004_Part2/

I have slightly altered the script to accomodate the fact that I want to attach a movieclip with text fields and image holders within it, but the code aint too different I don't think.


Code:
stop();
myMCL = new MovieClipLoader(); //define MovieClipLoader
myListener = new Object(); //define listener
myListener.onLoadComplete = function(targetMC){ //set the onComplete function on listener
trace("targetMC = " + targetMC._name);
targetMC.onPress = function() { //define onPress within function

}
}
//****************************
function initClips(){
//trace(_global.gallery_cnt);
for (i=1; i<=_global.gallery_cnt; i++){
//trace("Attaching Clip - " + i);
this.gallery_TN_holder.attachMovie("TN_Holder", "TN_Holder" + i, i); //attach the movie
this.gallery_TN_holder["TN_Holder"+i]._x = (i-1)*90; //spacing
this.gallery_TN_holder["TN_Holder"+i].TN_Text.text = _global.gallery_array.description;
[i] [i]myMCL.loadClip(_global.gallery_array.main_thumbnail ,this.gallery_TN_holder["TN_Holder"+i].TN_Image);
//load images into clip
}
play();
}
//****************************
myMCL.addListener(myListener); //associate listerer with MCL object
initClips();
The first line ("trace") in bold outputs

Quote:




targetMC = TN_Image
targetMC = TN_Image




which you can see is resulting from the second bold line.

Basically I need some direction with this as to how to reference the clip target for the loaded JPEG, as my output in the movie shows the attachMovie works, as does the text change within the individual "TN_Holder" clips. What the hell am i doin wrong, cos my eyes are kinda starting to go kinda funny looking at this stuff!!!!!

Thanks for any help!

View Replies !    View Related
Dynamic Textfields And Fonts
hi,
i'm in the middle of a thing involving text loaded dynamically from xml files on which i apply a TextFormat()...
i need to apply bold on some part of it but the fake bold from flash doesn't work on the font i use and i was wondering if there was a way to apply another font (eg: the bold version of my font previously used) in the text...

View Replies !    View Related
Device Fonts Vs. Embedded Fonts
Hi there!

I have a little X-File I'm trying to figure out here. Any hints would be appreciated.

I have six SWFs. All of them have the same exact design. However, each of them has a different amount of text using an embedded font. The first one has about 3,500 characters (with spaces). The second one has aproximately 6,000 characters (with spaces). The third one has 14,000 characters, more or less.

The fourth SWF is just the first one, but using a device font instead. The fifth one is the second SWF with a device font, and the same goes for the sixth one.

All six SFWs can be scrolled down.

I've taken times. I've measured the time taken to scroll down the entire text in each SWF. All tests have been run down under Windows XP and with version 9 of Flash Player, and a 'high' value of the quality parameter.

I have read in the Flash documentation that device fonts are managed faster by Flash Player, as they don't use any anti-alias settings and its renderization lays down on the OS' font technology. Let me introduce the results:

First SWF (deviced one) has taken an average time of 0 min 59 s, 71
Fourth SWF (embedded one) has taken an average time of 1 min 12 s, 04

As guessed, it seems that device fonts are a little bit lighter than embedded fonts.

Second SWF (deviced one) has taken an average time of 1 min 36 s, 04
Fifth SWF (embedded one) has taken an average time of 1 min 52 s, 64

In this set of tests, we can appreciate a similar behaviour. But, pay attention...

Third SWF (deviced one) has taken an average time of 5 min 50 s, 81
Sixth SWF (embedded one) has taken an average time of 3 min 52 s, 60

Funny, isn't it? This set of tests just drives me nuts. One would think that results may be swapped, but, no matter how many times I try it, it always goes the same way.

Has anyone observed this behaviour before? Is there any known bottleneck in the underlying Windows Font Technology? Does it make any sense at all?


Thanks in advance!





























Edited: 04/26/2007 at 02:40:15 AM by josermae

View Replies !    View Related
Dynamically Masking Dynamically Created Text (MX)
I am having trouble dynamically masking dynamically created text... It just doesn't seem to work!! This is what i'm doing.

First i create a movie clip dynamically using attachMovie. On the first frame of that mci create a bunch of text fields, one after the other. When that finishes, i call a function in another mc that creates another mc and draws a box in it and then sets it as the mask of the first mc.

The result should be that only the text that is within that mask should show up, right? Well, the text doesn't mask at all, even if it is entirely beyond the bounds of the mask.

I read that it might be a problem with fonts that aren't embedded, so i set the TextFormat.embedFonts to true...


anyone have any idea??

View Replies !    View Related
[CS3] Can Static Textfields Have Multiple Fonts?
On compliling a movie, we are getting an error that reads :

two camps here: bad fontstoo many fonts in one static textfield
is suspect the later, but wanted to take this to the community. The file has multiple static textfields with different fonts in each field. For example, the text may ready" Hey, this is a textfield"-> the word "Hey" may be arial bold 19pt and the word "textfield" Helvetica Nue 25pt red.--but the entire phrase is one text field

Is this a no-no, or does it matter? FWIW, in my fla, these text instances in Helvetica Nue are black bars...not the actual text written in them

View Replies !    View Related
Css'd Textfields With Multiple Shared Fonts
I'm currently working on a project, where we've created swfs for each font we need embedding, and import them for runtime sharing. This works fine to actually embed the fonts, but by styling the textfield with external css, it doesn't seem possible to have more than one font in each textfield.

In the following xml snippet, you can see that different words for the line, have different styles. £1500, is blue, Interest free is black, and overdraft is green. But these also need to be Different fonts ie. NewsGothicBT Bold, NewsGothic BT Roman, and NewsGothicBT Demi, respectively.


Code:
<span class='overdraftAmount'>£1,500 </span><span class='overdraftInterest'>interest-free</span><br><span class='overdraft'>overdraft</span>
Does anyone know if it is possible to achieve this?

With the fonts embedded as I outlined previously, surely they should be available for the css to implement?

Is there a better way of doing this perhaps?

Thanks in advance for your time.

View Replies !    View Related
Custom Fonts And Dynamic Textfields
Ok so when i have a dynamic textfield, into which i load a txt file i used a custom pixel font in it, added the font to library and set it up in the textfield. It still doesnt show up in the swf. Whats the problem?

View Replies !    View Related
Custom Fonts And Dynamic Textfields
Ok so when i have a dynamic textfield, into which i load a txt file i used a custom pixel font in it, added the font to library and set it up in the textfield. It still doesnt show up in the swf. Whats the problem?

View Replies !    View Related
Dynamic TextFields And Shared Fonts
I read at the Macromedia website that there's really an issue regarding the shared fonts in Dynamic Textfields. If you tried it like me , you won't be able to render your text with the shared font.
Now, I've this website that's built all in Flash and every section is a different flash movie. My question is, what good techniques can I use to stop loading over the same font in every different flash movie?? This is really adding to the final size of the movies and it all summed up in the different movies, its taking me some extra 100-200k!!! That's a LOT!

View Replies !    View Related
Embed Fonts Dynamic TextFields ?
Embed fonts Dynamic TextFields ?

Hi all,

I'm attaching a movie from the library in which I'm creating a text field, the text field is then filled with text from an xml file.

I need to change the font used from the default sans so I'm trying to use the embed font = true with a Textformat object. I've created a font symbol in the library for the font I want to use and created linkage to Export for Actionscript. The font is called Font 1 in the linkage

With embedFonts = true; no text is shown, but if comment it out the text is there but in the default font.



ActionScript Code:
stop();
//
//
var holder = news_mc.holder_mc;
var mask = news_mc.mask_mc;
//
//
var gutter = 8;
var newsBlock = 50;
var news_xml:XML = new XML();
news_xml.ignoreWhite = true;
news_xml.onLoad = function(success) {
    if (success) {
        DisplayNews();
    } else {
        trace("Error XML not loaded");
    }
};
//
//
news_xml.load("xml/news.xml");
function DisplayNews() {
    var news:Array = news_xml.firstChild.childNodes;
    for (var i = 0; i<news.length; i++) {
        displayNews = news_mc.holder_mc.attachMovie("news_mc", "news_mc"+i, i+1);
        displayNews.news = news[i].firstChild.firstChild.nodeValue;
        //
        displayNews.createTextField("newstxt_txt", this.getNextHighestDepth(), 0, 0, 155, 20);
        newsTxt = displayNews.newstxt_txt;
        newsTxt.html = true;
        newsTxt.wordWrap = true;
        newsTxt.autoSize = true;
        newsTxt.htmlText = displayNews.news;
        newsTxt.styleSheet = cssStyles;
        //
        newsTxt.embedFonts = true;
        var test:TextFormat = new TextFormat();
        test.font = "Font 1";
        newsTxt.setTextFormat(test);
        //
        newsHeight = displayNews.news_txt._height;
        baseHeight = Math.round(dateHeight+newsHeight+gutter);
        displayNews.base_mc._height = baseHeight;
        if (i != 0) {
            prevClip = news_mc.holder_mc["news_mc"+(i-1)];
            displayNews._y = Math.round((prevClip._y+prevClip._height+gutter));
        }
    }
    holder.setMask(mask);
}
var cssStyles = new TextField.StyleSheet();
cssStyles.load("xml/example.css");
cssStyles.onLoad = function(success) {
    if (success) {
    } else {
        trace("not working");
    }
};

View Replies !    View Related
Embedding Fonts Into Textfields At Run-time
I am building something where the user could choose a font. However the textFields i am creating with this app are created in Actionscript at runtime. Have you any idea how to get embedded fonts to work within the textField object, when the font is actually external? Its bugging the living daylights outah me I need a WORKING example if anyone has one - ie, two files - one with an external font , and another with a textfield created at runtime that embeds the font of the other movie.

View Replies !    View Related
Smart Textfields For Pixel Fonts.
I want to create (or better redifine) textfield object that can be placed only on integer coordinates (may be with shift).

What i'm mean: as you know, text fields with pixel font can be placed only with integer x y cooordinates, else text in text fields will be blur-r-r-red For some fonts we need add fractional shift, if the text looks blurred in textfield with integer coordinates.

And finally some rules for those textfields:
1. Drawing by hand in the stage (design time) it must be snapped to the nearest integer coordinate when movie playing.
2. Added by script textfield must be snapped if some variable is set. Example - we unset snapping when dragging movieclip and set snapping when finished.
3. If textfield placed inside movieclip, that have fractional coordinates, we need correct textfield coordinates to global integer coordinases.

Is it possible to redifine textfield class, or i need attach event to all movieclips?

Sorry for my poor English.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved