Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help please... probs with targeting a mc

Status
Not open for further replies.

bugg

Programmer
Jun 20, 2001
62
US
ok, I have two movie clips ("_root.ani" and "_root.pic") on the stage that can be in three different orientations, for the sake of simplicity, lets say levels 0, 1, and 2. I have three buttons that tell mcs what to do (normal button-tells both to goto level 1, ani button tells ani to goto level 2 and pic to goto level 0, and a pic button that tells pic-level 2, ani-level 0) I have used function calls as I plan on adding more to them later. here's the problem, "ani" works fine, no matter which mc I name "ani", they both work fine whilst named that, "pic" on the other hand won't work at all, I've tried other names and they just don't work. I have run through this for the last 2 hours, even re-written it, with no success, can anybody see why the're not working?

thanks much
-bugg

(on a storage layer @ the top)

//variables
_root.aniLevel
_root.picLevel

//functions

function index (){
if (_root.aniLevel == 0) {
_root.ani.gotoAndPlay (38)
}
//if ani small, then ani normal
else if (_root.aniLevel == 2) {
_root.ani.gotoAndPlay (50)
};
//if ani big, then ani normal

_root.aniLevel = 1;
//ani normal

if (_root.picLevel == 0) {
_root.pic.gotoAndPlay (38)
}
//if pic small, then pic normal
else if (_root.picLevel == 2) {
_root.pic.gotoAndPlay (50)
};

_root.picLevel = 1;
};

function ani (){
if (_root.aniLevel == 0) {
_root.ani.gotoAndPlay (26)
}
else if (_root.aniLevel == 1) {
_root.ani.gotoAndPlay (14)
};

_root.aniLevel = 2;

if (_root.picLevel == 1) {
_root.pic.gotoAndPlay (2)
}
else if (_root.picLevel == 2) {
_root.pic.gotoAndPlay (62)
};

_root.picLevel = 0;
};

function pic (){
if (_root.picLevel == 0) {
_root.pic.gotoAndPlay (26)
}
else if (_root.picLevel == 1) {
_root.pic.gotoAndPlay (14)
};

_root.picLevel = 2;

if (_root.aniLevel == 1) {
_root.ani.gotoAndPlay (2)
}
else if (_root.aniLevel == 2) {
_root.ani.gotoAndPlay (62)
};

_root.aniLevel = 0;
};

(on an actions layer below storage)
stop ();
_root.aniLevel = 1;
_root.picLevel = 1;

(buttons say - ani button for instance)
on (release, releaseOutside) {
_root.ani ();
}

 
third time was the charm, I rewrote it all again, and renamed the functions, and it works, my guess it that there was conflict with the function name and the mc names being the same.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top