divarch
11-19-2003, 09:01 PM
Hi,
I have several clips which I am attaching to the _root, but of all the AS writing my hands hurt, 'cause I am adding their parameters individually.
I thought the following function should work:
function moveClipTo (clip, x, y, alpha) {
clip._x = x;
clip._y = y;
clip._alpha=alpha;
}
and then assign it to each clip, of course, instead of rewriting, like:
onClipEvent (enterFrame){
moveClipTo(clip1,120,150,70)
};
The problem is I get an output error message when declaring a function "Function declaration not permitted here"
I even tried assigning the declaration o a button, _root timeline, and clips, and still nothing.
How can I make global function declaration, which can be called from child clips also?
Thanks!
I have several clips which I am attaching to the _root, but of all the AS writing my hands hurt, 'cause I am adding their parameters individually.
I thought the following function should work:
function moveClipTo (clip, x, y, alpha) {
clip._x = x;
clip._y = y;
clip._alpha=alpha;
}
and then assign it to each clip, of course, instead of rewriting, like:
onClipEvent (enterFrame){
moveClipTo(clip1,120,150,70)
};
The problem is I get an output error message when declaring a function "Function declaration not permitted here"
I even tried assigning the declaration o a button, _root timeline, and clips, and still nothing.
How can I make global function declaration, which can be called from child clips also?
Thanks!