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!

Instance Naming Problem 3

Status
Not open for further replies.

kramerpup

Technical User
Mar 2, 2001
25
US
Dilemma: I have six inverted tabs which drop from the top of the screen, all movie clips, named T1 through T5. When the button embedded in any one of these is clicked, it lowers itself (the whole tab)and then calls a function in the parent that moves the parent movie to another frame and raises the tab that is currently lowered.

Here's the code:

Button:
on (release) {
play (); //Tab goes down
with (_root.AllTabs) { //AllTabs is the parent
gotoAndStop (10);
}
_parent.raiseTab(); //call function
}

Function:
function raiseTab () {
for (i=1; i<6; i++) {
selectMov = &quot;T&quot;+i;
if (selectMov._currentframe == 44 ) {
selectMov.play();
}
}
}

I am trying to cycle through the tab clips, testing each one for whether or not it is currently down (at frame 44). Somehow, though, Flash is not understanding the instance names. When I debug selectMov always ends up being T5, but none of the movies ever changes.

Any clues?
Tom K.
 
How about something along the lines of:

for tab1:

on press > call the function for 'T+x' to raise the previous tab > setvariable (x=1) > your script for lowering button

for tab2:

on press > call the function for 'T+x' to raise the previous tab > setvariable (x=2) > your script for lowering button


Might not make sense to you but it's just a quick one! I'll put it in f5 code unless you post back with an &quot;I understood&quot; response.

dave dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
OLD>>>>> server just died along with pz (boo-hoo), you're handy back-ups may come in useful if all is lost forever! ;-) dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
I never lie ( ;-) ) Check the Chat section >> dead dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Who wants to chat over there... When we can freely chat here!

;-)
 
Why old, of course..... ;-) dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
The following fixes 99% of the bug you may have noticed in the last example. The bug occurred if two buttons were pressed in succession very quickly. The new version eliminates that problem unless the user is trigger happy, in which case they would deserve the bug ;-) .


dave
dave@davdesign.co.uk

^^^^^^^^^^^^^^^^
 
Got the fix!
What about a triple click? A four click?

Goodnight!

;-)
 
davdesign,

That is exactly what I'm trying to do, but I can't access your .fla file. Error message says file doesn't exist...

Tom K.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top