ActionScript 3.0 :: Using FONTS For Dynamic Textfields?
Sep 12, 2011What is difference between Using Device Fonts and Using Embedded Fonts for dynamic textfields?
View 3 RepliesWhat is difference between Using Device Fonts and Using Embedded Fonts for dynamic textfields?
View 3 Replieshow to embed fonts as for some reason i can get the font im using to show up Here is the script i used to create the textfields:
[Code]...
as you can see from the 2 images i have put up with the fonts active on my system e.g font_on the text is ok but with the fonts turned of e.g fonts_off i get a different text even thou the fonts are done addressed in my script.
What are the methods to make fonts in a Dynamic textFields more sharper?This code won't show the text field using the embed font type?
this.createTextField("scroll_txt", this.getNextHighestDepth(), 0, 0, 0, 0);
this.createTextField("newszlatest", this.getNextHighestDepth(), 556, 170, 355, 290);
newszlatest.multiline = true;
newszlatest.wordWrap = true;
[code]....
I've got a couple of TextField initialized in code (as3). They use my embedded font (aharoni), and that just works. But the fonts that i've written directly into the movieclips in flash cs3, just don't work.
When i play the swf on another computer that doesn't have aharoni, the coded TextFields are aharoni, but the textFields in the movieclips that i've written directly are Times new Roman, because that computer doesn't have Aharoni.
I've set the text font to my embedded font.
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:
[Code]...
why are the dynamic textfields selectable? The textfield is inside a movieclip. Once the clips are attached, why can they not act like buttons?
ActionScript Code:
xmlData = new XML();
xmlData.ignoreWhite = true;
[Code].....
2 of my external swf's use dynamic text fields, they call into my index fine but when the code says delete that movie all but the dynamic text fields are deleted. The links that have these text fields are the Cart and Contact Us. [url]...
View 3 Repliesso i want to have my dynamic text listed with a consistent space between each textfield. However, the textfields can have varying amounts of text, so just doing txt.y = t*40 would not cut it. I've tried getting txt.length to calculate how many lines it would be, but if i change the font size it changes everything.
View 2 Replieslet's say you had a dynamic text field with a number (for example '30'). Everytime you click on a certain button / movie clip, that triggers an animation (so far no problem) AND adds '20' to the number in that textfield.
==> first click, the number displays 50 (30+20), second click 70 (50+20) ...
When you enter a certain keyframe and that number is higher than let's say 290, the movie jumps to frame x. If that number equals 290 or is lower than 290, the movie jumps to frame y.
I have 3 textfields. they're in a sprite container. 1. date 2. pipe_mc movieclip 3. title field. I need to set it so that the textfield/mc/textfield;s x property changes dynamically when a shorter or longer date gets added into the field, via XML.
[Code]....
This is about a self assessment quiz.There will be four options and each one has a scale from1-5 i.e., "option a" has 1mark, "option b" has 2marks,"option c" has 3 marks, "option d" has 4marks and "option e" has 5 marks and we count the answered and we display the score for example if there are 20 question in it if they answered "option e" 5 times the score will be 25 and option d 5 times the score will be 20, and if "option c" for 5 times the score will be 15,and "option b" for 3 times the score will be 6 and "option a" two times the score will be 2, and we add up all the score and display in a dynamic text field called "score" and the total score is 68.
And I have another dynamic text field called "tsc" where I have to display the tags like excellent , good, better ......etc. Till now every thing is fine but I am unable to compare them it is displaying excellent even if i get 10 marks. If the score is greater than 55 "tsc" should display Excellent, if the score is greater than 41 or less than 55 "tsc" should display Best, if the score is greater than 26 or less than 40 "tsc" should display Better,if the score is none of the above "tsc" should display Poor.
This is my code on the submit button:
on (release) {
gotoAndStop("sQ");
if (scor>=55) {
tsc = "Excellent";
} else if (scor == 41 && scor<=55) {
[Code] .....
Where:"sQ" is the frame name where i am displaying the score details"scor" is the var name for the dynamic text field for displaying total score"tsc" is the var name for the dynamic text field for displaying the tags llike good, Excellent, better, poor.....etc.
I want to populate the stage with a list of dynamic text fields with individual names, something like pg4_txt1, pg4_txt2, pg4_txt3. I'm a novice at flash, I tried creating variables with a while loop, but I just haven't got the grasp of it.
Here's some kind of weird pseudo code to explain what I want to do:
var leading:Number = 15;
var i:Number = 0;
while (i<14) {
[Code].....
I have a few textField objects that are created dynamically with XML. I want to space them evenly horizontally, how would I do that? So far this is all I have, but it does not account for different character lengths per textField.
Code:
for (var i:int = 0; i < xmlList.length(); i++) {
var tf:TextField = new TextField();
[code]........
In my project, several textField mclips are created dynamically. These mclips pull their content from an XML from.
The text is formatting partially using TextFormat, but I have been unsuccessful setting the font family.
I think this is because the content is dynamic and called from the XML.
In any case, I then tried to set the font family using mx.styles, but also with no luck:
import mx.styles.CSSStyleDeclaration;
var text_style:Object = new CSSStyleDeclaration();
_global.styles.myStyle = text_style;
[Code].....
I make a dynamic textfield, specify it's instance, then assign it a string or variable with AC, but often the dynamic text will not display all the text or variables. For example, I say
warning.text = "Please do not enter more info than necessary.";
Yet what appears onscreen, is:
"lease do not enter more ino tan neesary."
This happens no matter how big I make the text area, or how small I make the text, so I don't get why it's not all viewed. (Btw When I copy from the textfield I do get all the text)
I'm creating dynamic buttons, I'm using textFields to make them.I have a problem with the text on them.I want the text to wrap, autosize and be multiline - ie I want the button to be a certain width and if the text is longer for a particular button the button will be higher with the text going onto the next line.Here is the code I'm using...
c._y = 40 * i;
c.createTextField("chap" + i, i, 10, 100, 150, 35);
var tf = c["chap" + i];[code]....
I have flash file with 5 dynamic textfields which reads everyday from an array 365 (year) inside the file what I want is to read from an xml file instead.
The first layer contains this code the arrays:
function make365() {
arr1[49] = "05:30"
arr2[49] = "12:35"
arr3[49] = "13:10"
arr4[49] = "15:55"
arr5[49] = "18:20"
[Code] .....
The stage contains 5 dynamic textfields each one named respectively quote1 ,quote2 ,quote3, quote4 and quote5. How can I make the function 365() reads from an xml file instead.?
I am making some progress with an interactive poetry projectearlier.Unfortunately I have another problem which I can't seem to solve. In the project I create 49 textfields in a 7x7 grid. The properties are stored in an array. The code I have to do this works as intended.
var instances:Array = [];
for (var i:int = 0; i < 49; i++) {
var j_inst:TextField = new TextField();
[code].....
I'm having an issue with a particular font where, when using dynamic textFields the kerning is all out of whack. When using static textFields, it's fine, and when I check "Use Device Fonts" it's also fine, but when using dynamic textFields with embedded fonts, everything is jacked. The font is Blender Pro Bold. Regular and Heavy work fine, but for some reason Bold is messed up. Is it just that there is a problem with the font?
View 1 RepliesI have a project with 4 movie clips. Inside each clip there are dynamic textfields that read xml-file. My intention is to view each clip(alpha 100%) for 10-15secs at a time. My question is how can I view only the clips that have content in their xml?
Lets call the movie clips mc1-4. If I only have text to view in the first two mc's how do I construct some sort of IF structure:IF mc3 doesn't have content to view, view mc1 instead of it and then mc2 and so on.
All the movie clips read the same xml-file they just view different content from it. For example: mc1 reads 10 first nodes(with its childs), mc2 reads 11-20 and so on. That is why I want to know because it is stupid to show empty tables.
Im having is that I cant update the information that I get from my XML file at runtime. I have some static textfields that updates just fine, but it�s the dynamic ones that don�t play nice.
The project is a small display that shows the amount of minutes that is left from the time set in the XML to the current time. I don�t want to bore you too much with the details of it all.
Heres the code! Right now though it doesnt update at all. Removed those bits of code since it got me nowhere
Code:
var container:Sprite = new Sprite();
bottom_mc.addChild(container);
var loader:URLLoader = new URLLoader();
[Code].....
I have mc1 which contains code to dynamically generate multiple textfields based on an xml file, but mc1 has nothing physically on its timeline. I want to make another mc, mc2, where its y location is relative to the height of mc1, but when I trace the height of mc1 it returns 0.
Is there any way to get a height based on however many textfields are dynamically loaded into mc1? The height will naturally be varying so I can't just create a variable for a constant height.
im working on a website with a fullscreen toggle feature.On one of the page i got a textfield that gets all the text from an external xml file.I created a custom scrollbar that will allow scrolling for the textfield.Im looking for a way to disable to option of mouse wheel scrolling.When i publish the movie and use the html file it doesnt allow mouse scrolling but when i go to full screen and i try to scroll using the mouse wheel the textbox is scrolling, the problem is that my custom scrollbar isn't. is there a way to make sure that the scrolling will be disabled at all time ?
View 2 RepliesHow can I embed some characters one time, and have them embedded in all my dynamic textfields?
View 2 RepliesI have a series of dynamic textfields added to the stage via this code:
ActionScript Code:
function addTextfields(){
initTextfields++;
var question:TextField = new TextField();...
question.type = TextFieldType.INPUT;
quesTextArray.push(question);
addChild(question);
question.addEventListener(FocusEvent.FOCUS_IN, handleFocusIn);
question.addEventListener(FocusEvent.FOCUS_OUT, handleFocusOut);
}
Using FocusEvent, I want to add a UIScrollbar to that event.target TextField. Here's what I have (that's not working):
ActionScript Code:
function handleFocusIn(event:FocusEvent):void{
var mySb:UIScrollBar = new UIScrollBar();
mySb.direction = "vertical";
mySb.setSize(20, event.target.height);
mySb.move(event.target.width+event.target.x, event.target.y);
addChild(mySb);
trace(event.target);
mySb.scrollTarget = event.target;
}
My dilemma is with scrollTarget, I'm not sure what the actual target should be. I thought event.target would do the trick but I get a 1118: Implicit coercion error. When I trace event.target I get [object TextField] so I thought that's all I would need to do.
I cannot get dynamic text fields to display when using a mask. Here is what I have done: Created a new Font object in Flash - Linkage: Export for Actionscript , class: Euro
[Code]...
I got some dynamic textfields in my flash movie loading html-formatted text. it works fine.but my boss tried it out in a Macintosh and sent me a screenshot where I could see that there is a shorter distance between the lines and a shorter distance between the characters.
How can this be? Macromedia claims that Flash looks the same in all platforms.[URL]
Mouse.hide doesn't work when rolling over the link.try this code and roll the mouse over the link:
Mouse.hide();
createTextField("tf", 100, 0, 0, 200, 30);
tf.html = true;
[code]....
Is it possible to somehow include smileys in dynamic or input textfields in flash?
View 4 RepliesIm attempting to display xml generated text in 2(or more) dynamic textfields. One textfield under the thumbnail and 2 or more textfields next to the large image that loads.Ive posted an example where I put text in the dynamic text fields just to show location and how it should work:[URL]
I keep getting undefined errors. I've made minor adjustments from the original source: [URL]I think the error might be a typo. Ive pasted the AS and you can click the link for the zip if any want to take a crack at this issue: [URL]
----------------ERROR I KEEP GETTING----------------------------
1120: Access of undefined property arrayThumb.
1120: Access of undefined property arrayThumb.
1120: Access of undefined property thumbsDescription.
[code]....