PDA

View Full Version : Set Properties from a button inside a MC?


weevil
08-12-2004, 04:16 AM
Hi - I have a button inside a MC inside a MC on the main stage. When I click on the button I want to return to frame 1 on the main timeline (no probs there) AND set the properties of 3 instances on that frame to low alpha. The following script works fine for a button on main timeline but not nested inside a movie clip in a movie clip. So i have MainTimeline/MC/MC2/BUTTON. Action on button is:
------------------------------------------------------------------------
on (release) {
_root.gotoAndStop(1);
on (release) {setProperty(_root.startbutt,_alpha,15);
}
on (release) {setProperty(_root.quizover,_alpha,0);
}
on (release) {setProperty(_root.holder,_alpha,0);
}
on (release) {setProperty(_root.imag,_alpha,0);
}
on (release) {setProperty(_root.overcomplete,_alpha,0);
}
---------------------------------------------------------------------
moves me to frame 1 of main timeline just fine, but doesnt set properties of instances on that timeline.
any help would be much appreciated.
weevil

pcarini
08-12-2004, 05:43 AM
Have you tried putting all of those statements in the same event handler ? I think it might be only running the first on(release) it comes across. So maybe try:

on (release) {
_root.gotoAndStop(1);
{setProperty(_root.startbutt,_alpha,15);
{setProperty(_root.quizover,_alpha,0);
{setProperty(_root.holder,_alpha,0);
{setProperty(_root.imag,_alpha,0);
{setProperty(_root.overcomplete,_alpha,0);
}

weevil
08-12-2004, 05:52 AM
Thanks for the tip but that gives:
**Error** Symbol=Module, layer=Nextprev buttons, frame=2:Line 4: Statement block must be terminated by '}'
on (release) {

I have a worked around my prob by going back to the main timeline first.

I would still really like to find a answer to this though.

cEzmunsTa
08-12-2004, 08:53 AM
Did you take the extra braces out of the code?.. ie


on (release) {
_root.gotoAndStop(1);
setProperty(_root.startbutt,_alpha,15);
setProperty(_root.quizover,_alpha,0);
setProperty(_root.holder,_alpha,0);
setProperty(_root.imag,_alpha,0);
setProperty(_root.overcomplete,_alpha,0);
}

black
08-12-2004, 09:57 AM
suggest your guys to use:

_root.startbutt._alpha = 15;

to replace this:

setProperty(_root.startbutt,_alpha,15);

we love dots ;)

liquidCr8tivity
08-12-2004, 10:13 AM
black is right on, try this weevil...

on (release) {
_root.gotoAndStop(1);
_root.startbutt._alpha = 15;
_root.quizover._alpha = 0;
_root.holder._alpha = 0;
_root.imag._alpha = 0;
_root.overcomplete._alpha = 0;
}

pcarini
08-12-2004, 05:37 PM
Did you take the extra braces out of the code?.. ie


on (release) {
_root.gotoAndStop(1);
setProperty(_root.startbutt,_alpha,15);
setProperty(_root.quizover,_alpha,0);
setProperty(_root.holder,_alpha,0);
setProperty(_root.imag,_alpha,0);
setProperty(_root.overcomplete,_alpha,0);
}


D'oh.. I was tired last night... :D

weevil
08-12-2004, 11:18 PM
Thanks heap for all the input guys. Unfortunately that still doesn't work. Takes me to the main timeline but doesn't set the alpha on the instances on that frame. I have worked around it so no probs. I have another issue now that i shall post today.
thanks again
weevil