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

Making an image partially visible 1

Status
Not open for further replies.

JFRobishow

Technical User
Jun 18, 2003
87
CA
Hi everyone,

I've posted here before asking for an easy to use flash software but got no replies. I'm not a total novice when it come to graphic editing...it's not my job and probably never will be, lol.

However I'm trying to do something for a personal project and I can't figure it out.

Basically I would like for a fist to come out of the ground when I click on somewhere...now I've figured how to trigger an event onClick but can't figure out how to make the image that represent the fist appear partially (coming out)...to me it's either visible or not.

Any help would be greatly appreciated.
 
play around with the fists _alpha property

0 cant be seen

100 fully visible

to move from 0 to 100 use setInterval or onEnterFrame

quick and dirty

myButton.onRelease = function(){
fist._alpha=0
fist.onEnterFrame = function(){
this._alpha +=5
if(fist._alpha>95){
delete fist.onEnterFrame
}
}
}
 
mmmh, I don't know but that just didn't do anything, the fist stayed visible the whole time for me. The mistake is probably from me though...I played around with a single image and used this :

onLoad () {
//myButton.onRelease =
function(){
fist._alpha=0;
fist.onEnterFrame = function(){
this._alpha +=5;
if(fist._alpha>95){
delete fist.onEnterFrame
}
}
}
}

Now what I meant by partially visible wasn't a fading from 0 to 100...I meant for the image to have a coming out of the ground effect...Start with the top of the fist, continue moving to the wrist and so on. Sorry I misworded it the first time.
 
All I have is a .swi I'm working with swish max right now but I can try the same code in flash mx when I get access to it from school if you think it should work.

I've found this page talking about animated mask

Its very close to what I want if I can also make it move at the same time...

Ugh its harder than I thought it would be, lol.
 
you might want to try this. a simple maskj with a long & simple explanation

take your fist movieclip... which I assume is motion tweened to move upward.. in the first frame, put a stop action by typing: stop();
in the actions panel.
then create a new layer above your fist layer by right clicking on the fist layer & clicking new layer.
insert a keyframe in the first frame of this new layer (right click on first frame - insert keyframe).
draw a box on this frame which could encompass the size of the fist - it doesn't matter the color & size as long as the box is filled with a color & the size is big enough to encompass the fist. Place this box right above your box, but not touching. when the fist comes up through the animation, its contents should still be within the box you created.. yes, the box should be that big.

Then see what the last frame on your first layer is & then insert a frame (right click - insert frame) on this same frame, but in the new layer you created. Now right click on the new layer name you created (it should be layer 2) & choose mask.

lastly, go to the last frame on either layer & click on it. insert: stop();
in the actions menu.

What you have done is the box you created acts as a mask which means that whatever piece of the fist which is located in the box will show, everything else will not.

No, go to the main timeline & place the movieclip on the main stage... Give the movieclip an instance name of "fist". (instance name in the bottom left)...
now click on the button you created & enter the following actionscript:

on (press) {
_root.fist.gotoAndPlay(2);
}

this should work

hope it helps

Jonathan
 
Thanks for the reply Jonathan,

I'm trying this right now with Flash MX 2004, hopefully its going to work. I'll let you know.
 
Hi again,

That's definitly what I wanted, now all I need is to get used on how to work with it to make it look decent. I have a background image but everytime I import it its covering the whole thing for some reason. Send to back doesnt seem to work properly.

But I'm definitly on the right track with your post, for that you get a star.
 
Hey,

Just wanted to say I got it to work properly thanks for all the help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top