Listeners
- Archawn
-
Archawn
- Member since: Sep. 9, 2007
- Offline.
-
- Forum Stats
- Member
- Level 27
- Game Developer
Code First (It's confusing, I know, but I'm confused right now):
var TextChanged:Object = new Object();
function changedText(TargetText, TargetProperty){
TargetProperty = TargetText.text;
}
TextChanged.change = function(evtObj:Object){
changedText(????, ????);
};
prop_xPos.addEventListener("change", TextChanged);
I want to be able to use the same listener for multiple variables (like prop_xPos, prop_yPos, prop_width, etc.)
So, I'd need to access the properties of "changedText" when adding the listener. Is there a way to do this?
- kiwi-kiwi
-
kiwi-kiwi
- Member since: Mar. 6, 2009
- Offline.
-
- Forum Stats
- Member
- Level 09
- Programmer
- Archawn
-
Archawn
- Member since: Sep. 9, 2007
- Offline.
-
- Forum Stats
- Member
- Level 27
- Game Developer
- kiwi-kiwi
-
kiwi-kiwi
- Member since: Mar. 6, 2009
- Offline.
-
- Forum Stats
- Member
- Level 09
- Programmer
- Redshift
-
Redshift
- Member since: Feb. 12, 2005
- Offline.
-
- Forum Stats
- Member
- Level 15
- Programmer
At 3/22/09 04:19 PM, kiwi-kiwi wrote: Oh sorry, my bad i wasn't paying attention I thought you were using AS 3 and I got everything wrong
He is using AS3...
#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}
- Archawn
-
Archawn
- Member since: Sep. 9, 2007
- Offline.
-
- Forum Stats
- Member
- Level 27
- Game Developer
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
I'm not totally sure what you're trying to do, but look up onChanged in the Flash help files. You'd have to apply it to all textfields (and give them instance names), but technically you could refer them to your function and send it the correct parameters.
Aware I may be well of the ball here, if so add more details about exactly what it is you're trying to achieve.
- Archawn
-
Archawn
- Member since: Sep. 9, 2007
- Offline.
-
- Forum Stats
- Member
- Level 27
- Game Developer
At 3/22/09 06:37 PM, Denvish wrote: I'm not totally sure what you're trying to do, but look up onChanged in the Flash help files. You'd have to apply it to all textfields (and give them instance names), but technically you could refer them to your function and send it the correct parameters.
Aware I may be well of the ball here, if so add more details about exactly what it is you're trying to achieve.
Yeah, I ended up doing that for each and every text box I had. I wish there were an easier way. AS3.0 is looking better and better as I improve my AS2.



