setTransform

Is there any way into making the color dynamic?
e.g.
color = ra:100,rb:-28,ga:100,gb:-28,ba:100,bb:-255,aa:100,ab:0;

I tried that and got error… I tried color = {ra:100,rb:-28,ga:100,gb:-28,ba:100,bb:-255,aa:100,ab:0};

and

myColor.setTransform({color});

Any way of doing this otherwise?

[AS]colorObj = {ra:100, rb:-28, ga:100, gb:-28, ba:100, bb:-255, aa:100, ab:0};
myColor.setTransform(colorObj);[/AS]
Try that…

you could be slick and do something like this

Color.initProps = function(){
	var props = ["ra","rb","ga","gb","ba","bb","aa","ab"];
	for (var getter, setter, i=0; i < props.length; ++i){
		getter = function(){
			return this.getTransform()[arguments.callee.prop];
		};
		setter = function(value){
				var obj = new Object();
				obj[arguments.callee.prop] = value;
				this.setTransform(obj);
		};
		getter.prop = setter.prop = props*;
		this.prototype.addProperty(props*, getter, setter);
	}
};
Color.initProps();

Then, all color objects will have ra, rb, ba … etc. properties which you can set directly off of them as if like a _x or _y on a movieclip

myColor = new Color(myMovieClip);
myColor.ra = 50;

:beam:

Wow… I really said it out loud…

Kax, your script works just fine, but I’m still trying to understand senocular’s… lol, can you explain yours again sen? :slight_smile:

quickEdit: what the hell, I didn’t know I forgot a word and spelling errors… heh

That’s it… I’m done with dudeman’s questions. You’re in charge cleverboy. :stuck_out_tongue:

That was sweet, by the way. :wink:

:!: I didnt know!

I just crawled into a hole and lo and behold you got there first :wink:

I was kidding, you know. :wink:

I love when you post after me because you’re usually correcting me, or posting a better way to achieve it; which is useful to me since I improve my knowledge. =)

One more quickie, is it possible to put setTransform in a random of 5-10 seconds for a MC? Where would I place it… on the actual MC itself? thanks

edit: Kax gogogo :P:P:P

:beam:

yeah yeah yeah. It sucks when I post after you, admit it :wink:

:love:

Nope, it does not suck! :wink: :love:

And stop ignoring dudeman, explain him the code!! :stuck_out_tongue:

lol, forget it I’m fine… all I need to complete my project now is x and y non-symbol invisable box detection!

p.s. those love smilies… is there something I should know about you two, or…