-
Controlling multiple movie clips with 1 set of code on the main timeline
So I have been trying to figure out a way to control multiple clips using the same "on press" & "on release" statements located on 1st frame of main timeline. A variable is being set to a value that correlates to the name of each movie clip as an interaction occurs.
Ex: user clicks from a selection of buttons & depending on the button clicked it sets clipNum = "1" through "21".
What I want is to have something like the following code that will give the user the ability to click and drag the clip with code on the main timeline similar to the following:
_root["drag_" + clipNum].onPress = function () {
startDrag (_root["drag_" + clipNum]);
};
_root["drag_" + clipNum].onRelease = function () {
_root.ZoneLocking ();
};
This code however only works on the buttons and not from the main timeline.
Any ideas on how I can make this work?
Thanks,
Spit
-
Prid - Outing
The reason it doesn't work is because without a loop, that code only checks clipNum, once. You'll have to assign a loop, to keep checking the clipNum value
Actionscript Code:
onEnterFrame = function(){ _root["drag_" + clipNum].onPress = function () { startDrag (_root["drag_" + clipNum]); };
_root["drag_" + clipNum].onRelease = function () { _root.ZoneLocking (); }; }
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|