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

Caption on/off button & movie clips 1

Status
Not open for further replies.

Jennyucf

Instructor
Joined
Jun 22, 2001
Messages
215
Location
US
Hi, there

I have to turn to your help again..sorry to ask questions non-stop..:-)

Here I have a caption on/off button to control the visibility of the caption. There are 10 movie clips containing the 10 different sound. I inserted 10 mc's in the 10 frames of main timeline.

Script on the button in the first frame: (sound1 is the name of the mc;)

on (press) {
Sound1._visible = !(Sound1._visible);
}

Script on the frame:

Sound1._visible = false;

The problem is I turn the caption off, when it goes to the second frame(sound), the caption showed up again. What can I do to make it really like a caption on/off effect?
Did I make sense?

Many many thanks!!!!!!!!!
 
I'm not very good at that kind of syntax...

But basically this should work...


on (press) {
if (_root.Sound1._visible == true){
_root.Sound1._visible = false;
} else {
_root.Sound1._visible = true;
}
}

Regards,

oldman3.gif
 
Hi, thanks a lot!!!!!

I tried out your code..it seemed that

on (press) {
if (_root.Sound1._visible == true){
_root.Sound1._visible = false;
} else {
_root.Sound1._visible = true;
}
}

equals

on (press) {
Sound1._visible = !(Sound1._visible);
}

After testing, I found they did the same....Could that be any other reason??

Appreciated...

Jenny
 
Is the caption visible to start with? Regards,

oldman3.gif
 
No, I set it in the frame:

Sound1._visible = false;

Thanks!!
 
Any movies loaded in those clips?

Loading a movie in a clip makes that clip visible, even if it was previously set to invisible. Regards,

oldman3.gif
 
Hi, thank you very much for the reply!

Actually, this one (Sound1._visible = false;) works when the first frame is loading..

The problem is that the caption of the second movie clip automatically shows up when I turn the caption button off when it plays movie clip one. Did I make sense?

Thaaaaaaaaaaanks again.


 
Nope! You're loosing me! Should post your .fla or part of it! Regards,

oldman3.gif
 
Sorry about the confusion..I absolutely understand with a souce file, it will be much easier...
....
...

Here we go. I don't have a website to put a link..but i've put it in the briefcase. Please go to..

User: ids4681
Password: group3
File: CaptionButton

Your extrodinary effort and time is very much appreciated!!!!!!!!!

Cheers
Jenny
 
Ok! Downloaded. But no promises I can look at it tonight... Maybe only in the morning! Regards,

oldman3.gif
 
No problem! And thank you so much for taking the time..I appreciate that !

Have a good night!
 
Ok! Had a quick look. Shouldn't be too hard to fix... In the morning!

But tell me this: Should the captions be on or off to start with? Regards,

oldman3.gif
 
Hi, oldnewbie

Thanks! I would love to put the caption off at the beginning..

Cheers
 
Re-did the whole thing! Can't really upload it anywhere at the moment and it's a 1,472MB zip.
Can you hit my handle (to get my e-mail) and send me an address where I could send it to you?
Wouldn't work on Hotmail, it's over 1MB. Regards,

oldman3.gif
 
Hi, nice to see you again!!

Can you just upload the file to the briefcase again??

User: ids4681
Password: group3

I think it will take the files of 5 mb.

Thaaaaaaaaaaaank you!

Cheers
 
Wait till you see it before you thank me. I've simplified it but complicated it in a way. Think you'll have questions! Regards,

oldman3.gif
 
Briefcase not opening up at least for now! Regards,

oldman3.gif
 
Hi, Oldnewbie

You are the best! The new file simplies the design a lot...I really love it!!
"_root.caption" is pretty new to me, as I didn't know that a variable's name can follow "_root"....
Thank you thank you!

Cheers
 
Since the caption textfield is now on the main timeline and not within the sound clips themselves, then _root has to be added to the path to target the right textfield. If you omit it, Flash would be looking for a textfield's variable within the clips themselves, and that one no longer exists. Regards,

oldman3.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top