This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > July 2007 > Problems with buttons





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Problems with buttons
sr817

2007-07-17, 6:16 pm

I've been designing my first website for the past few weeks and have worked out
most of the kinks in actionscript and animation. My last major question is in
regards to the many buttons I have needed to complete this project and the
build-up of them in all of my movie clips. So far my buttons have only been
functional if the button instances in any of my movie clips are created and
sustained throuoghout the particular movie file (I have to make them
transparent on certain frames where I do not want them to be seen). What has
begun to happen is there is a build-up of invisible buttons (with alpha 0%)
that can be accidentally clicked while browsing the website. I was curious if
there was any way to "hide" objects (not make invisible) on particular frames,
making them functional by keeping the instance intact, but preventing browers
from accidentally clicking them. If this is not feasible, could anyone explain
a method of preserving my buttons in one frame (say frame 5 in a clip) and not
being obligated to extend the button throughout every clip. I'm sure there is
a simple solution, I'm just not familiar with it.

Thank you,
Sam

Rapatski

2007-07-17, 6:16 pm

Hey Sam,

It sounds like a pretty shady button practise you are doing. Normally you
shouldn't need to hide buttons. But as the timeline progresses by default, when
you do not order it to stop and its playhead hits a frame where the button is
not present, it will disappear/not work.

To answer you question about the visibility of objects on the stage, you can
manipulate this by manipulating their _visible or _enabled properties.

But then again, You shouldn't need to do this...

Rapatski

2007-07-17, 6:17 pm

How exactly does your website work? Where do you have the code? On the buttons,
like

on(press) {
goToAndPlay(2);
}

or on a frame on a layer of the main timeline, like this?

button_btn.onPress = function() {
goToAndPlay(2);
}

sr817

2007-07-17, 10:15 pm

Hello rapatski,

Thank you for the fast response. I have very little professional training in
flash and the site has been put together as I have been learning flash.
Currently, the site is organized as 3 seperate movie clips (top bar, main bar,
and bottom bar). The buttons are located in each of the frames and depending
on which button is pressed it could affect its own frame as well as the other
frames used for the site. I put the actionscript button codes in the main
timeline, not knowing any other method. If I were to program the buttons
seperately, how would I affect another movieclip found in the main timeline but
not in the particular movie instance? I was hoping I could program the buttons
directly in the movie clip rather than the timeline, but I could not figure out
how. Your first reply describes my problem perfectly. To sum up your second
reply, the code is located on a layer of the main timeline.

Thank you once again,
Sam

Rapatski

2007-07-18, 6:16 am

Hey Sam,

Well.. if that sums up your problem perfectly there is a lot of work to be
done! If you send me the fla, I could take a look, because I'm afraid there are
several things that do not add up correctly..

To obtain my emailadress, remove all B and b characters from this address. (In
order to prevent spam)

flash@tieBmenBbrapBati.cBbom

Regards,
Tiemen Rapati


sr817

2007-07-18, 6:16 pm

Thank you Tiemen,
I tried emailing you with that e-mail address and my mail system came back
with an error. After double-checking the spelling (and making sure I took out
all the Bs) I wasn't able to e-mail you with that address. Is there any chance
you could send me another e-mail address you have?

Thanks,
Sam

DocFish

2007-07-19, 6:16 pm

Hi Sam,

I've found this to be true: a button won't work unless it tarts it's life so
to speak, at frame one of your file. So, you end up including the button in
every frame of your animation - making it transparent on those frames where it
is not desired. A way 'around this' that I have had success with = is to omit
the transparancey technique all together, and instead - position your button
entirely outside of your document border - and of course position your buttons
where you want to on the frame where you'de like it to be accessible. This way
their is no chance you'll have active (but transparent) buttons. To ensure that
the buttons which reside outside of your document border (what I mean by this
is if your flash document is 200x200, the buttons you don't want to be visible
are positioned at (x) axis 230
for example.) are not visible - I'm told if you use a mask - you can ensure
that they are invisible to the viewer - (dzedward ) advises that 'all you would
do is create a new layer over your buttons' layer, make a shape that covers
your canvas (doesnt matter the color), then right click your new layer, and
select Mask. '

To be honest - as an newbie myself, this may be the totally wrong way of
building a site - but it does work.

Rapatski

2007-07-19, 6:16 pm

Hey Sam, I think I have PMed you the address that works, though that should be
the same as the above without b's and B's. Oh well. To reply to you both; a
button simply works on every frame where the Actionscript you placed on that
frame can find the button it refers to, or the other way around. I'll make an
example fla and upload it somewhere tonight.



sr817

2007-07-19, 10:16 pm

Thank you docFish and Tiemen,
Docfish - very smart way of avoiding errors. If the "proper" method is too
complex, that seems to be a very useful, effective solution.

Tiemen - Thank you for continued support on this issue. I e-mailed you
earlier and I hope it works this time.

Thank you,
Sam

Rapatski

2007-07-20, 6:19 am

Alright Sam! I have received your e-mail with fla, and from what I've seen
you're well past the beginners coding level! It's all actionscript 3, which is
pretty neat on it's own. The advice I gave earlier, with the onRelease handler
is then deprecated. I'll continue to have a look and e-mail you the results.

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews