-
Here's the function code I have in the main timeline:
function submenu (here) {
onClipEvent (enterFrame) {
if (_root.here == false) {
this.gotoAndStop(1);
} else if (_root.here == true) {
this.gotoAndStop(2);
}
}
}
...is it because i have onClipEvent in the code?
I have several mc's that need this code, and using a function would be a time saver....
-
yes it is, so inside each mc, have an onCipEvent(enterFrame) that then calls the function...
function submenu (here, where) {
if (_root.here) {
_root[where].gotoAndStop(1);
} else
{
_root[where].gotoAndStop(2);
}
}
where "where" is the mc name, which you can find out dynamically by _name
swills
-
Thanks!
Would this be correct for the mc:
onClipEvent (enterFrame) {
function submenu(printInfo, this) {
}
}
'where' would actually be a variable..but that shouldn't matter right.?
'printInfo' is one of my variables
for the function:
function submenu(here, where) {
if (_root.here == false) {
where.gotoAndStop(1);
} else if (_root.here == true) {
where.gotoAndPlay(2);
}
}
[Edited by flashkitok on 05-13-2002 at 04:18 PM]
-
No, not quite. the "here" is fine as it is just a variable that just gets tested, but the "where" variable is to be used as a path to an mc. So, either have "where" equal to an mc name that is on the _root, so then my original code works, or, have the full path in "where" (with _root included) and use eval(where) in the goto statement.
swills
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
|