Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-15-2009, 01:13 AM   #1
skdzines
Registered User
 
Join Date: Jun 2005
Posts: 34
Default [AS2] checking for a change event of TextInput component

Does anyone know how I can tell when the text of a TextInput component has changed? When the text changes I want to call a function to update another dynamic textfield however I can't seem to get it to trigger a change event. I have tried several different methods and none seem to work. Below is the last method I tried. By the way I'm using AS2 not AS3.

projMngrCS_qty.addEventListener("change", tiListener);

// Create listener object.
var tiListener:Object = new Object();

tiListener.change = function(evt_obj:Object) {
trace("Input has changed");
};

Any help is appreciated.

Thanks
skdzines is offline   Reply With Quote
Old 04-28-2009, 02:45 PM   #2
magic77
Registered User
 
Join Date: Apr 2009
Posts: 3
Default

hi,

var tiListener:Object = new Object();

tiListener.change = function(eventObj:Object) {
var target = eventObj.target;
var targetID = eventObj.target.id;

// do something

};
myInputField.addEventListener("change", tiListener);

But TextInput Component should be on Stage already, and don´t forget to
import this before:

import mx.controls.TextInput;
import mx.core.UIComponent;
magic77 is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating separate classes for custom event frank grimes ActionScript 3.0 6 06-27-2009 10:55 PM
Problem with OnRollOut Event of TextInput component Girish_inf ActionScript 2.0 8 02-15-2005 04:47 AM
textInput Component validation joaoVieira Components 1 11-20-2003 06:46 AM
Adding an event handler to new component lbower ActionScript 1.0 (and below) 4 02-04-2003 08:51 PM
Event handling with Listeners - learning from Java robertpenner ActionScript 1.0 (and below) 2 08-08-2001 11:36 PM


All times are GMT. The time now is 11:36 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.