PDA

View Full Version : draggable dynamic txt field ?


| SPUDIO |
05-22-2001, 12:42 PM
simple question ...
i've got a dragable MC within that mc a dynamic txt field that has to display a variable value ...
when i drag the dragMC on stage & test it it doesn't work ...
when i put the same txt field on stage ( with the same variable value to display ) it works ...
is it that you cannot put a dynamic txtfield in t a draggable MC ??

greetz,

Sven
[email protected]

Marx
05-22-2001, 04:48 PM
Hi..
Have you specified the correct path to the dragMc:

_root.dragMc.show="Testing!";

'show' is the name of the textfield inside the 'dragMc'.

For your reference I placed the following code on the dragMc:

onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse,_root._ymouse,true)) {
startDrag (this);
updateAfterEvent();
}
}
onClipEvent (mouseUp) {
stopDrag ();
}

Hope this helps.

| SPUDIO |
05-23-2001, 07:26 AM
will try it later this day ...
but i don't see why u use the hittest-method ...
this is my "code" in the invisible button that is IN the MC in the toplayer
( not the right syntax :)

on press
start drag
on release
stop drag


it is no problem to make a dragable mc with a invisible button ... but wheni put a dyn.txtfield also in the mc it doesn't display a thng ..
when i put that dyn txt field straight away on stage ( with the same var-name ) it worx ....

anyway will try your version for shure !
tanx !

sven
[email protected]

Marx
05-23-2001, 08:59 AM
Hi...
Theres no real reason why I used the hit test method, I added the code so you could see all the steps I took when reaching my conclusions. Your ways just as good.

If nothing appears in your dynamic textfield then check that you've used the correct path.

Good luck.

| SPUDIO |
05-23-2001, 09:02 AM
Hi mate,

you mean with path, the path of the variable ?
anyway ...
will make some time for it this afternoon ...
thanx for it !

cu

Sven

[email protected]

Marx
05-23-2001, 09:07 AM
Hi Sven..
When I say path I mean the path to the variable:

_root.dragMc.show="Testing!";

The above code targets the textfield variable named 'show', which is inside of the MC 'dragMc'.

Good luck.

| SPUDIO |
05-23-2001, 09:09 AM
ow, ... okay :)

thanx man !


Sven

[email protected]

BoulderPete
05-26-2001, 09:17 PM
I want to be able to load variables from a text file (different ones like news, info, etc are all in the same file) which then are shown in different draggable movie clips.

Thanks in advance if you can help.

Marx
05-27-2001, 10:13 AM
Hi...
You can first load the txt file at the begining of your movie using the load variables action, then call the variables when needed:

1) Frame 1:

loadVariablesNum ("external.txt", 0);

This action will load the file containing all your variables into level0.

2) The code in the 'external' text file is as follows:

info=This is info.&&news=This is News.

3) Now you can call these variables using the set variable action:

a) News button:

on (release) {
_root.newsMc.news = _root.news;
}

b) Info button:

on (release) {
_root.infoMc.info = _root.info;
}


The two draggable MC's are, 'infoMc' and 'newsMc'.

Hope this helps.