ActionScript 3.0 :: Get MovieClip Color Value?
Oct 13, 2009Is it possible to get the rgb value of the movie clip on the stage.
View 3 RepliesIs it possible to get the rgb value of the movie clip on the stage.
View 3 RepliesI have a movie clip where it contains an instance of text
I able to change the movie clip and text color individually
but when i try to change both at once the text color is same as movie clip color
ActionScript Code:
myColor = new Color(myMovieClip);
myTextColor= new Color(myMovieClip.myText);
[Code].....
i have a button, with instance name lightblue_color. I am assigning a color to its color field like this: lightblue_color.transform.colorTransform.color = 0x65ffff; then i am adding an eventlistener to the button like this: lightblue_color.addEventListener(MouseEvent.CLICK, ChangeColor); Then, in the function: public function ChangeColor(evnt:MouseEvent):void {trace(evnt.target.transform.colorTransform.color);} It prints 0. Why is that? Shouldn't it print 0x65ffff or do i need to do some type conversions?
View 2 RepliesI have a movieclip I want to change the color. I am trying to do
PHP Code:
onClipEvent(load){
_root.Mc._tint = 0xff0000
}
but its not making it red.
I'm using Flash CS3. To get started I've added a movieclip to my stage which references a simple shape. The movie clip has an instance name of "myShape".From actionscript I'm trying to get the shape's RGB color. I discovered using myShape.transform.colorTransform = new ColorTransform(0,0,0,1,255,0,0,0) will dynamically change the color of my shape to red. But is there a way to read the color of the existing shape that is on the stage?
Using .transform.colorTransform.redOffset always returns 0
Using .transform.colorTransform.color always returns 0
I have 4 color squares on my stage red_mc, blue_mc, green_mc and yellow_mc. I also have a movieClip called floorTile. What I want to do is click on any of the color squares get the pixel value and have that color change the color of the movieClip floorTile
I am trying to use the colorTransform method
Code:
blue_mc.addEventListener(MouseEvent.CLICK, getColorHandler, false, 0, true);
red_mc.addEventListener(MouseEvent.CLICK, getColorHandler, false, 0, true);
green_mc.addEventListener(MouseEvent.CLICK, getColorHandler, false, 0, true);
[Code].....
I have a movie clip with instance loc1 that has to change it's color value depending on numeric value from xml file. For example if xml value is above 90: mc should be green. If it is below 70: mc should be red. how to connect that " if function" with xml number value.
//------XML file------------------------
<?xml version="1.0" encoding="utf-8" ?>
<dots>[code].....
I am trying to figure out how to color the tint of a movieclip using as3.Using as2 I would do the following :
var clSymbol:Color = new Color(mcSymbol);
clSymbol.setRGB(0xFF0000);
..and the movieclip mcSymbol would turn red.Very easy using as2 but I dont know how to do the same thing using as3.
I have a movie clip i want to change the color i am trying to do PHP Code:
onClipEvent(load){
_root.Mc._tint = 0xff0000
}
I am trying to change the color of my movieclip, but am having alot of trouble targetting it. Its within a button, that is within another movieclip, its path looks something like:
root.fullgrid.b1x1.planetfill
fullgrid is movieclip
b1x1 is button
planetfill is movieclip <---this is the one I'm trying to change color.
function change color(e:Event):void { var colorTransform:ColorTransform = target.transform.colorTransform; colorTransform.color = 0xFF0000; target.transform.colorTransform = colorTransform;
}
I am able to change the color of a movieclip on the stage, so I know the code works, its just a targetting issue.
How can i get the hex color code of a movieclip?
View 8 RepliesHappy New Year 2010 everyone :) Just getting back into the Flash groove, and having a simple question.I have a movie(video player) where the color of the buttons changes. I've already drawn out the buttons and created a 1 color box(movieClip) that will be the background of all the buttons.
I've used ColorTransform to change the color of a rectangle that I used code to create, but what is the simplest way to go about changing a color in a movieClip containing a graphic that you physically have drawn out. Path to movieClip that I need to change the HEX value of: controls.btn_Sound.colorChip
I want to randomly set the color for a MovieClip in ActionScript 3.
View 1 Replieschange a color of a movieClip?
View 4 RepliesI have some rectangulars movieclips each filled with different colors and a function that changes their color when the mouse is over them. How can i remember the initial color of the movieclip so that when the mouse is not hovering the movieclip it return to their initial color.
View 3 RepliesI want to change the movieClip color with the actionscript, but I am not able to get to how to change it
View 3 RepliesI am just looking for something that " Is it possible to change the color of a movieclip through css"? I can use css for changing text color but how I use it for movieclip.
View 7 RepliesI have implemented this code to see if it was any easier to do as part of my plan. My objective is to be able to click a square and for it to change color then click again for it to revert back to the original color BUT I want this to repeat constantly if possible as it wont do currently after the code I added:
Here is the code:
Code:
import flash.display.Sprite;
import flash.events.MouseEvent;
var box:Sprite = new Sprite();
[Code].....
Is it possible to change the color of a b/w movieclip with AS in flash 5?
View 4 RepliesI'm having a problem transforming the color of a movieclip. Until now I have this code:
[Code]...
It delivers no errors so nothing is wrong with the code, but the mc with an instance of mcColor won't change it's color when I click on the numeric stepper component.
If I have a circle and its a Movieclip and i want to change its color using Actionscript, what kind of script should I type... This wont work:
[Code]...
i have to change the movieclip color on press it, i did it. the thread is how to change the color of movieclip from two color (i,e) for example take two colors red and blue, in first press it change into red color and in second press change into blue, for third change into red, for fourth press change into blue,fifth->red.........like wise.
View 3 RepliesHow to change a movieclip's colour value using AS? Thing is I need it to fade from 1 to another, not just flick like in all the tutorials I've found so far.
View 5 RepliesI'm having a problem transforming the color of a movieclip. Until now I have this code:
Code:
var myColor:Color;
function init(Void):Void
{
[Code]....
It delivers no errors so nothing is wrong with the code, but the mc with an instance of mcColor won't change it's color when I click on the numeric stepper component.
How can I change the color of a movieclip dynamically and still keep it's filters? For example:
I have a movieclip on stage with a bevel filter on it. I then want the movieclip to change from blue to red when it's moused over and vise versa when moused out.
The color values I have are hexidecimal: 0xff0000, 0x0000ff
How can I do this? I tried colortransform but when I use that it changes color but removes filters.
On layer 2 I have my movie clips loc1, loc2, loc3....etc... inside a movie clip (Inner Main) , and on layer 1 I have a movie clip (click).
Code:-
for (i in mc) {
if (typeof (mc[i]) == "movieclip" && i != "click") {
[code].....
I'm trying to use the action - object.setRGB(0x000000) - to change the colour of a movieclip, but when i restart te file.swf it doesn't maintain the colour that I added the last time. Is there a way to save the colour added?
View 1 RepliesMy app has 2 frames; in frame 1 there are 5 MC and on a DOUBLE_CLICK event the target's color change and go to the next frame 2. In frame 2 i have a button to return to frame 1. How can i maintain the MC color when i return to frame 1?
[Code].....
I have a movie clip with 4 frames. I programatically create 3instances of it, and send each one to a different frame. If I laterapply a color transform to one of the clips, it plays through allthe frames and goes back to it's correct frame. Why does it dothat, and can I stop it from doing that?
View 4 RepliesFlash CS4. When I enter a movie clip to edit the timeline the pasteboard turns to the color of the stage. The result: I can't see the edges of my stage. This is only within the MC. And only within one particular MC (I created another one and the pasteboard stayed 4% gray). When I take the content in the bad MC (via copy frames) and move it to the good one, the same thing happens: Pasteboard turns to the color of the stage. I've tried SFT-CTL-ALT double click. No luck. Strangely, this isn't happening in every FLA. I know it must have something to do with the content on that timeline, but what that is I have no idea.
View 3 Replies