PDA

View Full Version : tracing problem...



blah-de-blah
April 7th, 2003, 06:08 AM
hello,
well i'm trying to make a dynamic text box show the y value of an object, and the dynamic text box number changes as the object does...and i was thinking the trace function should do it, so heres my code, but it doesn't seem to work. i'm not sure why, any input would be good thx


blah1.onLoad = function() {
blah = setInterval(function () {
trace(_root.bong._y);
}, 100);
};


blah1 is the instance name of the dynamic box which i thougth you would need, and blah is the variable name of the dynamic text box, while bong is the instance name of the object thats moving. thx again

pom
April 7th, 2003, 08:11 AM
Not sure textFields have onLoad handlers defined, and you don't have to use it anyway.

The thing is, trace outputs something in the output window, not in a textfield, so you don't need anything, really. Just put somewhere:
setInterval(function () {
trace(_root.bong._y);
}, 100);pom :)

blah-de-blah
April 7th, 2003, 08:13 AM
yea that part worked, but the thing was that i want people to see the coordinates the object is on, so i was wondering how it could be done. The only way i could think of was trying to get the trace to show up in a dynamic text box instead :-/

kode
April 7th, 2003, 08:23 AM
setInterval(function(){blah1.text=bong._y;}, 100);
?? =)

blah-de-blah
April 7th, 2003, 08:27 AM
wow that seemed easy, thx very much :)

blah-de-blah
April 7th, 2003, 08:30 AM
ah yea, i just reliazed what i just copied and pasted dind't have trace in it. now i understand why it works :)

kode
April 7th, 2003, 08:48 AM
no problem ;) =)