Solved

Set alpha to part of a Movie Clip

Posted on 2009-05-15
9
410 Views
Last Modified: 2013-11-11
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
Comment
Question by:TonoNam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 24401692
just make your movieclip consist of sub movieclips and target the submovieclip for the alpha properties.

ie. cirlce_mc with circleSm_mc inside.
0
 

Author Comment

by:TonoNam
ID: 24402894
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 24406577
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:TonoNam
ID: 24406743
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 24409434
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
 

Author Comment

by:TonoNam
ID: 24409593
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
 
LVL 39

Expert Comment

by:blue-genie
ID: 24428927
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
 

Author Comment

by:TonoNam
ID: 24432133
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
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 24439161
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question