Text In Field Selected On Click
Hey guys, I did a quick search on here and didn't find what I was looking for (maybe I missed it) What I want to do is set up a text field with "enter email here" Then I want to set it up so that when the end user clicks inside the box it selects all of the text. This way all they have to do is click in the text box once and start typing. I know the html equivilent is:
Code: onClick = "this.select();"; in the text field... how can I do this?
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-06-2005, 02:34 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Show That An Input Text Field Is Selected..
Hi
How can I show that an input text field is selected when _focusrect = false; and I am using flash lite.
When the input text field is selected I want to change it's border color or show a shape... something like that or even the text color.
Text Field + Remove The Green Color When Selected
hi all,
i use macromedia flash mx professional 2004 i have some text field on the scene when i tab to one of them, the one who get the focus, have a green small effect at the border. how can i remove this effect;
thanks
Clearing Text Field On Click
Hi,
Is it possible to clear the contents on a input-dynamic text field when the user clicks to enter text instead of having a button to do so????
Kind thanks.
Click The Text Field Before The Focus
Code:
stage.focus = myTestField;
This code focuses the cursor but how do I made some code click the text field before the focus?
Regards,
Glen Charles Rowell
Text Field Not Changing On Click
In a dynamic form I have created, I have three buttons for colour 1, colour 2 and colour 3. When the button is hit, a large graphic changes in a MC, a small graphic changes and the input box with instance name "interior_colour" is supposed to change it's text to "Colour X". However, once the first button has been ht (no matter which of the 3), all the graphic changes, but not the text, it just stays the same ...
The actionscript I have on each button is...
on (release) {
//load Shape Text
interior_colour.text="Natural interior";
//end behaviour
//load Pool Pic
this.pool_colours.loadMovie("interior_colour_1.jpg");
//End Behavior
//load Graphic Behavior
this.interior_colour.loadMovie("interior_colour_1_thumb.jpg");
//End Behavior
}
Changing Input Field Text On Click?
Ok so in my flash i have a contact form. It has a name field, and the field already has the word 'Name' in it. As well as the Email field with 'Your Email Address' and a message field with 'Your message' in it.
What I need to happen is that when I click in the message field, or any of them, the label text (ex: Your Email Address) needs to disapear. But, I can't apply a onClick to an Input Text! How else can this be done?
How can i solve this problem!? Help!
The form works fine now and I would rather not change it up by putting it in movies or chainging properties or anything. WHat kind of workaround or solution is there?
THANKS FOR ANY INPUT!!
-nanascalala
No Right-click, And Dynamic Text-field Linking.
Hi! I'm new here, and need a smidge of help.
I've made my site, ready for upload, but I don't want that crazy right-click menu-thing to appear. I hate it! So, is there a way to get it to not appear?
Secondly, I've made a dynamic text-field, and a .txt file. The text-field loads the .txt as it should, except for links. How do I get these links to appear?
One more thing! I have this nifty custom-cursor icon. But, when I move it over dynamically-loaded text, I see the I shape thing as well. Can I change the "I" shape-thing?
Thanks!
Change Text Field Color On Click
Hey guys. Just a quick question. I have a dynamic text field that updates when an mc is clicked. Just wondering how I can change the color property of the text when when the
on click event happens.
Thanks.
No Right-click, And Dynamic Text-field Linking.
Hi! I'm new here, and need a smidge of help.
I've made my site, ready for upload, but I don't want that crazy right-click menu-thing to appear. I hate it! So, is there a way to get it to not appear?
Secondly, I've made a dynamic text-field, and a .txt file. The text-field loads the .txt as it should, except for links. How do I get these links to appear?
One more thing! I have this nifty custom-cursor icon. But, when I move it over dynamically-loaded text, I see the I shape thing as well. Can I change the "I" shape-thing?
Thanks!
Responding To Click Events In An Html Text Field
I have a dynamic text field into which I've loaded an html file. In the html file are some links. However my flash program runs in full screen so when you click on the links IE launches and goes to the page but the user doesn't see it at all, cause the flash program retains focus and stays fullscreen. Is there a way to have the program respond to the user clicking on a link and minimize giving IE focus?
Flash Form Field: Select Text On Click
Hey All,
I have a flash form, prepopulated with form box titles. Client would like the text to highlight on first click rather than the defualt double click. Any ideas on the approach here? Listener Object? Script?
Any help would be fantastic!
Cheers
-jub-
Detecting A Click On An Html Link In A Text Field
If you have an href link within an html text field in Flash, is there any way of detecting when the user clicks on it?
Not being a standard button, you obviously can't do:
ActionScript Code:
on (press)
{
doStuff();
}
But is there another way?
Cheers.
Adding Text To Input Field At The Click Of A Button
The www.bbc.co.uk/raw has a flash move at http://www.bbc.co.uk/raw/gamesandquizzes/storytelling/ choose "story writing" (left selection).
It has a simple way of adding text by clicking the button and adding it to the input field where the curser is left.
I have tried to repeat it with external .txt files but all i seem to be able to do is replace all the text when I click the button.
Can anyone guide me in the right direction or even give me an idea what this function is called so I can add it to my project.:confused:
Thanks
Chris
Evaluating A Text Input Field On Button Click
can anyone tell me why the following code wouldn't be working? this is on a button, so that the input would be evaluated and a certain msg would appear when the button is clicked.
Code:
on (release) {
if ((inputName = "this") || (inputName = "that")) {
msg = "msg1";
} else {
msg = "msg2";
}
}
help?
Selected Field
I made an email form that works flawlessly yay! And I added a little spice to make it interesting however when i added it, it took away the ability to click on field to type in information. You can only go through fields using TAB. The spice I added was when users type information into the fields it appears all over the screen different sizes and fades out. This took away the ability to click on a field as soon as the keyboard is pressed. Is there anyway to re enable?
Here is my example:
http://http://www.narrativerecordings.com/form2.swf
Any help would be appreciated.
Here is mi code:
var kl:Object = new Object();
kl.onKeyUp = function() {
var t = _root.attachMovie("lc","lc"+_root.getNextHighestDe pth,_root.getNextHighestDepth());
t._x = Math.random()*500;
t._y = Math.random()*400;
t._xscale = t._yscale = Math.random()*500+90;
t.onEnterFrame = function() {
this._alpha -= 7;
if(this._alpha < 1) {
this.removeMovieClip();
}
}
t.theLetter.text = String.fromCharCode(Key.getAscii());
}
Key.addListener(kl);
Selection.setFocus(fname);
_global.style.setStyle("themeColor", "haloBlue");
_global.style.setStyle("fontFamily", "tahoma");
fname.tabIndex = 1;
lname.tabIndex = 2;
email.tabIndex = 3;
phone.tabIndex = 4;
address.tabIndex = 5;
questionorcomment.tabIndex = 6;
sender.tabIndex = 7;
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.fname = fname.text;
senderLoad.fname = lname.text;
senderLoad.fname = email.text;
senderLoad.fname = phone.text;
senderLoad.fname = address.text;
senderLoad.fname = questionorcomment.text;
senderLoad.sendAndLoad("form.php",receiveLoad);
}
How To Make A Selected Button When You Click?
I have several items on my menu. Let's say:
Button0
Button1
Button2
How to make a selected button when you click, initialize to "Button0" and when the user click to another button (ex: Button1 or Button2), the color will be switched to this new selected button??
thanks in advance,
Clear Input Field When Selected
Hi, I have a simple serch textfield and want to be able to clear the text currently in the field once a user clicks on i. I've tried the below but its not working:
var changed = false;
//search_txt.addListener(someListener);
search_txt.onChanged= function(){
if(changed == false){
this.text = '';
changed = true;
}
}
[F8] Update Combobox Selected Item On A Button Click
I am working on a pagination module.
In the top of the page there is a list of items where I have to show only ten items and if there are more than ten items then a combo box will display 1 of 2, 1 of 3 etc., depending upon the number of items in the list. I have done it using XML and arrays and it is working fine.
But there is also a next and previous button which is also working but now what I want is suppose if we are in # 2 of 3 page and click on the previous button then the selected item of combo box should also change from 2 of 3 to 1 of 3.
Please let me know how should I do this.
Please let me know if I could not express myself clearly.
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Mask Layer Hides Labels, Button Text, And Selected Text For Combobox
does anyone know how to get flash to stop hiding text that resides on movie clips that have a mask layer over them? the masks appear to work fine but hide this text and i cannot figure out how to get it to stop.
thx
=========================================
Don't sweat the petty things and don't pet the sweaty things.
Selected Text Formation Is Not Working In Dynamic Text Box.
I have 2 textbox in my .fla.
First textbox is input textbox, where user can write text.
The other one is dynamic text box.
In dynamic text box the text comes from input text box.
i.e.:
When user will write text in input text box, this text will also appear in dynamic text box.
Everything is working fine till here.
Now, I need to add text formation buttons which will work on user selected text.
Means:
When user writes text: "This is my text", the text will appear in dynamic text box.
And when user will select text by mouse in dynamic text box and will click ”Bold” button, the selected text must be formatted.
i.e.: Suppose user has selected only "my text" words from dynamic text box and pressed the mouse button, only "my text" words must be bold.
Any one has any Idea?
Text Area Component Text Inadvertently Being Selected
I'm using Flash MX 2004 and have created the following forms-based application for a client: http://www.finebalancecoaching.com/ . A complete list of defects is shown here: http://www.finebalancecoaching.com/FBCApplicationDefects . The focus of this post is item 6.2.
The TextArea component is located on the Main form, and is named Main_ta. All other forms that need the TextArea component are nested below the Main form and are thereby able to use it (e.g., Home form, Approach form, Testimonials form, etc.). After you've clicked through the site and have scrolled through a few different chunks of text, the text in the TextArea component is being inadvertently highlighted when you use the scrollbar.
I tried using Main_ta.selectable=false;, but this did not work. Any help would be appreciated. Thanks.
Delete Selected Text In Dynamic Text Box
I need to be able to delete all selected text in a dynamic text box.
I also need to be able to insert the cursor in the string of text in that same dynamic text box, then click a button and have it delete a character TO THE RIGHT of the cursor with each click.
I'm trying some things and have been doing search on many forums but don't see any examples of anything like this. Can anyone offer any input? Thanks!
Text Not Getting Selected
Hi
I am using textSnapshot to highlight text, but it is not working. Can any one please help what I am missing. Here is my code
ActionScript Code:
import fl.controls.ScrollBar;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import flash.system.System;
import flash.text.TextSnapshot;
import flash.ui.Mouse;
stop();
var request:URLRequest;
var loader:Loader;
request = new URLRequest("list1.swf");
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
var mc:MovieClip;
var snapShot:TextSnapshot;
var cursor : MovieClip;
function loadComplete(event:Event):void {
trace("Complete");
}
loader.load(request);
var temp_mc:MovieClip=new MovieClip();
temp_mc.addChild(loader);
emptyMovie.addChildAt(temp_mc,0);
snapShot = temp_mc.textSnapshot;
snapShot.setSelectColor(0xffff00);
snapShot.setSelected(0, snapShot.charCount, true);
trace(snapShot.charCount);
trace(snapShot.getText(0, 10000, true));
trace(snapShot.getSelectedText());
Getting Selected Text
Hi,
Is there any way to make flash return what text you have selected?
Say I have a textbox, with a bunch of text in it. I want to be able to highlight a word, and click a button and make the highlighted text capitals? I know there is a replace selected text function, but how can I work out what text is actually selected?
Any ideas anyone?
[AS] Get Selected Text
Hi guys,
Does anyone know how to get the selected text from an input text?
I need this to do a form and to be able to put the text i'm writing between <b> </b> by just selecting the text and clicking the BOLD button, just like a text editor.
Please help
thanks in advance
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
Getting A Text String Value From A Text Field And Duplicating It In Another Text Field
I'm trying to take the text from one text field and duplicate it in another.
I want to display the text that is in the text field _root.MC_Control.tab_title in another text field called _root,video_title.
I have tried this:
_root.video_title.text = _root.MC_Control.tab_title.text;
and this:
_root.video_title.text == _root.MC_Control.tab_title.text;
neither one seems work....am I missing something?
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}
Copy Selected Text
Hi... Is there a command in flash to select the text in a text field or to copy a selected text to the clipboard?
Like the copytoClipboard command in Lingo?
Getting Highlight Or Selected Text
I need to know how to have a sentence or line of code for a user to look at and highlight a specific piece of it and know what piece they have highlighted. Is that possible?
Text Box Clears When Selected?
Is there a way to code a input box in flash 5 or MX that makes it clear of the default text once the user clicks on the text feild to input their info?
I have an email feild, with default text of "Type Your Email Address" that I would like to clear blank automatically when someone selects the text box, rather than them having to highlight and delete it.
Thanks in advance.
Get The Selected Text Of A TextField
hi
can i get the text that the user select from the textfield
means i've a textfield i put some text in it then the user select a word for example i want to get this word
thank you for the help
[F8] Determining Selected Text
I need to return a substring that is selected from an dynamic or input text box. i.e. I have a textbox containing "FlashKit is the best forum ever" that is selectable, if I highlight "best forum" and click a button (or use the contex menu, as clicking a button might make the text box lose focus) I need to return the string "best forum".
I've looked into the textsnapshot class and the replaceSel function, but I am not sure if those can help.
One possible way would be if I could somehow add html tags around the text, then I could easily extract the text out.
Any ideas or solutions would be much appriciated,
jtnw
Return Selected Text
Hi
I am wanting to have a button, when the button is pressed it takes text that is selected in a dynamic text box...how can this be done?
For example, I have my dynamic text box with a full document inside, i select the title and i want this title to be displayed somewhere else when the button is clicked
Working With Selected Text
Hi
How would I go about, ( in actionscript ) taking some selected text in a dynamic text box into a variable when the user clicks a button?
All I need to know is how to take the selected text, I don't need to know how to setup the button or anything else
Thanks
Selected Text Colour?
is ther any way to alter the colour of selected text, or the colour of the selected area block?
Cheers...
Get Selected Text From A Textarea
Hi All,
I have a textarea and a button. When the button is clicked I want to be able to output whatever text the user has selected in the text area i.e. Consider the following text:
"Text I want to select" and I highlight "select" then click the button. I want "select" to be output to screen.
How do I go about detecting what has been selected in the textarea?
Selected Text Into Flash
Hi.
How do I bring in selected words from a xml string into flash?
Eg. I have this xml tag:
<image>www.website.com/1.jpg</image>
How do I import into flash only:
<image>1.jpg</image>
Selected Text Retrieval
First of all: I'm a Flash 5 user...
My problem:
I can't retrieve selected text and send it from one text field to another.
How it should work:
The user should select a word (at least one letter) in the main text field (called theText). As soon as the word is selected, the 'Lav keyword' (means 'Create keyword') button should be activated. I usually achieve this by putting the button into a movieclip, and by using tellTarget to make the movie jump to another frame. Now, when the user clicks the newly activated button, the selected word should be copied and pasted into the keyword field (called key_field), and the button should become deactivated again.
I've tried to dig up several solutions, but nothing seems to work for me. Someone please take a look at my .fla, and tell me what to to. text_ex.zip (17k)
Selected Item's Name Appear In Text Box
Can someone help me out or point me in the right direction? I'm looking for a method that allows me to display an objects name in a dynamic text box after I select it.
Edited: 09/03/2007 at 01:20:54 AM by jeeepU
Formatting Selected Text
How would I be able to do this, but from a button... each time i've tried, it seems to deselect the text when i press on the button... thus the changes aren't made. Should I store the selected in a variable and then when I call the function from the button it pulls in that variable?
What are your thoughts?
ActionScript Code:
function doFormat() { var startIndex:Number = Selection.getBeginIndex(); var endIndex:Number = Selection.getEndIndex(); var stringToUppercase:String = output_txt.text.substring(startIndex, endIndex); var format2_fmt:TextFormat = new TextFormat(); format2_fmt.bold = true; output_txt.setTextFormat(startIndex, endIndex, format2_fmt);}
Text Selected OnFocus
Hi,
I have 2 input text fields in my movie...each has prepopulated text, giving directions to the user. i.e. the first input field is for their first name, and is populated with the text "First name here..."
I want it so that when the user clicks in the first name text field, the text is automatically selected, so that they can easily hit delete and get rid of it all, or even just start typing and have their content replace the initial text.
This is what I am trying...
Code:
nameTxt.onSetFocus = function(){
nameTxt.setSelection(0,nameTxt.length);
trace("focus is set on name "+nameTxt.length);
}
The trace is there just to prove that is actually recognizing that the focus is set on that field... its just not selecting the text.
Any thoughts?
Thanks!
b.
Set New Style For The Selected Text
hello everyone
i need a help from someone.
Im creating the dynamic text field.I should be able to select the texts in the field and set the new styles such as bold , italic etc.The new stlye should reflect only in the selected text.
It wouls be great if some one could help with the sample code
thanks
Selected Item's Name Appear In Text Box
Can someone help me out or point me in the right direction? I'm looking for a method that allows me to display an objects name in a dynamic text box after I select it.
|