
Welcome Guest
|
|
|
#1
|
|||
|
|||
|
First, let me set the stage (no pun intended) for this slight problem.
I have an "gColor" array for 9 different colors. gColor[1] is set for 0x0000ff . On frame 2 in a MC named "panel" is a blue button. After clicking on it, a variable of clr = 1 is set. This will be used with the array code in a moment. On frame 3, still in the "panel" MC, is another MC named "showcolor". Ok, here's the problem. I tried using on(release){ clr = 1; changeColor = new Color(_root.panel.showcolor); changeColor.setRGB(gColor[clr]); _root.panel.gotoAndStop("3"); } But when I go to preview it, I either get a output error or "showcolor" will not be changed to a blue color as intended. I tried a few variations of the coding but nothing works. Is there any way to do this??
__________________
My flash games and online talk radio site (game section is still under construction) |
|
#2
|
|||
|
|||
|
i'd suspect that you'd have the hex values assigned as string to your gColor array and therefore you'd need to write:
changeColor.setRGB(parseInt(gColor[clr])); hth, toxi. |
|
#3
|
|||
|
|||
|
...and if that doesn't help, here's another question: when the onClick Event occurs is your "panel" MC already in frame 3? if not, flash won't know that there's a MC "showcolor" and so creating a colour object for this clip will fail...
so why don't you have the "showcolor" MC starting in frame 1 (even if you don't need it there) and have it somewhere outside the stage. then in frame 3 it'll be in the right position, but at least its instance is created beforehand and available to flash. |
|
#4
|
|||
|
|||
|
The way you suggested didn't help but after playing with it a while, I figured it out myself. I feel kinda dumb for not thinking of it before.
Thanks anyway...
__________________
My flash games and online talk radio site (game section is still under construction) |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XML PRELOAD Problem | grafxidg | Newbies |
3 | 04-08-2010 01:06 AM |
| textfield focus problem in external swf | mrpoate | Newbies |
1 | 07-10-2007 11:34 AM |
| setRGB() and movement problem... | Genius | Flash MX |
4 | 04-11-2003 08:17 AM |
| setRGB problem | teatime | General Flash | 1 | 11-11-2002 01:45 PM |
| setRGB problem | gareth | Flash 5 Actionscript |
4 | 02-08-2002 02:06 PM |



