Solved

Set alpha to part of a Movie Clip

Posted on 2009-05-15
9
402 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
  • 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
 

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now