PDA

View Full Version : ++Buttons won't WORK - suicidal++


aryastark
06-18-2003, 09:44 PM
neeed...help....bad....

i have 3 buttons on the main stage calling up 3 different movie clips. on each MC there is a 'CLOSE' button.

PROBLEM: each button works only ONCE, *unless* i click on each separate button consecutively (which means each button refuses to work when i click on it repeatedly).

This is the code i'm using for each button:

------------------------------------------------
on (release) {
gotoAndPlay("mymovie");
}
------------------------------------------------

and for the 'CLOSE' button:

------------------------------------------------
on(press) {
this.gotoAndplay("fade");
}
------------------------------------------------

Is there a conflict somewhere? What am i doing wrong? I've been up whole night trying to figure this out.

Would really appreciate some help here. Thanks in advance...

*AryaStark*

rob_van
06-18-2003, 09:48 PM
Originally posted by aryastark
neeed...help....bad....

i have 3 buttons on the main stage calling up 3 different movie clips. on each MC there is a 'CLOSE' button.

PROBLEM: each button works only ONCE, *unless* i click on each separate button consecutively (which means each button refuses to work when i click on it repeatedly).

This is the code i'm using for each button:

------------------------------------------------
on (release) {
gotoAndPlay("mymovie");
}
------------------------------------------------

and for the 'CLOSE' button:

------------------------------------------------
on(press) {
this.gotoAndplay("fade");
}
------------------------------------------------

Is there a conflict somewhere? What am i doing wrong? I've been up whole night trying to figure this out.

Would really appreciate some help here. Thanks in advance...

*AryaStark*

i think we need to see more code, cause that looks alright to me.. How come use use on release for "my movie" and on press for the "fade" .. just curious..

Sualdam
06-18-2003, 09:51 PM
Yeah, more info needed.

Those 'gotoAndPlays' sound like you are jumping to somewhere where the buttons don't exist - but you didn't say they aren't visible.

You might also have put unnecessary keyframes in the timeline layer with the buttons, and the code only applies up to a keyframe BEFORE where you are trying to click them.

aryastark
06-18-2003, 09:55 PM
hi rob,
i got those codes from someone in another forum. i basically know nuts about actionscripting.

should i make it 'on release' throughout, just to standardize it?

that's all the codes i have - basically the stage is set up with all 3 different MC (with their respective labels) sitting on the same layer but each on a different timeline.

it's just damn weird that the buttons just won't work if i click on them repeated, but works fine if i click on them one after another.

have included a screenshot of the timeline, wonder if that will help?

i'm close to tears, man...

aryastark
06-18-2003, 09:59 PM
hi Sualdam,
i started out with just *one* button calling out one MC and that didn't work - it refuses to call up the MC after 1 click. so i went ahead to add the other 2 buttons and MCs, for testing sake, and this time round it worked only if i click on one after another.

i hope the screenshot can provide more info.


:confused:

Sualdam
06-18-2003, 10:05 PM
It doesn't much.

Can you not provide a zipped FLA?

rob_van
06-18-2003, 10:06 PM
Hi Aryastark.

i can't tell much from your timeline.. it looks ok.. to me.

Whats on your actions layer just a stop action?

Maybe sualdam can help, otherwise post your fla and i'll have a look.

aryastark
06-18-2003, 10:32 PM
here's the fla. i've taken out all the unnecessary graphic files to keep the size down.

hope this helps!

Sualdam
06-18-2003, 11:01 PM
Arya

If you move each of the keyframes in the Sections layer to the right by one frame, the gotoAndPlay instruction plays through the clip rather than directly on it.

You'd be better putting each clip on its own layer rather than all on the same one so that you can avoid overlap, but that isn't essential here.

I think that fixes your problem (if I understood correctly).

Personally, I would have all the movie clips on the stage all the time and use the buttons to tell the others to close when clicked, but maybe you want close buttons for design reasons. In any case, controlling clips that are already there is better (my opinion). Doing it that way avoids this issue where jumping to a frame where a clip suddenly appears and then trying to control it doesn't work.

rob_van
06-18-2003, 11:22 PM
Aryastark,

Yah if you move them to the right, by one it plays though the clip and donesn't stop on it.


works good..

latez.

aryastark
06-19-2003, 09:54 AM
hey it works, THANK YOU guys!

i'm still confused why it works when i move it down a frame for each MC.

i'd better brush up on my basics.

thanks for all your help, much appreciated! :)

Sualdam
06-19-2003, 10:04 AM
If you have a normal timeline with a movie clip on, say, frame 10 and frame code trying to address that clip also in frame 10 it probably won't work.

You'll find a great many things that come down to timing or initialisation - doing a loadMovie and trying to gotoAndPlay the loaded movie in the same frame is one such example: it won't work.

In your case, you had created a situation like I describe in that first paragraph: you were making the button jump the playhead to a keyframe in which a clip was introduced to the timeline and trying to do stuff with the clip at the same time.