Link to home
Start Free TrialLog in
Avatar of TonoNam
TonoNam

asked on

Set alpha to part of a Movie Clip

If I have a MovieClip called square_mc which consists of a square is it posible to set its alpha to .5 but just in a specific part of square_mc? for example if I have a movie clip called circle_mc could I set the alpha of square_mc to .5 but just in the center of the movie clip and as big as circle_mc so that it looks like a square with a circle in the center because the alpha of the circle is less?
Avatar of blue-genie
blue-genie
Flag of South Africa image

just make your movieclip consist of sub movieclips and target the submovieclip for the alpha properties.

ie. cirlce_mc with circleSm_mc inside.
Avatar of TonoNam
TonoNam

ASKER

If I always want the square_mc to have its alpha in the same spot then I will def construct a movie clip that consists of a square then I will delete some portion of it in the center and then draw a cirlce that covers that deleted area of the square and then it will be easy to set the alpha of that circle to .5 using actionScript. What I have been thinking is that if I could make a hole to the square erasing some data and then pasting another instance of the square on top of it with an alpha of .5 then that will be great but how could I create a hole in a movie clip?
how you'd create a hold in a movieclip would be exactly as you described - delete the portion of it.
if you draw a shape ontop of another shape and delete it - or in your case select it and make it a separate movieclip then you'd have your hole.
Avatar of TonoNam

ASKER

how can i draw a shape. I already draw a circle on top of the square then i remove the child square but there is no hole on the square. How do i make sure that i am drawing a shape and not an object drawing and also if the square is already on the stage how cold i reference that shape.
are u using cS3 or 4?
surely if you want a hole in a square you'd delete the circle and not the square?

if CS4 refer to your help file - i'm using CS3.

CS3 Help file.

About drawing objects
Drawing objects are graphic elements you create with the Flash drawing tools in object drawing mode. When a tool is in object drawing mode, the shapes you create with it are self-contained. The stroke and fill of a shape are not separate elements, and shapes that overlap do not alter one another.

Depending on your drawing style and the content you want to create, object drawing mode may be best suited to your goals.

To enter object drawing mode
Select the Object Drawing option in the Tools panel.
Select a drawing tool from the Tools panel and draw on the Stage.
Avatar of TonoNam

ASKER

I am using cs4. How could i do that using actionscript. And sorry I ment to delete the circle and not the square on my last comment.
are you trying to draw a square with a hole with script or using the drawing tools directly on the stage?

refer to your specific help file i don't have CS4
Avatar of TonoNam

ASKER

I am trying to do everything with script. Thanks for your help. I already god rid of this part of my game. I figured it might get to complicated. I am actually creating destructible terrain so that whenever a bomb_mc hits the square = terrain_mc I could create a hole in that spot so that next time the bomb passes through that spot it does not collide with the MovieClip terrain. I downloaded some .AS file that will detect collisions between different objects and it can exclude colors and alpha but for some reason the bomb slows down meanwhile it is passing through a color that I excluded. Thats why I wanted to try to create a hole in a movie clip rather than draw a circle of the color of the stage (color excluded in collisions) because when the bomb passes through those circles the bomb slows down.
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial