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?
system
August 7, 2003, 8:33pm
2
[AS]colorObj = {ra:100, rb:-28, ga:100, gb:-28, ba:100, bb:-255, aa:100, ab:0};
myColor.setTransform(colorObj);[/AS]
Try that…
system
August 7, 2003, 8:48pm
3
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:
system
August 7, 2003, 8:54pm
4
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?
quickEdit: what the hell, I didn’t know I forgot a word and spelling errors… heh
system
August 7, 2003, 8:55pm
5
That’s it… I’m done with dudeman’s questions. You’re in charge cleverboy.
That was sweet, by the way.
system
August 7, 2003, 8:58pm
6
:!: I didnt know!
I just crawled into a hole and lo and behold you got there first
system
August 7, 2003, 9:07pm
7
I was kidding, you know.
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. =)
system
August 7, 2003, 9:08pm
8
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
system
August 7, 2003, 9:08pm
9
:beam:
yeah yeah yeah. It sucks when I post after you, admit it
:love:
system
August 7, 2003, 9:15pm
10
Nope, it does not suck! :love:
And stop ignoring dudeman, explain him the code!!
system
August 7, 2003, 9:16pm
11
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…