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




Loadvariables Movieclip Color Change



I want to change the color of a movieclip, by only having to change the hexidecimal code in a text file, that is loaded in the previous frame.

I can load text in to a movieclip. so the it is loading.
here is the color change code im using.

ActionScript Code:
cCircle = new Color("mcSquare");    cCircle.setRGB(var2);
in the text file &var2=0x3399ff

is what im doing right or is it completely wrong?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 04-20-2005, 04:44 AM


View Complete Forum Thread with Replies

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

How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi

I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.

Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
my_color.setRGB(normalcolor);
};
Thanks in advance

How To Change MovieClip RollOver Color(NOT Single Color, But Gradient) Dynamically ?
hi

I have created this for single color.But how to change when it is a gradient color.
for single color rollover code.

ActionScript Code:
rollcolor = "0xFF0000";
normalcolor = "0x339900";
my_color = new Color(my_mc);
my_mc.onRollOver = function() {
    my_color.setRGB(rollcolor);
};
my_mc.onRollOut = function() {
    my_color.setRGB(normalcolor);
};
Thanks in advance

Change Movieclip Color
Code:
rightArrow_btn.onRollOver = function(){
myColor = new Color (_root.leftArrow_btn);
coltrans = {ra: 100, rb: 50, GA:100, GB: 50, BA: 100, bb: 50, AA: 100, AB: 50};
myColor.setTransform (coltrans);
}

I am trying to change the color of my MovieClip, but nothing happens.
The MC consists of 2 pieces:
1-a black rectangle behind a
2-white triangle.

Has this got something to do with it?
The MC can't be a button, because it needs its level changed and that can't be done with a button (at least as far as I know)

What I really want is to change the color of the triangle, but since I can't get this to work...suggestions anyone?

Change MovieClip Color
Hi.

I have created a movieclip that has a rectangle in it.
how can I change the rectangles color from the main movie?

Change MovieClip Color With Xml
Howdy All!
I am having a hell of a time with this. I have a map where each region is a movieclip with some roll-over functionallity. All I want to do is call an xml file with a list of the MC's that has a hex color for each region when the swf is loaded.

The reason for the xml is that the client wants the colors to be editable, but cant work in the fla.

Can someone help? Thanks a ton

How Can I Change Movieclip's Color ?
Hi ! Everyone.

How can I change movieclip's Color like I create tween Motion with property Color - Tint.

I want my movieclip change from green to red.
thank you so much.

Best regards.

To Change Movieclip Color Should I Use BeginFill?
I'm trying to dynamically set the rgb value of a movieclip, can this be done using 'beginFill'? If not, how can it be done? If so, why doesn't the code below work for me?


topBar.beginFill (0xFF0000);
topBar.endFill ();

Change A Single Color In A Movieclip?
I've been experimenting with ColorTransform to change the color of a movieclip but the problem is it changes the entire clip the new color. How can I change only one of the colors to a new color? I have a movieclip with an outline that should remain untouched so only the fill area should be changed.

Also, there is a gradient applied to the movieclip that I would also like to retain on top of the new color... ColorTransform seems to wipe out the gradient as well.

Thanks for any help,
Brent

On Press Change Color Of Movieclip
Hi again!
I got this code from Billy T so that the alpha is changed by pressing a movieclip. Now I wonder if there is a way to change color of the movieclip instead of changing alpha. I use Flash8.

Code:
for (q=0; q<16; q++) {
_root["S"+q].onPress = function() {
this.setRGB (0x822A03); ????
//this._alpha=40;
}
}

MovieClip Doesn't Change Color
I've created a new MovieClip with the instance name "box".

Now, when I like to change its filling color with "box.beginFill(0xFF0000,100);" nothing happens.

Shouldn't that usually be a very simple thing to implement ?

Thanks. Thomas

Text Color Change In MovieClip
Hello,
I have a MovieClip which consists of two layers, one layer is a round circle and the second layer is dynamic text on top of the circle. I want to change the color of the text, does anybody know how to do this? I have tried :
Code:

whichArray[j].transform.colorTransform = mycolor;


but this colors the whole entire circle and the writing so that i can no longer see the writing. Any ideas anybody? Thanks in advance

Change Movieclip Color & Text Through Dynamic Txt
Ok, I am developing an interface for a client (to display in their office, not web based). I need to include a way to let the client (not Flash or programming savvy) to update part of the interface saying whether or not property has been available, pending or sold. This will change a circle's color and a word (for example, "Sold!" and the circle would now be red). I can make this work through a dynamic txt file, but I have to use 2 txt files (one for the color and one for the text). My questions are these: How can I make this as simple as possible for the client? I would like to change the txt file so they just input "red" rather than "0xCC0000", and not have two txt files. (when I try to integrate them, the circle turns black rather than the color I specify). Lastly, how would I integrate a database if necessary?

My code on the frame:


Code:

// *************************** //
// MovieClip.setRGB() method //
MovieClip.prototype.setRGB = function(newColor) {
(new Color(this)).setRGB(newColor);
};
// end MovieClip.setRGB()
// *************************** //
var a = new LoadVars();
a.load("properties.txt");
a.onLoad = function(success) {
if (success == true) {
trace("Text file load successful");
// variable representing hex number
circle = new Color("lot1");
nColor =_root.a.lot1;
circle.setRGB(nColor);

} else {
trace("Error: text file did not load properly!");
}
} // end onLoad()
loadVariablesNum("propertiestext.txt", 0);



And my color txt file (properties.txt):

&lot1=0xCC0000


And the word txt file (propertiestext.txt):

&lot1status=Sold!
&textloaded=OK


All help is appreciated! Thanks!!!

Quicky: How Do I Change The Background Color Of A Movieclip?
How do I change the Background color of a movieclip?

Raymond

How To Change Color Of A Movieclip From An External Call
Oh! What a nice forum...

I am using Flash MX in a VB application. Can anyone help me the simplest way to change the color of a movieclip at root level from a VB (Call ShockwaveFlash1) call?

Thanks in advance

Quicky: How Do I Change The Background Color Of A Movieclip?
How do I change the Background color of a movieclip?

Raymond

How Do I Change The Color Of A Movieclip Each Time It Loops?
I have a hexagon that follows a motion path.  This motion path is a movie clip, and so is the hexagon inside the motion path movieclip.  Each time it loops I want it to randomly choose between 4 colors.  Any ideas?  I was trying to create a function using the Color object, but it didn't seem to work for movieclips inside a movie clip for some reason.  Any help would be great.  Thanks in advance.



Change Color Of Movieclip To Match Another Movicelip Using Actionscript
I have buttons that use setRGB to change the color of movieclip "A". I want movieclip "B" to match the color of moviclip "A" but I don't want to have to go in and add that code to every button (There are a lot of them). I there a way to tell movieclip "B" to match the color of movieclip "A"? I was thinking about creating movieclip "C" and having loop. Then in frame 1 of the actionscript layer of moviclip "C" I would add code that checks the rgb of movieclip "A" and sets moviclip "B" to be the same. I'm just not sure how to write the code.

Change Saturation Movieclip Via Actionscriptor Color Matrix?
hi,

i was reading the help and discovered i can change the filters thru as, but can't seem to figure out how to change the saturation.

I want my image to be black and white and go back to color upon rollover.
i have done it with a separate bw image but i think, at least, that it would reduce my file size by doing it with actionscript. is that true?

this is the code in help:


Code:
var myFilters = fl.getDocumentDOM().getFilters();
for(i=0; i < myFilters.length; i++){
if(myFilters[i].name == 'adjustColorFilter'){
myFilters[i].saturation = 0;
}
}
fl.getDocumentDOM().setFilters(myFilters);
doesn't work when set on mc.
don't know where to insert my movie clip name???
do i need to do the color matrix? which is even more confusing.
is this the right code to use? or is there something simpler?
thanks
hope all is well

How To Change Color Of Nested Movieclip Dependent On Loaded External Swf
Greetings! I am making a Flash website. Each "page" is loaded using the mx.controls.Loader. My navigation menu is simple: when you hover over the link, the text instantly changes white, and a colored box appears behind the text. This is the code (only two buttons) :

Code:
//LOADER
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);
mcLoader.loadClip("home.swf",myLoader);

// Include MC Tween
#include "mc_tween2.as"

//Assign BreadCrumb Functions and Load External Movies
home_bn.onRelease = function () {
mcLoader.loadClip("home.swf",myLoader);
}

events_bn.onRelease = function () {
mcLoader.loadClip("events.swf",myLoader);
}

}
QUESTION: How do I make all the colored boxes in the buttons change color depending upon what "page" is being viewed.
Please note that I have tried making the buttons as Movieclips, with the colored boxes as child movieclips, then using the colorto AS, but it does not work...

Does anyone have a suggestion?

Flash Script - Change A Movieclip's Color In Flash
This is a dedicated thread for discussing the SitePoint article 'Flash Script - Change a Movieclip's Color in Flash'

LoadVariables And Color
Is it possible to load variables into a static (or other) textfield and use different colors for each or some letters?
So var1=Airport
I load var1 and want the A to be red, irpor to be blue and t to be black.
Or do i have to load each letter with dif. color into a var.?

Loadvariables>textfile>color
I'm trying to load a color from an external textfile.

In my textfile I got the follwoing script

&colorbackground=0x226666

In the Flash movie I got

myColor = new Color(_root.background);
myColor.setRGB(colorbackground);

Besides the color I'm also loading texts and x,y positions from the textfile without any problem, but i got stuck with the color.

To test the script I moved the one liner out of the textfile into the Flash movie, and it was working nicely, but as soon I put the same line in the external textfile nothing happens.

Any ideas?

Hex Color Code To Change Movie Clip Color
Hi all, Sorry real quick,

i've got a text box with the text with a hex code from a color picker which reads say "FF0000" how do i use that hex code(FF0000) to change a movie clips color.

simple (me stupid)....

thxs for any help

jon

Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.

I can accomplish the change as it passes over a frame, but I can't get it to change back.

In the frame is this:


ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);

Trying to keep this simple....

Return MC To Original Color After Dynamic Color Change
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.

I can accomplish the change as it passes over a frame, but I can't get it to change back.

In the frame is this:


ActionScript Code:
cHurtColor = new Color(_root.compMC);cHurtColor.setRGB(0x00FF33);

Trying to keep this simple....

Button Change Color On Select, Then Change Back
I have 3 buttons, named but,but2,but3. What I want is if you click a button it changes color to show what page your on. But when you click a different button now that one is highlighted and the original one goes back to the original color. Here's the code.
but3.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("banner3.swf", "container");
container._x = 0;
container._y = 0 ;

I figure I have to add some kind of if statement?
}

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

Random Color + Change Color With AS With Ease
HI,

I followed this tutorial , but IŽd like to add something more but donŽt know how.

I[d like to make the MC to load a random color, in a color range that I specify, like #000000, #FFFFFF and #111111.

Also, I want somew buttons to change between this colors, but with an ease transition.

How can I do this?

Drag Color And Change Objects Color
i looked at the kirupa's paint tutorial and it really didn't achieve the effect that i'm going for. i'm new to actionscript so i can't figure it out for myself, so i'm hoping someone can shed some light on the situation for me.

here is the setup: i have an object that i rendered in 3d studio max. will just call it a box. i have rendered that box in 3 different colors. red, yellow, and blue. i saved them each individually as targa files and imported them into flash. i created a movie with 3 frames. frame one contains the red box image, frame 2 contains the yellow box, and frame 3 contains the blue box. each frame has the stop command applied to it.

now on the main timeline, i have 3 different circles that have been converted to buttons each colored red, yellow and blue. now i can use a "tellTarget" type action to make the playhead on the box movie clip to jump to the corresponding colored circle that was clicked, but i'd rather let the user be able to drag the colored circle to that box, release, and change the box to the color that corresponds to that circle. i don't know if that requires some type of collision detection script or not. the box has no background so all there is, is the box itself so collision detection should just detect the box itself...right??

i would appreciate any insight that you could give me!!! if need be, i can supply a *.fla file for you to look at.

Random Color + Change Color With AS With Ease
HI,

I followed this tutorial , but IŽd like to add something more but donŽt know how.

I[d like to make the MC to load a random color, in a color range that I specify, like #000000, #FFFFFF and #111111.

Also, I want somew buttons to change between this colors, but with an ease transition.

How can I do this?

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

How Do You LoadVariables And Change It Into An Array?
I found an awesome .fla in the movies section. It deals with searching from an array. I am trying to build a search feature for a CD-ROM.

The CD-ROM is for 100's of song lyrics loaded into an interface. I have that part down using loadMovie (for text and soundclips).

I am now trying to add a feature where the user can type in a word in a field and search all the songs for that word. So I want to make an array of all the words in every song. The fla I found takes one sentence and breaks it up in searchable words, but the array is hardcoded in flash. I want to be able to break up a .txt file into searchable words (array).

I know my explanation is hard to understand, but read it once or twice and please reply if you know anything about arrays.

Guestbook, Change From LoadVariables To LoadVars
Hello, having created a very simple guestbook modified from a tutorial i found.
The format and idea of the thing is simple (as im a beginner to php)
but it uses LoadVariablesNum instead of the LoadVars() method which i would prefer and is obviously the better way. The thing is i am not entirely sure how to convert the code to use loadVars and to validate the "post message" form without stopping the php sort of thing. It uses a text file to write to, after changing the permissions on the server.
There is a .zip of the files from the tutorial, i have only modified the .fla myself. It's from flash-db.com i think.

If anyone can tell convert it for me, or tell me a better way to do the same thing as i'm doing i would be extremely grateful.
Hope someone can help me or point me in a better direction.
Thanks!

Using A Color Chooser To Change Color Of MC
Hi,

I'm using a component which allows you to change the color of MCs but I can't get it to work...newbie sorry...

I have an MC on the stage with the instance main_mc which contains another MC called back_mc as well as a Mc (button_mc) which contains the component on frame 2 (ColorChooser) with this script :

code:
stop();
var myCol:Color = new Color(back_mc);
ColorChooser .changeHandler = function() {
myCol.setRGB(main_mc.back_mc.value);
};



Sorry if this is all very confusing...a path issue probably but I can't figure it out. Could someone help me please?

G

Color Change (heavy Change)
Hey everybody,

i dont know if this is possible, but it sure would be nice! I need to change all the elements in my movie that have the color X and change their color to color Y.
Is it possible to have this in AS? like, if i press one button all the elements that have the color black (graphic, text, background, etc) change their color to yellow?

thanks for any thoughts!!

cheers

LoadVariables From Different Movieclip To Php
Hello!

I have a problem with loadVariables from different movieclips, I don't know how to do.
I wannt to load loadVariables from 2 mc in to one php script(email.php).
My mc's are "send_mc" and "answer_now"
Her is only one mc loaded, but I wannt two mc to be loaded..
This is my script, so far...

Code:
buttonS.onRelease = function(){
_root.send_mc.loadVariables("email.php", "POST");
}

MovieClip.loadVariables And Arrays
I'm trying to use the loadVariables function but I just can't seem to get it right. How can I prevent the function from loading my variables as strings ?

my txt file looks like this :

myArray=[1,2,3];

and once loaded into the swf it looks like this :

myArray = "[1,2,3];"

and I can't find a way through this. And blast the bloody flash reference!

Loadvariables-lose Control Of Movieclip
Evening, I have a button in a movieclip which does a loadvariables from asp.net page, all is great they come in and I can read them, however I have no control over the clip with the button in once the variables have loaded, (i wish to move the playhead forward on it), have tried other properties but I cannot do anything with it once I have loaded my variables. By the way it's Flash 5.

Does anyone have experience with a problem of this nature? - Thanks

dave.

Using LoadVariables With A Text Field Or Movieclip
I have a .txt file called "sample_text.txt". In that file I have &sampletext=This is my sample text.&

First I tried doing something like this:
_root.createEmptyMovieClip("target_mc",1);
loadVariables("sample_text.txt",target_mc);

I don't see any text in the .swf but I do see this in the output panel:
Level #0:
Variable _level0.$version = "WIN 8,0,22,0"
Movie Clip: Target="_level0.target_mc"
Variable _level0.target_mc.sampletext = "This is my sample text."

l tired the movieclip method because that's all I could find info on but what I'd really like to do is somehow attach the loadVariables to a text field made using the createTextField. I'm not sure about the format for that code to make it work.

Thanks for your help.
-Scott

LoadVariables POST Not Working From Inside Movieclip
I have an email contact form that works fine with the form movieclip and submit button directly on the main stage, but when I embed them down one layer inside a movieclip, they cease to work. Unless they are on the main stage, the POST doesn't seem to actually occur. Why is this?


Code:
contact_form.loadVariables("email.php", "POST");


With the form and button on the main stage even if there are no variables passed from the contact form it will at least cause my email php script to send me a blank email. From inside a movieclip though, it doesn't even do that. It is as if there is no POST being made to the "email.php" file.

Using LoadVariables() To Populate A Dynamic Text In A MovieClip
Hello everyone,

I am trying to populate a Dynamic Text with data from a remote database. I have no problem populating the Dynamic Text with the data from the remote database if the Dynamic Text is placed in the main timeline using the following code.

loadVariables ("php/attorney.php", "");


Once I move the Dynamic Text into a Movie Clip with instance name of “MC_But_1” I am only able to populate the Dynamic Text if I place the above code in the movie clip. Since it is going to take sometimes for the data to be transferred from the remote database I rather to do this on the main timeline before the MC_But_1 is shown. I have used the following code but for some reason it is not working.

loadVariables ("php/attorney.php", _root.MC_But_1);

Can someone be kind enough to tell me where I am going wrong? Thank you very much and have a great day.

Khoramdin





























Edited: 08/30/2007 at 10:51:05 PM by Khoramdin

Apple A Color Transformation To A Movieclip That's Inside Another Movieclip
Hey,

I have a movieclip with it's .mouseChildren property set to true. In that movieclip are about 30 other movieclips, and inside each of those movieclips is a single dynamic textfield. I did this so I could set the .buttonMode to true on the 30 movieclips that are in the main movieclip so I could have the nice pointer finger/glove. When I mouse over the main movieclip the pointer finger/glove shows up as it's supposed to. What I want to do is apply a color transformation to the movieclip as I mouse over it. Here's what I have that isn't working:


Code:
function onFeedMouseOver(e:MouseEvent):void
{
var feedColorOver:ColorTransform = e.target.colorTransform;
feedColorOver.color = titleTextOverColor;
e.target.transform.colorTransform = feedColorOver;
}
I have verified that the function is indeed being called, and the color variable is working.

Any help would be very much appreciated.

P.S. The project is a rss reader where the user can select what feed they want to view from a scrollable list that is parsed form an xml file, then the feed will load and display the title, date, and short description of all the feeds for the user. Then it scrolls through them (it loops continuously). When the user clicks on the feed, it takes them to the article/blog post/whatever in a new tab or window. Everything works great, this is basically the last thing I need to do for it. This particular portion of the project is when the user mouses over the list of feeds.

Movieclip.loadVariables() Never Finishes In Netscape 'onclipEvent(data)'
I'm using movieclip.loadVariables("http://www.whatever.com/file.html"); to load some information.

I'm using the onClipEvent(data) to set a variable so that I can start processing the data.

This works fine in IE, but it doesn't under Netscape.
The event never gets set.

Any Ideas?


Thanks
Markus

Get The Color To Change Another Obj Color
Im trying ro change a MC color from get the color of another MC color.
Please please help I think im going mad...........
Really appreciate.
Cheers Matt

Is This Possible? Change Color
Hello,

i have a MC which has only a square.
Is it possible to change the color of that square with action script?

thanks,
Miguel

Color Change
is it possible to transform(with fade effect) the color of a movie clip or a graphic, ive tried the .setRBG and .setTransform, but the color changes right away without the fade...if u kno what i mean plz reply thx

Change Color
I'd like change color of MC bgLista which is inside of MC messaggio. But with (messaggio" add i.bgLista) I can't reach
bgLista and the change color is on messaggio.

What's wrong?????

for (i=0; i<array_length; i++) {
duplicateMovieClip(messaggio, "messaggio" add i, depth);
setProperty("messaggio" add i, _y, yposition);


set("messaggio" add i add ".ListaIdmessaggio", ListaIdmessaggio_array[i]);
set("messaggio" add i add ".ListaDataora", ListaDataora_array[i]);
set("messaggio" add i add ".ListaNickname", ListaNickname_array[i]);
set("messaggio" add i add ".ListaOggetto", ListaOggetto_array[i]);


Lista = new Color("messaggio" add i.bgLista);
i%2==0 ? Lista.setRGB(0xCCCCCC) : Lista.setRGB(0xffffff);
delete Lista;

depth--;
yposition = yposition+25;
}


Thanks in advance
manner

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