PDA

View Full Version : [FMX]variables not passing correctly


ubauba
04-11-2003, 07:28 PM
i have a MC with a button in it on the main time line; the instance name is box. I created 4 variables; box1,box2,box3,box4.

box1 = getProperty( _root.box, _x);
box2 = getProperty(_root.box, _y);
box3 = getProperty(_root.box, _xscale);
box4 = getProperty(_root.box, _yscale);

the box is 100w X 100h and it's located at (0,0);

but the variable return some crap. What am I doing wrong?

I tried
box4 = getProperty(_root, _yscale); and still get a crappy result.

What am I doing wrong? thank for you help.


TN

eFans
04-11-2003, 07:50 PM
I usually use it with this style:
box4 = _root.box._yscale;

ubauba
04-11-2003, 08:00 PM
yup i tried that also. still get back crap.

eFans
04-11-2003, 08:13 PM
hmm.. maybe the problem affected your variable scope.

If your box4 variable defined in the root
and you do it within a mc, the script should be:

_root.box4 = _root.box._ystyle;

Try it!
Good luck.

ubauba
04-11-2003, 08:20 PM
nope, still got CRAP.

in the main time line there are 2 layers
layer 1 has the 4 dynamic text with variable names. within this layer are the varibales box1 = _root._xscale and so on

on the other layer is the mc with the box which i am interested in getting the property.

thanks for your quick response

attached is my source file. thanks for ALL the help.

eFans
04-11-2003, 08:33 PM
Your mc have register point at the center position.
If you want the result of x and y properties isn't 'crap', change the register point position to 0, 0 (drag it to the left top corner of your mc, or type it on the X and Y property channel).

ubauba
04-12-2003, 01:13 PM
Efans,

three words..."you de man". Thanks a bunch. after reading your replied I did a search on Registration Point and learn another BASIC SKILL today. Thank you so much for your help.

TN:)