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

make movie clip vanish when button is pressed 2

Status
Not open for further replies.

georgyboy

IS-IT--Management
Oct 20, 2002
197
0
0
AU
Hi,
I have no idea how to explain this problem so excuse any stupidness on my half!!
I have a picture on my movie and around the pictures are buttons, when the buttons are pressed the movie loads another submovie - my problem is that the intial movie clip wont vanish it stays on top of the loaded movie coming into flash from the button being pressed. How do i arrange it so that the intial clip vanished when a button i spressed?? Thanks for the help
 
Hi,

you can set the _visible property of the movieclip to false as soon as the button is released.
something like:

on (release)
{
_root.yourmovieclip._visible =false;

//put the code to load the other movie here.
}

Make sure you also give the movieclip the same instancename in the propertypanel as you use in the code or it won't work.


regards, goaganesha
 
you could make it vanish slowly too.
on the last but two keyframe make the film stop. this should be the state you want the user to see it. then on the last but one keyframe put this on the clip:

Code:
onClipEvent(enterFrame){
 this._alpha-=5;
  if(this._alpha==0){
  nextFrame();
  }
}

the very last frame of the timeline should be empty.

doing this you can make the clip vanish slowly and prevent the cpu from getting stressed all the time by the enterframe event since you "escape" from this event by jumping to the next (empty) frame once the clip has become invisible. regards

Firegambler
 
thanks alot for the help - it worked great and fixed my problem, hope i can help u out one day!!
 
i have the same problem again but on another site - ihave used the same code as given above goaganesha and it worked in the intial site but it wont work now in the other site i am doing ( printsandposters page) - any help will be appreciated thanks
 
the link is dead, maybe posting some fla? regards

Firegambler
 
so you want them to vanish slowly onRollOver and fade in again onRollOut? regards

Firegambler
 
i want the text to dissappear when a button is pressed, at the moment the text appears on top of the corresponding image (when button is pressed)
thanks
 
oops, didn't know you wrote something in the meantime... regards

Firegambler
 
is the text in the same film as the buttons (same level).
i guess if you posted your fla you would get an appropriate solution in a couple of minutes. to view something in context is always easier.

i could then send the solution to you by mail if you want
regards

Firegambler
 
i have uploaded them for u. u can view them at and printsnposters.fla
the thing is the movie works within the printsnposters swf (by itself) but when i watch it in the main swf the text doesnt dissappear (hope this makes sense to u)
Thanks again
 
got it, not that difficult, you gonna c!

made a new clip inside the text clip to be able to make some onClipEvent-operatíon in there and jump to another frame in the text clip. one frame is the text, next one fades the text, then jumps to image 3 which is an empty keyframe where no onClipEvent-operation is done.

watch it on

and
regards

Firegambler
 
Thanks alot, firegambler. It worked great. i really aprreciate the time u took to help me. Hope i can return the favour one day.
One more thing though - how did u make the flash movie so much bigger then what i designed it at and still be able to keep the images sharp (and not pixelated)???? Can i make the whole site that size??? That would be perfect!
regards
 
i am sorry for not being able to give you advice on that
since i didn't change anything exept the code for the fading text.

maybe you're just using some pictures of gorgeous quality? ;-)

the only difference is that i linked directly to the swf which made it adjust itself to the size of the browser window, but i guess this is no news to you. regards

tektips.gif
 
thanks again for helping me out firegambler, theres just one problem with the soultion u gave me> everytime i push a button on the printsnposter page the intial text reappears then fades again - i only need that text to appear once for the vieweer not every time a button is pIs there anyway u can show me how to do this???
Thanks again
Regards
 
sure, i'll have a look at it in the evening, let you know when it's done and load it up on the same link as above, ok? regards

tektips.gif
 
ok, fixed the bug in my script.
i added a variable that is set to 1 when clicking the postersbutton in the menu and a if-function in every button.

the if-statement asks if the value is 1, if so, the text fades, then the variable is set to 0 so that all other clicks won't perform the fading.
when the postersbutton is clicked again the variable is set to 1 again, that's it. ;-)

The solution is uploaded now. Just use the links above as i said before.

Have fun! regards

tektips.gif
 
thanks firegambler - it worked the site is finished!!!
thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top