.setRGB

that’s crazy… i just spent so much time doin this

opacityListener = new Object();
opacityListener.onKeyDown = function() {
	if (Key.isDown(49)) {
		shapes._alpha = 10;
	}
	if (Key.isDown(50)) {
		shapes._alpha = 20;
	}
	if (Key.isDown(51)) {
		shapes._alpha = 30;
	}
	if (Key.isDown(52)) {
		shapes._alpha = 40;
	}
	if (Key.isDown(53)) {
		shapes._alpha = 50;
	}
	if (Key.isDown(54)) {
		shapes._alpha = 60;
	}
	if (Key.isDown(55)) {
		shapes._alpha = 70;
	}
	if (Key.isDown(56)) {
		shapes._alpha = 80;
	}
	if (Key.isDown(57)) {
		shapes._alpha = 90;
	}
	if (Key.isDown(58)) {
		shapes._alpha = 100;
	}
};
Key.addListener(opacityListener);

I was just followin the tutorial and what you did and stuff… but dang… lol… i have a lot to learn

Well I could get all “obfuscated” and stuff, and in that case, my listener code would be better and probably less lines, but you would need the keyCode to each character unfortunately.

And you could do an if/else instead of if, if, if, if, etc.

ohhh… well i did save your little key code thingie…

thanks a lot for your help lost and cyan… im goin to bed now tho… im glad i got this far

thanks a ton for your help again

I’ll screw with it some more tomorrow… this is fun… night guys

PS: obfuscated?

Obfuscating code is condensing it down. To truly obfuscate though, the code would be unreadable really.

Mine wouldn’t be that obfuscated, just minor stuff.

Some thing like this???

colorArray = new Array("0x333333", "0x333366", "0x333399", "0x336633",
				   "0x336666", "0x336699", "0x339933", "0x339966",
				   "0x339999", "0x663333", "0x663366", "0x663399",
				   "0x666633", "0x666666", "0x666699", "0x669933",
				   "0x669966", "0x669999", "0x993333", "0x993366",
				   "0x993399", "0x996633", "0x996699", "0x999933",
				   "0x999966", "0x999999");
opacityListener = new Object();
opacityListener.onKeyDown = function()
{
	if ((Key.getCode() >= 48) && (Key.getCode() <= 57))
	{
		if (Key.getCode() == 48)
			shapes._alpha = 100;
		else
			shapes._alpha = (Key.getCode() - 48) * 10;
	}
	else if ((Key.getCode() >= 65) && (Key.getCode() <= 90))
	{
		var colorful = new Color("_root.shapes");
		colorful.setRGB(colorArray[Key.getCode() - 65]);
	}
};
Key.addListener(opacityListener);

babling. I can’t test it, but it looks like what I had in my mind to try out :slight_smile:

I know that you cannot check the code out, that’s why I just created bogus code so that xxviii can check it out and get into the swampt… :stuck_out_tongue: Kidding… :wink:

You still having that RAM problem, lostinbeta??? :hair:

Yep yep, still having that problem :frowning: My comp is getting better though, I can actually open Flash now!!! YAY!!! (well at least for a little bit)… and and… the other day I could actually open Photoshop and create a new footer/avatar!!!

Granted it ran like crap, but before I would get a memory usage error. So somehow it improved since then :stuck_out_tongue: =)

Hehe… I hope you can figure out how to fix it soon… (I thought that somebody offered you one if I remember correctly…)
Well… I got bigger problem… My old PII 300 on 56k is lagging like hell when I am in Kirupa due to lots of SWF footers… It’s gotta a little bit better after you guys forced the size restriction and such, but it is bad… Oh, well… What can I do about it??? :frowning:

Wow, now that is a bad case senario :frowning:

You could disable the viewing of footers for you. That should help.

Just go to UserCP/Edit Options/

In there will be something that says…

Show user’s signatures in their posts? Yes No

Yes, I know… I don’t really want to disable it because there are some good ones that my eyes like… :wink: Besides, I did turn that off when I first came here but I didn’t see much difference…

Hrmm, everyone I know that turns them off says the forum runs so much faster.

Alright, I am so off to bed now. I am tired(-:

Goodnight :sleep:

Yup… Good night… I’ll be off soon too… :wink:

cyanblue… i tried that code you said but it didnt seem to work, i was probably doing it wrong tho. im not good with all that loopy stuff… but that probably wasnt even a loop… cuz thats how dumb i am

thanks for the help tho

Here you go… :wink:

wow, thats pretty cool

thanks man…

once i can understan how u did that ill be a lot happier

thank you:)

I dont think I saw this mentioned, but you can set alpha with the color object. Consider this function which will let you set RGB and alpha at once


Color.prototype.setRGBA = function(hex, a){
	this.setRGB(hex);
	this.setTransform({aa:a})
}

new Color(shapes).setRGBA(0x336699, 50);

Also, depending on those colors, you might be able to reduce the typing of all those hexes by making them a function of the keycode etc

yada yada yada :wink:

lol im so lost
i really suck at actionscript… im still just learning it… but thank you…

i think i almost understand what your sayin but i have no idea how i would actually apply it to something… but oh well

thanks

*Originally posted by senocular *
**I dont think I saw this mentioned, but you can set alpha with the color object. Consider this function which will let you set RGB and alpha at once


Color.prototype.setRGBA = function(hex, a){
	this.setRGB(hex);
	this.setTransform({aa:a})
}

new Color(shapes).setRGBA(0x336699, 50);

Also, depending on those colors, you might be able to reduce the typing of all those hexes by making them a function of the keycode etc

yada yada yada :wink: **

I did not know that. Interesting. Thanks :slight_smile:

Yup… That’s a neat one… Thanks senocular… =)