Groups | Blog | Home
all groups > flash actionscript > june 2004 >

flash actionscript : all righty...i need help


Mr.bloodworth
6/5/2004 6:35:47 PM
im working on a project.
its in flash lol

basicly i need a toggle for a buttion.

the .swf can bee seen here.
http://members.visi.net/~mcelrath/vonbloodworth/new%20site%20preloader.html

as you can see i have only one buttion right now...now if you hit that
buttion...eveything works as i had planed...but if you hit that buttion
again...it starts aggain...now within each "movie clip" i have the "return"
animatin..as in the arm refolds up and goes back into the little hole...now
here is the problem.....

i have tryed many things in order to make it retract when the buttion is
repressed...but nothing seems to work...this buttion also needs to know that if
another buttion is pressed that it is to "retract" and then move onto the
called on action...so basicy in words...

if buttion is pressed...then arm goes up..curtain shuts...background movie is
unloaded...
if buttion is repressed...arm retracts...backgroundmovie is reloaded...curtain
opens...
if another buttion is pressed...arm retracts..background movie is
reloaded...curtainopens...new called on action...

i get the jest of if - then statmets...but in not shure how to translate
itinto actionscript...as well as make it check what state a movie clip is
allready in...

any help is GREAT...if i need to explane more i can...
kglad
6/5/2004 8:52:25 PM
attached to your button:

on(press){
if(!toggleVar){
toggleVar=1;
// do whatever ... arm goes up..curtain shuts...background movie is unloaded...
} else {
toggleVar=0;
// do whatever ... .arm retracts...backgroundmovie is reloaded...curtain
opens...
}
}

i'm not sure how you want your other buttons programmed because it's not clear
what happens if one of them is pressed first.
Mr.bloodworth
6/5/2004 9:26:16 PM
hay thanks....

as for the other buttions...i just want to make shure that as i add functions
to them that the way im doing it wont interfier with others.so im guessing that
if i wer to add the next buttion...i need to change the| toggleVar=1; | to
another #? or is that a local var?

see im trying to understand the code...rather than just snag it and say
thanks......do you think you could break that down for me into "stupid"?lol

see...im confused by the varable.....is | toggleVar | put into frame frame one
_root? or...does it...do i even have to define the var? or..does your code not
use it?.....thank you for the code....BTW.....

and this part ----> if(!toggleVar){ is that stating that IF toggle
dosn't ( ! ) equil ...then do //stuff ? if it does...then do the other?

i think i confused my self....





kglad
6/5/2004 11:35:08 PM
AddThis Social Bookmark Button