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?
TonoNamAsked:
Who is Participating?
 
blue-genieConnect With a Mentor Commented:
you're in a bit of a predicament I'd say, as you can easily draw basic shapes with the drawing api and control the colour/alpha with that but to do terrains with code might be another issue of note.
I misunderstood your original post I thought you were drawing the items on stage.

good luck.
0
 
blue-genieCommented:
just make your movieclip consist of sub movieclips and target the submovieclip for the alpha properties.

ie. cirlce_mc with circleSm_mc inside.
0
 
TonoNamAuthor Commented:
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?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
blue-genieCommented:
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.
0
 
TonoNamAuthor Commented:
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.
0
 
blue-genieCommented:
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.
0
 
TonoNamAuthor Commented:
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.
0
 
blue-genieCommented:
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
0
 
TonoNamAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.