Is there a way to take out a part of the text in a string? Like start 7 characters inti the string and end 2 from the end of string. Something like: string="hello how are you today?"; So when done weare done with it the things left in the text is: "how are you toda".
I'm building an ActionScript program in which I need to insert text into another string at random positions.I have the text which strings will be inserted into; and I have the strings which will be inserted as an array.However, I don't know how to go about inserting the elements of this array into the other string at random positions.
If I want to align things vertically in a container, I'll use verticalAlign="middle", but this doesn't exactly solve the problem of truly aligning text vertically. Text is always too high vertically, so in the past, I've just adjusted paddingTop and paddingBottom to compensate, but that doesn't work as the font for _sans differs from operating system to operating system.
Given the following layout code, you'll see the problem:
What happens is pretty clear. The horizontal line gets aligned to the exact middle of the box, but the text is offset by some arbitrary amount. I assume that this is because of the text baseline alignment or something. Is there a way to fix this regardless of the font size and face? I'd like to have the line essentially go right through the middle of the text, ignoring the extra space possibly needed for below the logical line of text (ie: ignore the bottom part of "g's" and "j's" when laying things out).
I want to add another short string inside it... (for example : 01 or something). But this short string always has to apear just before the dot, like:
image01,jpg picture01.jpg photo01.jpg
I already found out how i can add a string inside it... but when the first string is longer the second string ofcourse doesn't show up on the right place..
i have few button to let user click and the symbol will insert into the input text. i change my input box to 'symbol' but i facing the problem that i can't insert character other than symbol...
I want to programmatically insert formatted text at the current cursor position in a Flex 4 (Spark) RichEditableText control. I could just modify the .text property But that doesn't allow me to insert formatted text. So I believe I need to interact with either .textFlow or .textFlow.interactionManager somehow? However, TLF is quite complex and I can't find a simple way to do what I want.
How do I insert a hyphen in a hardcoded string that is the label of a button? Do I need to format it as html? Same question re: forcing a break in a line of text. is there a way just with ActionScript?
I am trying to dynamically address different instances of the same movieclip by passing a string into the movieclip address, but apparently I don't know what I'm doing. I'm trying something like below:
var vsTargetName:String; vsTargetName = "instance50"; vsTargetName + vsThumb.thumbHighlight.visible = true;
Is something like this possible? What am I doing wrong/what do I need to do to make that work?
I neeed to insert spaces in front of capital letters in a string. the string contains the name of a country instance for example demRepublicOfCongo. I would like to scan the string and inset spaces before each capital letter so that the contents of the above string would become dem Republic Of Congo, for eaxmple.I found some code that It is posted below.
//Works out country name from string var country:String=counrtyinstance.replace("_mc",""); var re:RegExp = /(?<=[a-z])([A-Z])/g;
I simply want to insert a space before any capital letters in a string:So if I have "BruceWillis" I want to convert it to "Bruce Willis" . I am inserting the space before any caps, except the first capital letter.
I'm creating Flash-based software that has text boxes where users write in the answers to questions. I want the text that the user types to be vertically aligned to the middle of the text box, so that even if the response is two or three lines, it is still centered in the box.
It doesn't appear that I can accomplish this through the properties window in Flash. Am I missing something? Or is it possible to set the properties of the text box with actionscript, and would that allow me to vertically align the text?
When I create a TLF text area that is editable at runtime (which means that it can get a user input at runtime) I set the text direction to the 'right-to-left' definition in both the 'container and flow' and the 'paragraph' sections and set the language for Arabic or Hebrew at the 'locale' setting. I also set the text alignment to the 'align to start' mode. Now at runtime there's a stange thing. When I try to click with the mouse cursor on the editable TLF text-box, it's not displaying the text icon cursor and don't allow me to insert text inside.
But when I move my mouse cursor over the right side of the editable TLF text box, it change his appearance to the familiar text cursor which indicate that if you click here you will be able to insert text input inside. So my problem is how can I make it that only when I will hover over the TLF text box itself, the mouse cursor will be changed to text cursor icon and when I will hover beside its right side, it will remain at the normal cursor mode.
how can i middle a text in the Textfield that is 100px by 100px so that when i have 1 line its in the middle, when i have 2 lines its in the middle as well check attachment. when i do it right now it is always on the top i basically would need the same as when i have a HTML table by default so it is horizontal in the middle.
I have a problem with truetype font "DaxComp-Medi" and with some timeline and actionscript positioning. I have a mc in which I have another mc in which I have a circle in which I need to put the text in the center but that is not that easy.
Structure:
ActionScript Code: mc1.mc.mc.txt mc1.mc.mc.circle
[Code].....
So is there some way in as3 to get those numbers in the center of the (white) circles?
Do I need to convert the TextFields in to the BitmapData (how?), find positions of pixel that has some black color (How?), draw rectangle with that information, copy x and y point of the rectangle, center the rectangle in the circle, calculate offset x and y from the rectangles new position and add them the textfield x and y?
I am willing to use Macromedia Flash this year to make my physics project. Well, its going to be force resultant calculator. for ones dont know how it gets counted.
Well, I'll make 4 input text boxes, and a button in the middle. 1 text boxin the north, (power effect the body from the north) one on the south, one on the east and one on the west.(I've done that part).
Then, ill need it to subtract the north - south and east - west on(release), and display that on a dynamic box called Fx (east - west) and another called FY (north - south) Finally, I'll need it fethagorth the Fx and FY to give me the final force resultant. I've done the 4 input boxes and a button, I'll still need someone gimme the action script for subtraction and fethagorth (or atleast teach me how to do it).
I want to add a newline to a string text and I was wondering if there is a newline constant in actionscript 3? For example in .net there is an Environment.NewLine that is a string, containing " " for non-Unix platforms, or a string containing " " for Unix platforms.
I have a list control in a component mxml file. I have created a function in main mxml file, I want to input a text string and add it to this list. How can I do that. Currently using this code public function add(event:MouseEvent):void { var name:String = mytextinputid.text; currentState = 'ChatScreen'; mylist.____ } Note that this function is in main and the mylist list control is in component mxml.
I need to make the "rcheck2_txt" rotate 180. With this script it does what I need. But currently the centre point is in the top-left corner of the dynamic text box. How do i change the X Y cordinates so the centre point is in the middle of the dynamic text box?
I made an effect in swish and i saved it in to an swf file i want to load that swf file in to my flash movie in the middle in which i have some text's and pictures
I am about to start a Flex project. For the GUI, I'll follow the Cairngorm 3 guidelines and use (most likely) Parseley. I have experience with Grails, Spring, Seam and also have played with PHP. So, which one of these framework has a better integration with Flex? By "better integration", I mean, in the order of importance, coding-friendly, documentation, maturity, size of community (of the integration framework/library), support.
I want to use an HTTPService to load some data (number of columns and number of rows) which change randomly by a certain frequency I get the string like freq#ncols#nrows#value. How can i display for example: 1000#21#13#2391 that means: in 21 col, 13 row i have the value of 2391 which changes every 1 second.