Tracing problem

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

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

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

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 :slight_smile:

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 :-/

setInterval(function(){blah1.text=bong._y;}, 100);

?? =)

wow that seemed easy, thx very much :slight_smile:

ah yea, i just reliazed what i just copied and pasted dind’t have trace in it. now i understand why it works :slight_smile:

no problem :wink: =)