Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Changing Color Of Imported Object



Hi,

i am trying to change color of imported swf file from another swf, let say i have a swf names fileparent and inside mc with instant name stage. in that stage i have some controls of color boxes i have imported another swf using AS on stage. imported swf have some layers with different objects of different colors i want to change color of every object separately. i dont know how to access that object inside imported swf.

just need to know the way to get inside imported object.

see an example here

http://www.bluecotton.com/studio.htm...175&garColor=1

thanks in advance



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-31-2007, 07:19 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Changing Color/alpha/etc In Imported Images
When I import an image into Flash MX, I can't chagne the alpha (transparency) or tint for that item, even though I have converted it to a graphic or button. I used to be able to in Flash 5, as long as I converted the image to a graphic or button. Am I missing a new step?

Color Object - Desaturation Of Imported Image?
Hey team,

Im scripting a learning application at the moment for Student Loans and Allowances NZ.

The look of the design calls for imported jpegs (screenshots) to be displayed desaturated, or "grayed out", then an area masked out that is not desturated... indicating the currently selected area.
(Note, this is not the same as putting an alpha'd grey box over top... )

We could do this wth two JPEGS of course... but there must be a direct method.

Can the color Object be used to "desaturate" a bitmap within flash... or has anyone written a routine to do so?

Thanks in advance,

Changing An Object's Color
i have this old piece of code:

Code:
if (Number(charinline)<=Number(linelen)) {
duplicateMovieClip("/fx_" add fx add "_0", "char" add i, i);
set("/char" add i add "/letter/lettercolor:char", key);
setProperty("/cursor", _x, Number(startx)+Number(charinline*kerning)-20);
setProperty("/char" add i, _x, Number(startx)+Number(charinline*kerning));
setProperty("/char" add i, _y, Number(starty)+Number(linenum*linespace));
charinline = Number(charinline)+1;
i = Number(i)+1;
}
... which duplicates and places mc named "char[i]" on the stage based on predetermined _x & _y values, now i need to change the color of said mc. how can i do that? i've been trying to find a way but i gave up after 3 hours.

any help will be greatly appreciated

thanks much
- w

Changing Object Color With AS
hi I am trying to make a smooth color transition using AS2

the way I have now the mc changes colors just fine, but not smooth like when you use tween. I know there is a 'get Transform' function but I don't know how to apply maybe someone has an example??


Code:
function changeBG(col) {
var c = new Color(_root.bg);
c.setRGB(col);
}
changeBG(0xCC3366);

Can I Get Some Help With Changing The Color Of An Object?
I'm trying to make the following - I have 5 buttons corresponding to five sections in my Flash movie..I want to make it so, that when I click on a button it background color changes(to show that it was clicked and I'm in that section)...
The button is located inside a movieclip(not in the root timeline)...
For the purpose I converted the background of the button (which I want to change) to a movie clip, so I could use the "setRGB" command, but still I'm doing something wrong and nothing happens...
Can someone explain to me clearly the mechanism of changing the color of a movie clip?

Thanks in advance!

Changing The Color Of An Object
Hi

I want to make something like a children's paint book. The user will choose the color from a palette and when she clicks an object, that object will seem in that color.

Anyone knowing a tutorial about it, or any suggestions on how to accomplish this?

Thanks in advance

Changing The Color Of Clicked Object
Hi,

I'm looking for a way to change the color of the object that I click on. Something like a paint program where you first click to select the color and then click on the place which you want to color.

Thanks

Greg

Changing Instance Or Object Color
does anyone know of a script that will change an object color?

eg: I have a white box, on button1 press I want it to go blue, on button2 press it will go red etc.

so is it possible?

thanks if anyone can help! would be tops!

zanga

Changing The Color Of An Object At Every Execution
I have a problem:

I have one file, template.as, this file keeps color configuration to make changes of my site.
I would like to know if it is possible to change color of an object every time of execution (run time).
I am using setRGB() function to make these changes.
The variable that defines the template that will be used is loaded with loadVariablesNum() function.
My script works only when I compile my movie clip (generate .swf)
I want to change the colors without having to "compile" my movie every time.

If someone can help me with other functions or any other way to do this, I will be very grateful.

Thanks

Changing The Color Of An Object In Actionscript
Is it possible to change the tint/color of an object in Actionscript and if so, how?

Cheers

Gradually Changing The Color Of An Object
What I want to do is to transition the color of an object to a different color gradually. In other words, in frame 1 i have a light gray circle. In frame 30, I have a dark gray circle. I want to show a smooth transition from the light gray to the dark gray. Can this be done with a motion tween?

Changing Object Color Using ActionScript
First hello to everyone from a newbie

And now to the problem..i want to change color of an object via AS, which seems simple enough but stay with me. Id already seen http://www.kirupa.com/developer/actionscript/color.htm but here the object processed is made of multiple rectangles and my object cannot be really made of it. To be more precise, i want to create an image of an house and change it's color. I tried drawing it with lines, then making it a symbol and change it according to the tutorial but all i accomplished is changing the color of lines.

Anyone has another suggestion?

Thanks in advance

So Easy, I Can't Do It - Changing Object Color
I draw a circle on the stage.

I select it and save as symbol, i call it mc_circle and "export to action script" as my_mc_cirle

I cannot get the circle to change color using what I imagine should be a 1 liner. Very frustrated


my_mc_circle.setRGB(0x0000CC);
and
mc_circle.setRGP(0x0000CC);

are doing nothing??

Changing The Color Of An Object/movie Clip
I had an object that I wanted to be visible and invisible at my choosing... had to change it to a movie clip (this seems silly to me... you should be able to do it to objects)... but now I want to change the color of this movie clip object at the click of a color... how would I go about doing this... I tried this without success:
c=new Color(img_boy);
c.setRGB( 0x000000 );

Thank you

Changing Fill Color And Line Color Dynamicly And Seperately
Hi community,

In this case, I am going to load a swf with a looping animation colored in black and white only. I want to change the color of the animation dynamicly so that I could have different color at each time. Here is my code:


Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import flash.display.*;
import flash.net.URLRequest;

private function init():void{
myCan.addEventListener(Event.ENTER_FRAME,capMotion);
}
private function capMotion(event:Event):void{
var bmd1:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0x00CCCCCC);
bmd1.draw(mySwf);

var bitmap1:Bitmap = new Bitmap(bmd1);
bitmap1.x = 0;
bitmap1.name="org";
if (map.getChildByName("org") != null){
map.removeChild(map.getChildByName("org"));
}
map.addChild(bitmap1);
var bmd2:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0xFFFFFFFF);
var pt:Point = new Point(0, 0);
var rect:Rectangle = new Rectangle(0, 0, mySwf.width, mySwf.height);
var threshold:uint = 0xFF999999;
var color:uint = 0xFFFFFF00;
var maskColor:uint = 0x00FF0000;
bmd2.threshold(bmd1, rect, pt, ">=", threshold, color, maskColor, true);

var bmd3:BitmapData = new BitmapData(mySwf.width, mySwf.height, true, 0xFFFFFFFF);
threshold = 0xFF000000;
color = 0xFF00CCCC;
maskColor = 0xFFFFFF00;
bmd3.threshold(bmd2, rect, pt, "==", threshold, color, maskColor, true);

var bitmap2:Bitmap = new Bitmap(bmd3);
bitmap2.name="dup";
bitmap2.x = bitmap1.x + bitmap1.width + 10;
if (map.getChildByName("dup") != null){
map.removeChild(map.getChildByName("dup"));
}
map.addChild(bitmap2);
}
]]>
</mx:Script>
<mx:Canvas id="myCan" x="10" y="10" width="650" height="603">
<mx:SWFLoader id="mySwf" width="100" height="250" horizontalCenter="0" verticalCenter="-7.5" source="dance.swf" complete="init()" scaleContent="false" autoLoad="true"/>
<mx:Image x="61" y="320" width="550" height="152" id="map"/>
</mx:Canvas>
</mx:Application>
It works quite fine but I afraid that it's quite resource consuming using enterframe and bitmap drawing. Is there any better method?
Thanks for help.

How Would I Go Changing Lots Of Movieclips Color And Border Color Seperatly?
I am in the making of a isometric level editor, and I have about 15 movie clips with more to come.
I want to let people change the color of tiles to what they want from a list of colors, so how can I let them change the color of a tile dinamicly with actionscript so that it changes a tile's color while preserving changes of "shadows"?
I mean I have let's say a cube and to make it look 3D I need to change each face to make a feeling of 3D and not a flat one.
thanks.

Changing Color On RollOut Then Back To Color After 2 Seconds
I am using the code below to make a shape turn color using on rollOver, then on rollOut is changes to a differant color(blue), then I want it to change back to the first color(white), either on another rollover or I perfer to make it change back to the fist color after a 2 seconds,

on (rollOver) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x006699);
}
on (rollOut) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x006688);


I want to be able to rollOver change color, onRollOut Change color again, then back to the first static color after 2 seconds.
Anyhelp would be great Thanks

[CS3] Changing Color (and Opacity Of That Color) Of Movie Clip
Hi. I have a pretty large movie clip filled with pngs. It's a sprite for a game and I want to change it's color. The setRGB method works, but I can't figure out how to set the opacity of the color. I don't want to change the alpha of the movie clip itself, just the color I'm applying to it so that it's just a shade over the normal images.

Is there any way to do this?

Changing Stage Color When Changing From Scene
Hi,
I would like to change the color of my stage when I get in my next scene, is it possible?

So when people look to the movie Scene one should be black and scene 2 white. Don't tell me to put a big white square at the button of scene 2 coz when put it online I want all my window to change from color.

Thx

Color Changes On Imported Files...
I've been working on a project where I need to import some graphics as either jpgs gifs or png files. When I import the files the color is really different, a lot lighter than in the photoshop file when I convert it to a gif. Is there a way to not get this color change or is it just the way that Flash works. Is there one type of file that is better to import than another? Any help on the subject would be appreciated....

Thanks a lot!

Change Color Of Imported Swf
I am importing path01.swf into my main Flash movie. Is it possible to alter the imported swf with actionscript in the main movie?

What I hope to do is change the color of the imported swf. Does anybody know if this is even possible?

Change Color Of Imported Swf?
I am importing path01.swf into my main Flash movie. Is it possible to alter the imported swf with actionscript in the main movie?

What I hope to do is change the color of the imported swf. Does anybody know if this is even possible?

Color Desaturates When Imported From PS To CS4
Sorry if this has already been mentioned, I did do a search but didn't find anything.

I've got some images that Ive made in Photoshop CS3. I'm trying to import them into Flash CS4. However, whenever I try to import to library, the images come out desaturated - the color seems a lot lighter, and doesn't have the intensity that they have on PS.

I've tried importing with all sorts of different file types, PSD, PNG, GIF, JPG - all come out with varying results, but still all of them are no where near the color they should be.

I think I might have a colour profile set on PS, but whether I save with or without that profile, I get the same results.

If I import the image to CS4, then right click the image and go to edit it with PS, the image looks absolutely fine in PS, but within CS4 it loses color?!

Am I being thick and there's a simple solution here? Any help would be gratefully received!

Thanks in advance

Imported Video Off-color?
I'm doing something in flash that requires me to import video, and when I import a .mov file with a white background, it appears in flash as more of an off white, but that won't work because it goes on to white and is really easy to spot the error. Is there anything in the Flash import settings that could help me here?

Imported Video Off-color?
I'm doing something in flash that requires me to import video, and when I import a .mov file with a white background, it appears in flash as more of an off white, but that won't work because it goes on to white and is really easy to spot the error. Is there anything in the Flash import settings that could help me here?

Changing Imported Images
Is there anyway to change an imported image into an actual flash type object that can be used like any object created by flash?

Because I want to use an imported image for a masking effect, but its a gif so i dont know how i would transfer a pixel image into a flash vector. I had to make that image in pixel format just to clear that up.

Thnx in advance

Imported Palette And Color Control.
hi !

i would like to ask you, how to use the colors of an imported color palette via actionscript ?
is there an array or something that contains the 256 colors of the used color palette, and how can I use it with actionscript ?

thanxxx in advance,
digiscarpa

Color Selecting From Imported Image
I'm building a backend for my flash website where I can upload photos.

I want to be able to load an image into flash, and select a color using my mouse, much like you can do in photoshop with the eye dropper tool. just mouse over the part of the picture you'd like and click and the colors get sampled.

Is there anyway to do this that you know of? Taking a color analysis of the pixels underneath the mouse when it's clicked?

If there's a better way to do this, DHTML, javascript please let me know.

Thanks.

Custom Imported Color Swatch Pallets
I want to scan construction paper and import those files as color swatches so when i make my next movie it will have a texture that plain colors cant establish. But given i can import jpgs or gifs as a color swatch, if you use the current multi color swatches it will scale to the shape. So my questions are 1) is it possible to import a picture and have it act like a color and how, and 2) if i can do that how do i disable the automatic scaliing of the picture?

Thanx

Problems With Color In Imported Html Text
I am using FLASH MX Professional 7.0

I found a tutorial that showed me how to import text from an external .txt file into a scrollable window within my flash file.

I was able to make it work but there is one problem. . . . although the html text links in the .txt file work when they are imported into flash, neither the color of the link nor the underline shows up.

I added extra html code to the .txt file to try to incorporate the color of the text links and underline effect of the text. It seems like the underline and bold functions do transfer into the flash file but the color doesn't.

The color seems to be affected by whatever I chose as the attributes for the text box I had created in flash for the imported text to flow into. If I choose the text box and then go to the options palate and choose red, ALL the text is red. If I choose black, ALL the text is black. It is as if Flash is overriding the color coding I had put into the .txt file.

Is there any way to fix this or to work around it?

peace,
cc

Imported Jpgs Loose Color Intensity...
Being new to Flash I have run into a problem. I have really nice photographs in jpg that have great color intensity. When I import them in Flash "Place on Stage" the colors look boring and faded... What is the solution to this basic task?? I have tried importing the photos as jpg, png, psd and they all look horrible comparing to what they look like in Photoshop...

Thanks in advance!

Anna

Imported Video Loses White Color
Hi,
I have a video with a pure white background (255,255,255). In fact my test video is just a white screen for 10 seconds.
No matter what format I import it into flash in, when it is in flash the white has gone ever so slightly grey. Usually 254,254,254.

this is causing me real problems.
How do I make the white stay white?

Many Thanks
Simon

HELP Image Imported To Library Shows Up A Different Color...
alright this is driving me insane!

i made the jump from windows to apple a few months ago and this is my first development on the mac, so i don't know if there's something i'm not doing right or what cause i never had this happen on windows...

i created a site layout in photoshop cs2 and i exported it as a .png file. now i want to import that layout into flash 8. but when i import it into flash, the rich color of green i used is now a really crappy washed out green. what gives?! does it have to do with "web safe" colors or something?!

just open the attached .png in photoshop and see it as it should be. then try and import it into flash and watch it get all messed up!

i know what some of you might say... just export the white areas from ps to flash and avoid the green in the backgorund. i'd like to, but the green in the lower left where the logo is should look like it's "floating" in the background and a part of the menu system.

anyway... i'm at my wits end... can someone please point me in the right direction so i get get on with development?! thanks!


: : michael

Changing Alignment Of Imported Captivate Movie
Hi,

Thanks for the forum, I really hope somebody out there can help me with this simple problem that I cant solve!

I import a captivate project/movie into my flash document. I want to change the document size, however, since after the captivate elements are imported, I will need some space on the left for a slide-in navigation bar(about 20pixels) and also a 1px space around the edges.

- So the captivate resolution im importing is 800X600.
- I import it into flash, and then change the document size to 820X602, to allow for the button/navigation menu on the left and the border.
- Everything works perfect, except that the extra 20 px space I need is on the right instead of the left.
-Here is my question:

When importing the captivate movie or any other movie for that matter or flash file, how can I align the new imported movie and all its elements/objects to the right?

The captivate file is huge and I cannot align each item individually!

Thanks a million!

Change Color For More Mcs With Color Object At A Time
This changes color of one mc:

Code:
myColor = new Color(myMovie);
myColor.setRGB(0x993366);


Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you

[F8] Color Swatch Or Change - Color Object?
You know how on retail sites or even a car site you can swap the color by clicking on the swatch and than the image changes the color. I wanted to do this in flash preferably with actionscripting but I have NO CLUE how to do it. Can anyone show me a tutorial or advise me o how to do this. This is just a BASIC example in flash five but this is the same concept I want. http://www.adobe.com/support/flash/i...y/colorobject/ If anyone knows of a high level example with tutorial I would appreciate it.

Turtle

Change Color For More Mcs With Color Object At A Time
This changes color of one mc:

Code:
myColor = new Color(myMovie);
myColor.setRGB(0x993366);
Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you

Setting The Color Of Multiple MCs Using One Color Object
Hiya I am making a movie that has to be published to Flash Player 6 and want to set a bunch of movie clips to have the same color. Here is my function:

ActionScript Code:
var fillObjs_ar:Array = [square_mc, circle_mc];function colours(array:Array, color) {       for (i=0; i<array.length; i++) {        var my_color:Color = new Color(array[i]);        my_color.setRGB(0x+color);    }}colours(fillObjs_ar, FF0000);

My problem is that I get the error message:
"Hexadecimal digits expected after 0x" referring to the 4th line of my function.
If anyone could help me out it would be really appreciated.
Thanks
Schm

Change Color For More Mcs With Color Object At A Time
This changes color of one mc:
Code:

myColor = new Color(myMovie);
myColor.setRGB(0x993366);

Is there a way if I have dozen of mcs to change color at a time for all this mcs?

Thank you

Changing Imported Image With Layers To Movie Clip
Yes I have imported an .ai file into flash with several layers on it. When I then converted it to a movie symbol it flattened all the layers down. How can I convert it and keep the layers editable?

Using An Imported Masking Object
hey dudes and dudets.. whats up
i was wondering if i can use an imported png-24 as a mask image in flashmx. I have tried it and for some reason it doesn't work. is there any other way to do this. Does flash recognize an imported image as a mask.

Using An Imported Masking Object
hey dudes and dudets.. whats up
i was wondering if i can use an imported png-24 as a mask image in flashmx. I have tried it and for some reason it doesn't work. is there any other way to do this. Does flash recognize an imported image as a mask.

[F8] Problem With Changing "Shape Fill Color" Color
Hi guys,

I am having some trouble trying to figure out how to change the Shape Fill Color for the corner which is currently in #FF6600.

Can someone advise me how I can access this attribute?

See files attached.

Imported Sound Object Not Playing
I have two swf files.

I have one swf file which contains and image, and a sound object, and one simple sound effect. This sound, and script, functions perfectly in this swf file. The code for which is below.

s1 = new Sound();
s1.attachSound("Gunshot");
s1.start(0,1);

I then import this entire swf file into my main swf file however, in doing so, the sound that once works, no longer does. I can't figure out why the sound works in the swf file, but not when that swf gets imported. Any ideas? Am I missing a target path or something?

Thanks-

Hex Color As Variable In Color Object?
im trying to do this

myColor = new Color(myMC);

myColor.setRGB(variable);

we have all of the colors we need in css info in a database but im attempting to use the same values in flash. i can load the variables in fine but when i try to set them as a hex color it just assumes the letters are hex colors.

any suggestions

Background Color With Color Object?
Hey guys, quick question, is there a way to control the background color of a flash movie using the color object or some other way? i would like the entire window (html background included) to change, so sticking a stage-size movieclip in the back wouldn't help. Thanks .

Color Changing
Hi all,

i created a movie clip, in it's time line i put the action to rotare random 360 degree, it is working fine, like that i need to change the color of this movie randomly (RGB values 255).

thanks a lot for your replay.

naushad

Changing The Color Of A MC
Ok I hope that I can explain what Im after. I would like to make the color of a MC change (Morph) to the next closest value. Like gradually changing. Not just from RED to GREEN but more like red to reder to redest to dark red and so on. I hope someone can help..

Changing The Color On MC
ok i have found a script that will change the color of the MC gradually. BUT, I want it to change the R from 0 -255 then stop and staret to change the G from 0 - 255 And so on. What I have now is setting all the VAR to change the RGB al at once. Here is the code.


onClipEvent(load) {
colorFace = new Color(this);
var cnRedStart = 50;
var cnGtreenStart = 115;
var cnBlueStart = 152;
var cnRedRange = 150;
var cnGreenRange = 116;
var cnBlueRange = 80;
var i = 0;
var ldir = 0;
_root.lPlaying = 1;
}

onClipEvent(enterFrame) {
if (_root.lPlaying) {
nRedSkin = cnRedStart+(i*.01)*cnRedRange;
nGreenSkin = cnGreenStart+(i*.01)*cnGreenRange;
nBlueSkin = cnBlueStart+(i*.01)*cnBlueRange;
i = (ldir==0 ? i+1 : i-1);

colorFace.setRGB(nRedSkin<<16 | nGreenSkin<<8 | nBlueSkin);
}
}
What I want is to controll the colors one at a time not all at once.

Copyright © 2005-08 www.BigResource.com, All rights reserved