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: - function paCountyHighlight(targetCounty) {
-
var myColor:Color = new Color(this.usa.pa_counties.Washington);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
When I change it to support my needs it does not work! I have tried hours on end to get this going: - function paCountyHighlight(targetCounty) {
-
var countyColored = this.usa.pa_counties.targetCounty;
-
var myColor:Color = new Color(countyColored);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
-
-
}
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. :(
5 3852
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: - function paCountyHighlight(targetCounty) {
-
var myColor:Color = new Color(this.usa.pa_counties.Washington);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
When I change it to support my needs it does not work! I have tried hours on end to get this going: - function paCountyHighlight(targetCounty) {
-
var countyColored = this.usa.pa_counties.targetCounty;
-
var myColor:Color = new Color(countyColored);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
-
-
}
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. :(
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.
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: -
//when calling the function pass the whole route as the parameter:
-
paCountyHighlight(this.usa.pa_counties.theCounty);
-
//being "theCounty" the corresponding movieclip
-
-
function paCountyHighlight(targetCounty) {
-
var myColor:Color = new Color(targetCounty);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
-
}
-
Regards,
The_Nephilim
hoverColor is a variable equal to a hexadecimal. myColor.setRGB() sets the color, not the target. Thanks for the try tho.
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: - function paCountyHighlight(targetCounty) {
-
var countyColored = this.usa.pa_counties[targetCounty];
-
var myColor:Color = new Color(countyColored);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
-
-
}
Its a beautiful day in Pennsylvania. God Bless.
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: - function paCountyHighlight(targetCounty) {
-
var countyColored = this.usa.pa_counties[targetCounty];
-
var myColor:Color = new Color(countyColored);
-
myColor.setRGB(_root.hoverColor);
-
_root.countyLabel = targetCounty+", PA";
-
_root.displayCountyLabel();
-
-
}
Its a beautiful day in Pennsylvania. God Bless.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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?
...
|
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...
|
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...
|
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...
|
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 =...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |