PDA

View Full Version : createTextField mystery


nadia
04-07-2003, 09:34 AM
I use the duplicateMovieclip to duplicate an mc so that I have 5 of them on the stage. On the original mc I put this code :

on (press) {
setProperty(this, _y, 130);
setProperty(this, _x, _root.moveX);
_root.moveX += 100;
}

I hope that when I click any of the duplicated MCs, they'll arrange themselves in the order of my click. It works fine until I put this code with that above :

onClipEvent (load) {
this.createTextField("teks", 1, 23, 0, 150, 300);
senarai = new Array("1", "2", "3", "4", "5");
teks.text = senarai[_root.indek];
_root.indek += 1;
look = new TextFormat();
look.bold = true;
look.size = 30;
look.font = "Arial";
teks.setTextFormat(look);
}

The problem is, one or more the duplicated MCs won't respond to mouse clicks anymore. Eee it's weird.

Thanks for reading up to this length. I hope u nice people will help me. Sorry for the trouble.

z1ppy
04-07-2003, 03:07 PM
Im might be way off track here, and if so then just ignore me but... when you say that you dont get a response to your click anymore that is because you have changed the event handler from on(press) which runs when the mouse btn is clicked to on(load) which runs when the MC is loaded.

Is that what you were after?

:D

nadia
04-07-2003, 03:58 PM
I really can't explain what's going on. Before putting the createTextField I put a trace action [ trace(this);] just to see if it works.. and it worked fine (clicked "box"1, traced "box1").

But when I put the createTexField, one of the duplicated MCs won't move on mouse click or sometimes another MC(which I didn't clicked) moved. (I clicked box1 but box2 moved and traced).

Hoped I made myself understood. Thanks for the time.

Would u care to see the fla? Zipped, it's only 7KB.

nadia
04-07-2003, 04:07 PM
Zippy...

I don't really get what u say about on(press) changing to onClipEvent(load). :D :confused:

z1ppy
04-07-2003, 09:54 PM
Im really not quite sure whats going wrong, post the fla and i'll try and have a look for you. My guess is it could be something to do with the text field being selectable??? if it is, it might be overiding the on(press) code

nadia
04-08-2003, 04:56 AM
Dear zippy...

Thank u for ur time. Hope this won't be too much of a trouble to u. Thanks again!