Be a Supporter!

Dynamic text doesnt work

  • 312 Views
  • 4 Replies
New Topic Respond to this Topic
adalireco
adalireco
  • Member since: Oct. 13, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Dynamic text doesnt work 2012-10-16 03:08:31 Reply

Hi all , i make a game with as2 (flash 8) but my dynamic text doesnt work alwayz(!)

var stat:String;
stat = "sentence"; //default

navi7_mc.onPress = function(){
durum = "raining !?";
} //it works

but i have one like that or i have created new one , convert it to mc after that

navi10_mc.onPress = function(){
durum = "raining !?";
} it doesnt work

why dont work i dont know please help me :(

ProfessorFlash
ProfessorFlash
  • Member since: Oct. 6, 2007
  • Offline.
Forum Stats
Member
Level 32
Programmer
Response to Dynamic text doesnt work 2012-10-16 04:00:12 Reply

Is "durum" the instance name of the textfield? In that case you need to access the "text" property of it.

durum.text = "this works";

You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.

adalireco
adalireco
  • Member since: Oct. 13, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Dynamic text doesnt work 2012-10-16 04:27:03 Reply

thx a lot i solved it you rock :D but this time i have one more problem:
:(
if i drop my rope object in frame's somewhere my knife object being visible.İ cant find the problem can you help me :(

(you can see on the image)

my codes:

rope_inv:

onClipEvent (load) {
this.tabEnabled = false;
this._visible = false;
orig_x = this._x;
orig_y = this._y;
}
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = orig_x;
this._y = orig_y;

if (eval(this._droptarget) == _level0.knife_mc) {
this._visible = false;
_level0.knife_mc._visible=false; //its being only frame 1(!)
_level0.knife_inv._visible=true;

}

}
rope_mc:
onClipEvent (load) {
this.tabEnabled = false;
if (_global.rope == 1) {
this._visible = false;
}
}
on (release) {
_global.rope = 1;
this._visible = false;
_level0.rope_inv._visible = true;
}

Dynamic text doesnt work

adalireco
adalireco
  • Member since: Oct. 13, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Dynamic text doesnt work 2012-10-16 04:29:25 Reply

(problem is that if i drop my rope on knife its working ok but works in i dont drop on knife)

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Offline.
Forum Stats
Member
Level 10
Programmer
Response to Dynamic text doesnt work 2012-10-16 18:28:34 Reply

This is damn near impossible to read, using _global, _level0, on(), and onClipEvent() make your code completely cryptic, you're the only one who can't truly understand what that means. You should never use any of those functions or properties except under extremely specific situations.

Not to mention that using the function eval(), on(), onClipEvent(), and the property _droptarget are all AS1 code which was roughly developed in 1998, you'll be very luck to find someone who will help you with that and I'd suggest you switch to something even remotely current-day.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature