LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 05-17-2001, 01:20 PM
BlueSkull BlueSkull is offline
Registered User
 
Join Date: May 2001
Posts: 3
Rep Power: 0
BlueSkull is on a distinguished road
Chat

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)
Reply With Quote
  #2  
Old 05-17-2001, 02:51 PM
toxi toxi is offline
Registered User
 
Join Date: Dec 2000
Posts: 43
Rep Power: 0
toxi is on a distinguished road
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.
__________________
www.toxi.co.uk
www.spectracol.com
Reply With Quote
  #3  
Old 05-17-2001, 02:59 PM
toxi toxi is offline
Registered User
 
Join Date: Dec 2000
Posts: 43
Rep Power: 0
toxi is on a distinguished road
...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.
__________________
www.toxi.co.uk
www.spectracol.com
Reply With Quote
  #4  
Old 05-17-2001, 07:03 PM
BlueSkull BlueSkull is offline
Registered User
 
Join Date: May 2001
Posts: 3
Rep Power: 0
BlueSkull is on a distinguished road
Chat

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)
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 09:28 AM.