[MX] Changing Colour

Hi

I need help, I got this code from Kax. This allows me to change colour of my background. This use to work on my movie but now is just not working anymore!

Since i created a button loading a .swf file this has stopped working, Any suggestions anyone?

Code is below

on (release) {
MovieClip.prototype.fadeColor = function(cto, e) {
var myColor = new Color(this), cColor = myColor.getTransform();
this.onEnterFrame = function() {
for (var c in cColor) {
cColor[c] += (cto[c]-cColor[c])/e;
}
myColor.setTransform(cColor);
};
};
myMovieClip.fadeColor({rb:204, gb:0, bb:0, ab:255}, 4);
}

I understand that I have to replace “myMovieClip” with the name of my clip!

Hope someone can help!!!
:beam:

I think it has something to do with the [COLOR=BLUE]this[/COLOR]. Try replacing it with _parent. I can’t test this 'cause I ain’t got flash on this pc but anyway. It’s worth a try.

No luck there, i’m sure its something simple, just like that though.

Thanks anyway!

[AS]MovieClip.prototype.fadeColor = function(cto, e) {
var myColor = new Color(this), cColor = myColor.getTransform();
this.onEnterFrame = function() {
for (var c in cColor) {
cColor[c] += (cto[c]-cColor[c])/e;
}
myColor.setTransform(cColor);
};
};[/AS]

That goes on a frame not on the button.

[AS]myMovieClip.fadeColor({rb:204, gb:0, bb:0, ab:255}, 4);[/AS]

That can go in the onRelease, but you have to make sure <B>myMovieClip</B> targets the movie clip you are trying to change.

Ah yep, missed that. Lost is the guru around here :beam:

Nope, thats Sen, Ilyas, Sbeener, and Eyez. Im catching up though (i think) :beam: :evil: :bad:

Sorry i’m not having any luck with that either.

When i had this working before the whole code was on the button.

Works fine for me :-\ I just tested it.

The code works in a movie of its own, but now placed into this movie when the button is pressed there is no responce.

Do you have an email address that i can send the file across to?

It sounds like a targeting issue to me.

You can attach your file to forum via the attachment feature (hit “Post Reply” button and there is a field in there for it).

My file size is too big! Sorry!

Can you upload to a server and put up a link? I don’t accept attachments in my e-mail so if that’s the only method you can do this, then perhaps one of the other folks here could help you out.

Hi i have placed the files at the address below to download.

www.pagemakers.co.uk/flash

I have also include the kari.fla which makes the .swf that opens into the .fla that does not work.

Hope this all makes sence!
Thanks

Why are you publishing as Flash 5?

Thats why it doesn’t work, it uses Flash MX coding, but you are exporting as Flash 5.

Go to File/Publish Settings and click on the Flash tab. In the “Version” drop down box choose “Flash 6” and it works fine.

How stupid do i feel :blush: :crazy:

Thank you so much, wonder if i would of ever worked it out!:thumb: