PDA

View Full Version : TO JESSE: define path in variable


vantran
01-03-2001, 03:53 AM
Hey Jesse, I tried that out but it did not work.

Here is the origianal function in button behavior

on (release) {
/:startx = getProperty(_target, _x)/40;
/:starty = getProperty(_target, _y)/40;
/:path = getProperty(_target, _target);
}

Now I want to cut those line out and put into a user defined function so I don't have to retype that block for every MC.

like you said earlier, I modified the function call to

on (release) {
/:path = _target;
_root.change(path);
}


function change (path) {
/:startx = getProperty(path, _x)/40;
/:starty = getProperty(path, _y)/40;
/:mymovie = path;
}

Is there an error?

Please help.

Thanks

Jesse
01-03-2001, 05:58 AM
Yeah your error is this:
on (release) {
/:path = _target;
_root.change(path);
}

See you're setting the root level variable 'path' then calling the variable within the current clip 'path' which doesn't exist because you just set it on root.

Try:

on (release) {
/:path = _target;
_root.change(/:path);
}


I got it working here if you need an example. (Using your same code, so it's right)

Cheers

Jesse

vantran
01-03-2001, 02:06 PM
Thanks, it works now. man just a little syntax really throws me off.

Take care.