Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 419
  • Last Modified:

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?
0
TonoNam
Asked:
TonoNam
  • 5
  • 4
1 Solution
 
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
 
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
blue-genieCommented:
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now