If my understanding is correct the answer to your problem lies within the first 'reply'.
As tg said...
Quote:
|
tg - you can set a variable inside your mc to equal the variable on the main timeline
|
My flash isn't working properly at the moment so i cant check the exact code.. but the basics of what you'll have is:
On the main time line
ActionScript Code:
// how far left you want the MCs to go
Left = (input number here)
// How far right you want the MCs to go
Right = (input number here)
// Top value - u get the idea
Top = (input number here)
// Bottom value
Bottom = number
The code for the button within the MCs
ActionScript Code:
on (press) {
//left /right constraints
if (this._x <= _root.Left and this._x >= _root.Right) {
startDrag (this, true);
// top/bottom constraints
if (this._y <= _root.Top and this._x >= _root.Bottom) {
startDrag (this, true);
}
}
This code is made up off the top of my head.. it may work... but i doubt it will 100%
Basically though.. the limits are set by the variables in the timeline (Left,Right,Top,Bottom) and the code within each movie clip targets these variables and uses them. This method will allow you to simply copy and paste the code into the button of each MC and easily change the constraints for all the MCs by simply altering the variables in the timeline.
Hope this makes sense.. but above all... i hope it helps!
As mentioned before - i'm still relatively new to actionscripting (also confined to flash 5 actionscripting for the moment) so any experts plz do correct my errors.