sponsored ads

how to change fill color of MovieClip Actionscript 3

sponsored ads

how to change only fill color of an instance on the stage. this is my code:
function paint(){
var myColorTransform:ColorTransform = new ColorTransform();

myColorTransform.color = someColorNumber;

coloredObject.transform.colorTransform = myColorTransform;

}

thanks Asked Apr, 22 2011
add commentflag 

sponsored ads

answer this question

1. Click on the Rectangle Primitive tool. Use the slider in the Property Inspector to set the Corner Radius to 10 for all four corners. Now you can draw a rounded rectangle.

Using the slider in the Color panel, I also reduced the Alpha of the rectangle to 50%. This helps the rectangle blend with the parchment.

2. For my example, I decided to use the simple "Close" text on top of my close button. After I add the text, I want to treat the button and the text as one object – the button. Select the rectangle and text and click Modify – Group to group them together. Go to the Property Inspector and make note of the X and Y position of the button. You will need this.

3. Select the button and convert to a symbol. In the dialog box, set the following values.

Name – CloseButton_Bio
Type – Button
Registration – Upper Left Square
Export for ActionScript – Checked
Class – CloseButton_Bio

In the Properties Inspector, set the Instance Name for the button to "BioClose".

You can now delete the movie clip and the button from the stage because we have both originals in the Library.

4. On Frame 1 of the Actions layer, open the Actions panel. Add the following code to the ActionScript code we programmed in the first tutorial. This new code will place the Close button on the stage with the Bio movie clip when the AboutButton is clicked. Then, it will remove both the Bio movie clip and the Close button, when the Close button is clicked.

AboutButton.addEventListener(MouseEvent.CLICK, goBio);
function goBio (e:MouseEvent):void {
var newBio:BioParch = new BioParch();
this.addChild(newBio);
newBio.x = 25;
newBio.y = 45;

var newBioButton:CloseButton_Bio = new CloseButton_Bio();
this.addChild(newBioButton);
newBioButton.x = 675;
newBioButton.y = 60;

newBioButton.addEventListener(MouseEvent.CLICK, closeBio)
function closeBio (e:MouseEvent):void {
removeChild(newBio);
removeChild(newBioButton);
}
}

Notice that we have placed this new code inside the goBio function. The first section of the new code will add an instance (newBioButton) of the CloseButton_Bio button to the Display list and place it on the stage at the same X and Y position that you copied down earlier. The next section of code will add an Event Listener to this newBioButton which will run the closeBio function. This function will remove the newBio movie clip and the newBioButton from the Display List when the newBioButton button is clicked. Removing these from the Display List will remove them from the stage. Answered Jan, 16 2011
vote up 1 vote down

hi, I am glad to answer your question. It is a little case if you follow the steps in the site below. good luck
www.ehow.com/how_8283742_change-tint-actionscript.html Answered Jun, 30 2011
vote up 1 vote down

well,i think the second solution must be what u want.

ONE:

ou can make a simple box_mc to the dimensions of the Stage.

You can use the "100%" parameter in HTML to keep the window all the way to the edges. Then use the "Stage.scalemode" property and set it to "noscale" (that property is a string) for the MC with the content.

Now you have what seems to be a HTML background that is controllable in Flash. You can still place HTML content around the Flash content using CSS. One issue: your Flash content will be centered. You may be able to use an onEnterFrame to maintain the X and Y position of your content MC and keep it in a certain place when the Stage is resized... good luck.

TWO:

Creating a colored gradient background for your SWF movie via ActionScript   (recommended)

 

Answered Aug, 06 2010
vote up 0 vote down

Your Answer

community wiki:

The Verified Code is to stop spamming. It will be hidden once your reputation reached 100.
or
Create one

Options

sponsored ads

Download related software from AFC

Fill-in Drummer 2.0

Last Updated: Mar 17, 2011
License: Shareware
Filesize: 900KB

Continue to downloadPower by Afreecodec.com