ActionScript 2.0 :: Insert Text Before And After Selected Text?
Feb 19, 2009I need to insert "<b>" before and "</b>" after the currently selected text in an input textbox.
View 2 RepliesI need to insert "<b>" before and "</b>" after the currently selected text in an input textbox.
View 2 RepliesWhen 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.
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...
View 6 RepliesI have created a form consisting of several input text fields. My question is whether there's script to evaluate which text field is currently selected.
View 2 RepliesHow do I to make a function that replaces the selected text in text INPUT on the symbol of the selected one from each list?
View 2 RepliesI have really no idea how to do this, but i have a textbox and a button.When this button is clicked, i want it to add "<b>" before the currently selected text in the textbox. How would i go by this?
View 1 RepliesFlex's text-editing controls (mx:TextField, mx:TextArea) offer functions for doing "stuff" with the selected text (selectionBeginIndex, selectionEndIndex, setSelection), but the text-displaying controls (mx:Label, mx:Text) don't seem to offer anything of the sort.After some tinkering, I've tried subclassing Label then writing functions which give access to the underlying TextField instance... But even then, setting the selection didn't work![code]So, is there any better way to access/change the text which is selected in mx:Label and mx:Text controls? Are there "better" controls to use?
View 2 Repliescan you please help me with this issue the String class does not have insert method it has only replace :( .
what I need is:
- if I have string "I stackoverflow"
- I need to insert "love " at index 2 to have "I love stackoverflow"
so what I need is insertAt(index, String)
i want to insert graphic ( icon ) in text box.
View 3 RepliesI have a Question that is how to paste the selected or copied text on stage or text area in flash as3? I had copied text but don't have any idea about how to paste the text into text field.
View 3 RepliesI'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.
View 2 RepliesI'd to insert date on a richtexteditor when the user click on a button.This part is easy, more difficult, how to insert this on cursor position. Cursor position may be on the beginning, middle or end of the text.
View 1 RepliesI think that arrays are probably one of the more powerful tools available in flash,
mc with instance name but0
inside mc is a text box var name label , code is
[AS]label = _name;[/AS]
mc on main timeline code in frame 1 is:
subjects = new Array("page1","page2","page4","page4","page5")
butHeight = but0._height+5;
butNumber = subjects.length[code]....
What this code does is produce 5 buttons appearing one after the other, like a cascade effect, so far so good, I then want to insert the array elements into text box label, but all I get is subject, subject1, subject2 and so on.So, what do I need to do so that my buttons are called page1, page2 and so on.
So I have extended my textfield so I can add a some text, a style, an x and y position.
var clientText:MyTextField = new MyTextField("Client:", "style1", 75, 60);
addChild(clientText);
The problem is the text is starting to get a bit long and I need a way to insert large amount of text neatly. I don't really want to use xml I would prefer to just have it in the ide like in the attached image. However formatting it in this way gives me the error
I have a combo box and I am using the 'selectedIndex' property to give it a default value (a value that is at the first(0) index). Setting this property in my ActionScript does select the value in the dropdown but it does not add the selected value to the combo box's text area. How do you do this? I make has no affect on the text area.
Here is a sample of my code. The combo box list is populated fine. And the value is selected IN THE LIST. However, once you select a value in the list the combo box's list closes and nothing resides in the combo box's text field.
comboBoxData.insert(0, {data:1, label:"Show me something specific"});
for (i in animations) {
comboBoxData.push({data: i.uri ,label: "somevalue"});
[Code].....
I want to show a PDF in browser, from which user can select text, showing pdf is very easy i have done this using "pdfviewer" control, now i want to get the selected text which the user selects in the PDF, is there any way to achieve this?
Edit: If there is a flash/ flex solution at the client end that will as well, does anyone know about it, i tried one API, but that dint seem to work
my code is
var cMenu:ContextMenu = new ContextMenu();
cMenu.hideBuiltInItems();
[code].....
In actionscript, is there any way to format the input text so that a dash or space is inserted after a set number of characters? So instead of xxxxxxxxxx
you get xxx-xxx-xxxx
I'm trying to create text using html so I could format it in html.So I created a textbox, gave it an instance name, selected "Dynamic Text" and clicked "Render text as html".When I click F9 (to get to the Actions Panel) to insert my html code, I get the message "Current selection can't have actions applied to it".How do I insert html into the Actions Panel to format text?
View 3 RepliesHow to set focus and insert caret in an empty text field in AS3
View 3 RepliesI'm attempting to put together a 'French Accents' keypad (basically a few buttons that insert a French character into a textfield when pressed). At the moment im having the following issues with it:
The french characters always appear at the end of the string despite where the cursor is focused.
I can't get the cursor/caret to focus after any letter generated by a press of a button rather than a keyboard input.
Here is my current button code:
ActionScript Code:
on(release){
//The getCaretIndex method returns the index of the blinking insertion point (caret) position.
[Code]....
is there a way i can extract a MC and a text field from flash and insert into MS word? i have to insert it as a picture and text seperately. is there a way to do it?
View 2 RepliesOn the website I'm currently working on:I'm running into a problem with my flash pages. If you click on About Us from the menu, on every computer but mine the About Us header at the end of the animation shows up as regular text and not the style I used.Here is a screen shot of what it is suppose to look like:on why this would happen? I thought it may be because the font wasn't installed throughout, but it's the same font as "embrace hope' which comes up fine.
View 2 Repliesi'm having some trouble with an actionscript-generated ComboBox here's my script
[Code]...
If i open .as file (or something else) in Notepad++ and select any variable or some other text, it will highlight all of the occurences of this variable in text of this opened document. And you can quickly see where this variable have assignemnts and so on. But in Flash CS3 i can only use standard Find dialog to search throug opened .as file and it finds only one occurence, then you hit "Find Next" and you've got another. Not so comfortable. So does that feature exist in Flash CS IDE, or something similar? (i can't find that)
View 1 RepliesI've got some dynamic text where certain lines will select (via setSelection) upon clicking.how to turn this selected text into a stored string I can then parse into usable sections.What methods could I use to get a selected text into a string?
View 2 RepliesI'm listening for KeyboardEvent.KEY_DOWN and I don't want the function to start if I am editing a text field. How would I achieve this?
View 2 RepliesSo.. all I want to do is to have a toggle button which changes label color to #999999 when selected. But for some reason i cant get it to work
This is my code for the button:
Code:
package components.main_content.submenu.submenu_link
{
import components.NoTruncationUITextField;
[Code]....
I tried assigning it with CSS (text-selected-color) and failed, i tried putting <mx:SetProperty target="{textField}" name="textColor" value="0x999999" /> in my skin class in all "selected" states but it worked only when run (one of the buttons starts as selected).. as soon as i ran my mouse over it or clicked another button it reverted back to the original color.
I have a series of buttons that when clicked will enter a character into a dynamic textfield. Here is my code:
on (release) {
//if the focus is on the answer text box
if (_root.answerFocus) {
[code]...
This works but I dont know how to get round the following issues: Once a button is pressed the cursor moves out of the textbox once the character is placed inside, each character always goes to the end of my text line (as += implies but I can't find a workaround).
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.
View 1 Replies