File: btsb.swf-(8 KB, 600x645, Game)
[_] Current color script help Anonymous 01/03/14(Fri)19:37 No.2247168
I need your help guys.
I have been working in this project and I have one question.
I don't know a shit about ActionScript but I try. I use AS2.
I want to pick a color to coloring the squares at the left. But. I want that color will be show
at the "Current color" square at the right.
I have no fucking idea about how to do that
Captcha: ptcten current
>> [_] Anonymous 01/03/14(Fri)19:46 No.2247179
Set the "current color" square was a variable, seeing as this is AS2
Then say, then clicking a color, currCol = newColor (or whichever code youve used in your
clicking of the squared method)
>> [_] Anonymous 01/03/14(Fri)19:48 No.2247181
>>2247179
*as a variable
*squares
tired as fuck
>> [_] Anonymous 01/03/14(Fri)19:51 No.2247187
>>2247179
Yes I thought that, but I don't know how to write in this code.
I don't know how to put if I click to a color, currCol = newColor
btw thanks for reading and helping
>> [_] Anonymous 01/03/14(Fri)19:54 No.2247188
>>2247187
Whats your code when clicking a square?
>> [_] Anonymous 01/03/14(Fri)19:55 No.2247189
>>2247188
on (press) {
nuevoColor = new Color(this);
nuevoColor.setRGB(_root.contr.currentColor);
}
When I click a color its:
on (press) {
_parent.contr.currentColor = "0x990099";
}
I use a controller to set the color. I take all of this from the Internet
>> [_] Anonymous 01/03/14(Fri)19:59 No.2247193
>>2247189
What happens if you set the square using a variable this like http://imgur.com/KLZ1bNT
Then use this:
on (press) {
nuevoColor = new Color(this);
nuevoColor.setRGB(_root.contr.currentColor);
theSquare.setRGB(_root.contr.currentColor);
}
When I click a color its:
on (press) {
_parent.contr.currentColor = "0x990099";
}
>> [_] Anonymous 01/03/14(Fri)20:07 No.2247199
>>2247193
I use Macromedia Flash 8, I don't have the same table to set it as variable. I can put it an
instance name, but I have not an empty space to set it as variable. Or at least I don't see it
>> [_] Anonymous 01/03/14(Fri)20:07 No.2247200
>>2247199
Set the instance name then, does it not set the color?
>> [_] Anonymous 01/03/14(Fri)20:08 No.2247203
>>2247199
Also just torrent CS6 or something
>> [_] Anonymous 01/03/14(Fri)20:10 No.2247205
>>2247200
No, it doesn't
>> [_] Anonymous 01/03/14(Fri)20:14 No.2247210
>>2247205
Upload the FLA so we can at least have a look at the code
>> [_] Anonymous 01/03/14(Fri)20:17 No.2247217
>>2247210
http://www.filz.us/files/12d29d6e/2d3/btsb.fla
>> [_] Anonymous 01/03/14(Fri)20:30 No.2247228
>>2247217
Set the instance name of your 'set color' square to something
Then in your pallete colors, use this:
myColor = new Color(_parent.urafaget);
myColor.setRGB(0xff00ff);
>> [_] Anonymous 01/03/14(Fri)20:34 No.2247234
Wow, squares are a native object in AS?
That's reasonable, but they have a color variable as well?
Wow, how dumb do they think programmers are?
>> [_] Anonymous 01/03/14(Fri)20:37 No.2247239
>>2247234
'shapes' are
And remember, this is a language designed for animators, they suck at programming
>> [_] Anonymous 01/03/14(Fri)20:46 No.2247242
>>2247239
Ah, forgot about that.
Also one question, is that grid a 2D array of squares?
I was only saying that it's stupid to put in a square object with a color variable because native
API's are supposed to be abstract.
My square class could have different calls/variables like an outline boolean and be much smaller
than the native one, thus reducing the amount of heap needed to keep an array of squares.
I would also have a grid object so that I would only have to initialize one object with a single
array of integers for the color positions.