ActionScript 3.0 :: Set TextFormat For TextFeild Dose Not Appear
Jan 26, 2009I have issue with TextFormat; when I set TextFormat for TextFeild .. dose not appear !! look at my class:) at the end line ...
View 6 RepliesI have issue with TextFormat; when I set TextFormat for TextFeild .. dose not appear !! look at my class:) at the end line ...
View 6 RepliesI do not know if this is possible but I want to use input field to program things on the stage.
I know if I do this
onEnterFrame = function() {
mars.text = onEnterFrame = function (){ my_mc._x +=5 }
}
it works...I was wonder if their was away to do that using input.
I can't seem to get this to work. I want my text field to be in arial. The format function is not working? Can anyone tell me where I went wrong?
[Code]....
again I have this textfield being generated in a loop, so there are many textfields created.I've added a format to the textfield, but on a click I want to change the colour of a specific textfield. I tried adding a new format to the object, but it won't work.
View 1 RepliesI dont understand how extend workes.. when i extend a class,will it replce that class entery point or will a class that extends another have "two" entery points? And can i pass paramters to the extended class?
View 3 RepliesIt used to be simple to access an object you put on the stage like a mc or dynamic text field by simply using _root.instanceName ect. Now I see references to making references to the Stage and such like:
private var stage:Stage;
stage = stageRef;
and I am still confused.
What I have going on is, I have placed a movieclip on the stage in Flash and gave it an instance name of Cell_mc.I have a cusom class that extends MovieClip with the following imports
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.EventDispatcher;
[code]....
This Class is tied to a set of MovieClips in my Library.
I have a listener: this.addEventListener(MouseEvent.MOUSE_DOWN,pickUp);
And a function:
private function pickUp(event:MouseEvent):void
{
this.startDrag();
[code]....
I get the following error whenever I try to access an object I placed on the stage from anywhere other than the document class:
1120: Access of undefined property Cell_mc.
How do I access the cell_mc that is already on the stage from this non-document class?
I have a strange problem
ActionScript Code:
checkLoad = setInterval (intervalOfLoading, 100);
function intervalOfLoading(){ [code]..........
works OK in Mozilla but dose not work at all in Explorer? How is this possible?
for swf integration in html I am using a swfobject.js
Specifically Im trying to make good use of some error messages by populating them to a TextField.
What I've done is to collect all the error messages in an array. I've been working on this for the better part of a day but I can't seem to get it to post as I'd like it. Im seeing the results but each result is in its own TextField. I really want them in one TextField that expands as they get added, each line being separated by a return ''.
I feel like Im close. here is what I've got:
Code:
var errorHolder:Sprite;
var errorArray:Array = ["Errors: "];
function extSoundError(e:IOErrorEvent):void {
[Code].....
Dose this encompass all manner of display,net and event classes
import flash.display.*;
import flash.net.*;
import flash.event.*;
i have created an animation and when saved in notepad as an html file everything looks as it should when previewed in any browser, however when i paste the code into my site via dreamweaver the animation dose not appear.
View 22 Repliesi'm trying to build this as3 buttons with labels for the OVER_OUT_CLICK tweens i`ve designed but aparently there is some problem because the button dose not act the same the first time you go over and out as the second time
[Code]...
I am working on a large project that displays a fair amount of text.how to best handle the formatting of the text globally? what is the best way to handle the text formatting on a global level ? Through the TextFormat class, through style sheets, a combination of these two depending on the specific situation ?
Is it a best practice for large projects to use style sheets for all of the texts ? Implying that all texts must be written with tags.Using only style sheets seems like the best approach at this time to me but before going into coding this approach on a large scale in my project,
my code is correct, but anyhow, anyway my textformat does not work, examine follow codeDidnt see what i did wrong.
//SCROLLING SPEED
var scrolling_speed:int = 2;
//TEXT TO SCROLL
[code]......
Im new to As3 and theres an issue thats driving me crazy. I need to know the name (or reference) of a TextFormat and I cant seem to do it.
Heres some of the code
ActionScript Code:
var f:TextFormat=tf.getTextFormat();
trace ("f.size"+f.size)
trace("****** "+f as String);
Basically I need to find the name of the textformat, which when I created i named like this:
ActionScript Code:
// for example "menuTextSmall"...
var nombreFormato:String = formatosXML.estilo[i].@nombre;
global.formatos[nombreFormato]=new TextFormat();
I have my formats in an xml file with name, attributes, etc. I can get the properties of the TextFormat but I dont know which TextFormat it actually is!!
I'm setting the style of a textfield selection like [code]...
I tried searching, but Google ignores brackets, so I can't search the output shown
I have an text field set as HTML and Im pulling in some text from XML and I can't figure out how to use textformat HTML tag with tabstops, here is XML:
ActionScript Code:
<![CDATA[<textformat>Name Surname Nickname</textformat>]]>
I want all to be separated like so(100px between Name & Surname and 150px between Surname & Nickname):
Name 100px Surname 150px Nickname.
How to do this? I guess I would have to do something like:
ActionScript Code:
<![CDATA[<textformat tabstops="100,150">Name Surname Nickname</textformat>]]>
I've created a price updater project to retreive the foreign exchange rate and reload for every 2sec. However, the exported swf only working under firefox and Chrome, but not IE. I had also tried to embedded teh font inside, but still not be able to work out
[Code]...
Forgive me if this is an obvious one but it has me a bit confused. I have the following sample:
Code:
import flash.display.Sprite;
import flash.text.TextField;
[code].....
This is a bit of code that lets the user click somewhere and type in some text. Everything in my code works except I can't seem to set the text format. It defaults to Times New Roman. Do I need to embed the fonts or something?
Code:
i = 0;
mcDraw.onPress = function() {
i++
[Code].....
...when i set the textField with new text eg:
var tf = new TextField();
var myFormat = new TextFormat();
//set textField format
[code].....
I have created a new textFormat for some dynamic text that is loaded into a textfield. Is there a way to change the style of the text when hovering over it?
View 2 RepliesI've recently started to learn/use AS 3.0 and am now exploring the use of external custom classes.I have an fla with a text field in place. I want to write an AS 3.0 class in an external .as file which sets a text format, and apply that format to the text field in the fla file - how do i so this?
View 2 RepliesI want the font size of a dynamic text box to change according to the number of characters of the input text. The user types in whatever (up to 50 characters long), then hits an update button to see it in the dynamic text box. But since the dynamic text can only be a single line within a defined area with no horizontal scrolling.
Here's the code I'm having a problem with:
Code:
updateBtn.addEventListener(MouseEvent.CLICK, updateIt);
inputText.maxChars = 50;
function updateIt(event:MouseEvent):void{
[Code]......
I must be missing something, but how on earth do I make it sothat I can set TextFormats for the whole movie and not just theframe the actionscript is on.My movie is basically a video with cuepoints that triggerdifferent keyframes that display text appropriate to what theperson featured in the video is talking about. In other words it'slike a powerpoint presentation that's run by an FLV file. Almostall of the blocks of text I'll be displaying are bulleted lists andsince, for some odd reason, bulleted lists aren't available usingthe standard Flash GUI text formating tools I need to apply themvia ActionScript. All the ActionScript is in its own keyframe atthe beginning of the movie timeline. I've setup my text formatingcode like this:
var bulletlist:TextFormat = new TextFormat();
bulletlist.bullet = true;
bulletlist_field.setTextFormat(bulletlist);
While I have successfully applied this to a box of text onthe first frame of the movie, I haven't be able to apply it to texton any other keyframe. So from what I can tell, I have to referencethe above TextFormat actionscript for every frame I need to use iton, and since I can't have duplicate TextFormat values, that meansI'd have to create a new instance with a new name for each frame.This seems rather inefficient and frankly ridiculous consider thatthe other ActionScript that I wrote seems to apply to the wholemovie. And what's the point of using ActionScript to format text ifyou have to redo it for every *******' keyframe? Is there somefunction that I'm missing somewhere to allow me to use one set ofTextFormat code on multiple frames or is this simply a dysfunctionof Flash and/or ActionScript 3.
I am using the setStyle to set the text label on some buttons in flash. AS3.Set font to bold and color to red. myButton.setStyle ("textFormat", redBoldFormat);I do this on as part of a function when the button is clicked.Is there a way to retreive the textformat settings (like bold, etc) so I can un-set the format? I have 5 buttons, when one is clicked, it goes bold and red.When a different button is clicked, I would like the previously clicked button to go back to "not bold" and "not red" and so on,
View 1 RepliesIn my movie, I have a dynamic textfield on the timeline starting the first frame and going to the end. At various points during the movie, I change the text in the textfield (and that works just fine), but I also want to change the font-size when I do that. I've tried using setTextFormat to a different TextFormat object, but that doesn't seem to work. Maybe someone has a better idea?
[Code]....
According to the ActionScript 3.0 documentation, the TextFormat classes size property is an Object. Why is this? Clearly this is a number! When I check its type (using typeOf()), it returns Number. So whats the deal?
View 3 RepliesI'm using TextFormat to format a text field and I've noticed that, while there are properties for leftMargin and rightMargin, there are non for top and bottom margins. Is there any way to add some padding to the top and bottom of a text field? My text field has a background color, and right now the text is flush with the top and bottom edges of the box, which looks ugly
View 4 RepliesI create a TextFormat variable like so:
ActionScript Code:
textBox1_fmt = new TextFormat();
textBox1_fmt.color = 0xFFFFFF;
textBox1_fmt.size = 22;
What I would also like to change though is the font family to Lithos Pro and set the alignment to the right. Do you need to embed the fonts? If so, then how?
I then draw a TextField onto the screen like so:
ActionScript Code:
textBox1_txt = new TextField();
textBox1_txt.text = "example";
[Code]....
otherwise it reverts to some default setting. How can I change this default setting?
So I'm experimenting with using XML in Flash, but I'm confused as to how to use the properties in an XML tag and assign it to a TextFormat property.
My XML:
Code:
<mytitle fontsize="100" fontface="Tw Cen MT">Embracing the Zeroes</mytitle>
I know how to access the fontsize property's contents, like so:
ActionScript Code:
var myTitleSize = myXML.mytitle.@fontsize;
And I'd like to use it this way:
ActionScript Code:
var myFormat:TextFormat = new TextFormat();
myFormat.size = myTitleSize;
But it doesn't change the property in my output SWF...