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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two movie clips editing the same variable.

Status
Not open for further replies.

clemtinite

Programmer
Jan 28, 2003
12
AU
OK, here we go.
I have a Man movie clip which can be moved left or right with the directional keys.
When a Ladder movie cilp hit tests with the man, a variable '_root.Man.climbup' is returned true. This allows the man to 'climb' using the up and down directional keys and stops him from walking with the right and left directional keys.
This ladder movie clip is self contained and is only ever referred to as 'this' (by itself). This means in theory (to me) that since the '_root.Man.climbup' variable is contained in '_root.Man' as opposed to the (instance nameless) ladder, multiple copies of the ladder could be made with no extra programming neccassary.
What actually happens is that the man is only able to climb the one original ladder. I have traced this down to the fact that '_root.Man.climbup' is never returned true by the other ladders. I've even edited the base programming of the ladders so that they control a seperate movie clip which deals with the variables itself (there are no copies of this movie clip), but even that doesn't work!

CORE PROBLEM: The completely self sustained* movie clip A (A clone of movie clip C) cannot control movie clip Bs variable while the original and self sustained* movie clip C can.
* (By self sustained I mean that it holds no variables of it's own and therefor is only referred to by itself).

I'm lost, could anybody help? It'd be much appreciated!

- clemtinite
 
Since my first answer didn't seem to satisfy you, you should post a link to your .fla, so that it can checked out, rather than trying to decipher your explanations and problems.

You can upload it to your site, and provide a link to download it from there, or hope that somebody will understand and respond. Regards,

oldman3.gif
 
* eyes widen *
Oh damn. I was trying to post the same question last night but it didn't seem to be loading. I presumed there was some connection problem and it hadn't been posted. O_O;
Should've checked. Sorry all!

And thanks for your help oldnewbie!
 
Interesting. No matter how specific and accessable I make the variables, the second movie clip is STILL unable to edit them.

I was sure that would work, but since it hasn't I'll include a link to a .fla file I made portraying the core problem.

Cheers all.

 
So are you saying your file is working now, or just your link? Regards,

oldman3.gif
 
More appologies.
What I meant was that the link to the .zip file demonstrating my problem is working. My problem remains unsolved.
 
Well, sorry to report that the zip link doesn't work, but the previous .fla one does. Is it the same as the package? Regards,

oldman3.gif
 
* cries *

I don't know. Maybe something different with macs.

Yes, the .fla file is just the same.

... I'm not normally this unprofessional...
 
I'm not sure. Maybe a different way of referring to variables or even a different method altogether. Check out my problem in the .fla or .zip files previously mentioned. Any suggestions? It would be much appreciated.

The .fla and .zip files are just the same. For some reason .fla files don't download properly on my computer so I decided to provide a .zip version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top