Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 28th, 2003, 05:13 PM
koalabeer koalabeer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 9 koalabeer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
another dynamic text question

hi there,

i have a dynamic textfield with some text like: [subject]

i want this to be inside the textfield instead of a label next to the textfield because of limited space. when u click with the mouse on the textfield to position the cursor inside, i want the text to become selected, just like in the adresbar in IE. when u start typing, the [subject] dissapeares for the freshly typed text

thnx in advance

koala

Reply With Quote
  #2  
Old August 29th, 2003, 08:55 AM
Cyanide Cyanide is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 17 Cyanide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 17 sec
Reputation Power: 0
Assuming you have FlashMX, this will work.
Code:
TextField.prototype.select = function() {
	var selector = {field:this};
	selector.setSel = function(end) {
		if(Selection.getBeginIndex() == Selection.getEndIndex()) Selection.setSelection(0, end);
		Mouse.removeListener(selector);
		clearInterval(selector.setInt);
	}
	selector.onMouseUp = function() {
		this.setInt = setInterval(this.setSel, 1, this.field.length);
	}
	Mouse.addListener(selector);
}


Usage:
Code:
txtName.onSetFocus = function() {
    this.select();
}



Credit to Prometh for the code.

Reply With Quote
  #3  
Old August 30th, 2003, 06:42 AM
koalabeer koalabeer is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 9 koalabeer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thnx

hey Cyanide, thnx for the great code. it works perfectly and does exactly what i want it to do. had to use an inputfield, because i coudn't edit the dynamic one, but this is no prob

greetz and many thnx,

koalabeer

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > another dynamic text question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway