473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

movieclip dynamic color change problem!!! PLEASE

daJunkCollector
Hey Guys, Code is provided below. I have an example or what works and what doesn't. I am about to throw my computer out the window.


This code works:
Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var myColor:Color = new Color(this.usa.pa_counties.Washington);
  3.     myColor.setRGB(_root.hoverColor);
  4.     _root.countyLabel = targetCounty+", PA";
  5.     _root.displayCountyLabel();

When I change it to support my needs it does not work! I have tried hours on end to get this going:

Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var countyColored = this.usa.pa_counties.targetCounty;
  3.     var myColor:Color = new Color(countyColored);
  4.     myColor.setRGB(_root.hoverColor);
  5.     _root.countyLabel = targetCounty+", PA";
  6.     _root.displayCountyLabel();
  7.  
  8. }
You should be able to see what I am trying to do. I am trying to use the parameter rather than the hard-coded county name. I tried a million different ways to call this county to change color. I even tried the setTransform method. PLEASE shed some light on this for me. :(
Aug 17 '07 #1
5 3852
xNephilimx
213 Expert 100+
Hi, I don't know what is your movie composed of, but try changing the line that says myColor.setRGB(_root.hoverColor); to myColor.setRGB(countyColored); in the code that doesn't work.
If it doesn't, publish the fla and I'll try to se what's happening.

Please let me now either way.

Kind regards,
The_Nephilim

Hey Guys, Code is provided below. I have an example or what works and what doesn't. I am about to throw my computer out the window.


This code works:
Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var myColor:Color = new Color(this.usa.pa_counties.Washington);
  3.     myColor.setRGB(_root.hoverColor);
  4.     _root.countyLabel = targetCounty+", PA";
  5.     _root.displayCountyLabel();

When I change it to support my needs it does not work! I have tried hours on end to get this going:

Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var countyColored = this.usa.pa_counties.targetCounty;
  3.     var myColor:Color = new Color(countyColored);
  4.     myColor.setRGB(_root.hoverColor);
  5.     _root.countyLabel = targetCounty+", PA";
  6.     _root.displayCountyLabel();
  7.  
  8. }
You should be able to see what I am trying to do. I am trying to use the parameter rather than the hard-coded county name. I tried a million different ways to call this county to change color. I even tried the setTransform method. PLEASE shed some light on this for me. :(
Aug 19 '07 #2
Hi, I don't know what is your movie composed of, but try changing the line that says myColor.setRGB(_root.hoverColor); to myColor.setRGB(countyColored); in the code that doesn't work.
If it doesn't, publish the fla and I'll try to se what's happening.

Please let me now either way.

Kind regards,
The_Nephilim

hoverColor is a variable equal to a hexadecimal. myColor.setRGB() sets the color, not the target. Thanks for the try tho.
Aug 19 '07 #3
xNephilimx
213 Expert 100+
Yes, sorry, I'm a little distracted today.
In the targetCounty param of the function that doesn't work you should pass the whole route, not only the name and then appending it to the route, that way will never work. Try this:

Expand|Select|Wrap|Line Numbers
  1. //when calling the function pass the whole route as the parameter:
  2. paCountyHighlight(this.usa.pa_counties.theCounty);
  3. //being "theCounty" the corresponding movieclip
  4.  
  5. function paCountyHighlight(targetCounty) {
  6.      var myColor:Color = new Color(targetCounty);
  7.      myColor.setRGB(_root.hoverColor);
  8.      _root.countyLabel = targetCounty+", PA";
  9.      _root.displayCountyLabel();
  10. }
  11.  
Regards,
The_Nephilim

hoverColor is a variable equal to a hexadecimal. myColor.setRGB() sets the color, not the target. Thanks for the try tho.
Aug 19 '07 #4
Neph,

Thanks for trying bud, I finally got it! Line 2, of my first original code snippet should read as follows:

var countyColored = this.usa.pa_counties[targetCounty];

so, the working code is as follows:

Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var countyColored = this.usa.pa_counties[targetCounty];
  3.     var myColor:Color = new Color(countyColored);
  4.     myColor.setRGB(_root.hoverColor);
  5.     _root.countyLabel = targetCounty+", PA";
  6.     _root.displayCountyLabel();
  7.  
  8. }
Its a beautiful day in Pennsylvania. God Bless.
Aug 20 '07 #5
xNephilimx
213 Expert 100+
You're welcome.
Glad you had it working.
That way you should pass the targetCounty as a string value, because you're using object's array notation.

Kind regards,
The_Nephilim

Neph,

Thanks for trying bud, I finally got it! Line 2, of my first original code snippet should read as follows:

var countyColored = this.usa.pa_counties[targetCounty];

so, the working code is as follows:

Expand|Select|Wrap|Line Numbers
  1. function paCountyHighlight(targetCounty) {
  2.     var countyColored = this.usa.pa_counties[targetCounty];
  3.     var myColor:Color = new Color(countyColored);
  4.     myColor.setRGB(_root.hoverColor);
  5.     _root.countyLabel = targetCounty+", PA";
  6.     _root.displayCountyLabel();
  7.  
  8. }
Its a beautiful day in Pennsylvania. God Bless.
Aug 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mithun Verma | last post by:
Hello All, I have a Windows application that uses Crystal Reports 9 (bundled Version) developed using VS.NET 2003 on a windows server 2003 m/c. The application has to be deployed on the client...
2
by: Sojwal | last post by:
We are working on a asp.net application in which we need to send some data to a PHP application on another server. We are using HttpWebRequest object to 'POST' the data to a PHP page as key-value...
4
by: mg | last post by:
How can I change the color of the display text beside a single ListItem of a RadioButtonList when the associated radiobutton is selected - hopefully using C# in the codebehind of a WebForm? ...
1
by: Reza Solouki | last post by:
Hello, I have a page that keeps repeating many times, with different datasets, for the site, so it only makes sense to have a component that gets used. However, the part of the grid I haven't...
1
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im...
11
by: Gagan | last post by:
//Problem Statement // //You work for a company that sells mechanical bit counting devices. These devices //wear out when they do a lot of counting. You are going to see how much wear has...
1
by: icetalks | last post by:
have a look at this code , its for logging the user in after checking his UserName and Password. dim check as boolean = false ... ... If txtUserName.Text.Length = 0 And txtPass.Text.Length =...
9
by: shoeyoz | last post by:
Hi Everybody, m suyoz, i have made body color change onmouse click in every webpages but what i want is dat when i choose for eg blue body color .after dat when i click on link to other page...
0
by: sa6113 | last post by:
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.