View Full Version : two hit areas
VitiminJ
04-22-2003, 01:32 PM
I've searched the boards and came up empty. I need two hit areas, kinda.
EX: I have a map of the U.S., when I rollover a state I want it to change to Orange (no problem there) then when I rollover the capital I want the little dot to change color while the state stays Orange. Which is where I run into problems I can't get them both to change at seperate rollovers.
magicwand
04-22-2003, 02:54 PM
that can be achieved many different ways..
it would be helpful to know how you approached that problems.
post your fla or explain how you changed the color on rollover.
CyanBlue
04-23-2003, 04:02 AM
Yeah... I see it that it can be done very easily, but it will be best if we could see your sample and know how you have laid things in Flash... ;)
VitiminJ
04-23-2003, 12:19 PM
Okay here is the deal. I havve a map for work, which shows the states we have branches. Well I roll over them I want the state to turn a different color, then when I rollover the dot I want it to display to address, phone, location, etc about the branch. (Which is what the box at the bottom of the screen is for). I've gotten this to work without the color change but having some trouble with the two hit areas here are the flas. Thanks for the help:
VitiminJ
04-23-2003, 12:23 PM
Whoops, here you go:
VitiminJ
04-23-2003, 12:25 PM
Man this is quite the process, to big when zipped together here is the second
CyanBlue
04-23-2003, 04:27 PM
See what I have doen with Virginia... I am using movieclips rather than buttons and use onRollOver and onRollOut handler to get the hitTest... ;)
VitiminJ
04-23-2003, 05:03 PM
Dude thats awesome! One little question I need it to turn orange onRollover and stay orange when you go over the capital and then go back to yellow when off the state. Is that possible? Take a look at what I did same state Virginia. Thanks again.
CyanBlue
04-23-2003, 05:46 PM
I just added two more lines in that script... I didn't download your file though... Let me know if I needed to... ;)rollOverColor = 0xFF9900;
rollOutColor = 0xFFFF00;
MC_VA.VA_Map.onRollOver = function ()
{
trace(this._name.substr(0, 2) + " - State " + _parent._name);
rollColor = new Color(this);
rollColor.setRGB(rollOverColor);
}
MC_VA.VA_Map.onRollOut = function ()
{
trace(this._name.substr(0, 2) + " - State");
rollColor = new Color(this);
rollColor.setRGB(rollOutColor);
}
MC_VA.VA_Dot.onRollOver = function ()
{
trace(this._name.substr(0, 2) + " - Capital");
rollColor = new Color(MC_VA.VA_Map);
rollColor.setRGB(rollOverColor);
}
VitiminJ
04-23-2003, 05:50 PM
No you don't have to. And that worked. Thanks a lot. You seem to really have a handle on ActionScript. Are there any books you'd recommend?
CyanBlue
04-23-2003, 05:57 PM
Well... As long as it does the job... ;)
Speaking of the books... Go to the end of this thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=26683)... As I have mentioned it right there, I am not the right person who you can ask about the books... There has been some discussions regarding the Flash book and stuff on the forum... You might find more information on that by searching the forum... ;)
magicwand
04-23-2003, 06:20 PM
i think AS.org should pay CyanBlue for all that help.
:)
CyanBlue
04-24-2003, 04:18 AM
Then I finally become a person with a job??? Great!!! :)
VitiminJ
04-24-2003, 03:03 PM
CyanBlue
For the areas with more then one red dot, do I have to do anything different in the code, bacause when I mouse over one it stays orange but when I go to the other it changes back to the normal color.
Thanks
VitiminJ
04-24-2003, 04:15 PM
Nevermind, I figured it out. Sometimes the answer is right under your mouse.
texbala
04-24-2003, 09:45 PM
//something off the thread
i agree with magicwand.. AS can do something to CyanBlue... how about a moderator!! :) :)
sure CyanBlue deserves it... he has been to AS everyday and I doesn't ask questions... but giving gr8 answers :)
infact if i think i shld buy a drink for every answer he had answered me... i owe him a barrel by now :D :D
btw. who decides on the moderators?? is there any process for that?? shld it be mailed to Jesse??
CyanBlue
04-25-2003, 07:02 PM
i agree with magicwand.. AS can do something to CyanBlue... how about a moderator!! Thanks for the compliment... But I can't be... Why??? Because what I'd do in the first place if I ever become a moderator is to delete all the threads that has crossposts and search tags applied... and I am sure lots of people will bitching at me and the forum... So, it should be staying as it is... Thank you though... I'll take it as a compliment... ;)sure CyanBlue deserves it... he has been to AS everyday and I doesn't ask questions... but giving gr8 answersSo, you have to tell everybody that I have no job and no life, eh??? :p
Just to clarify this... I only answer questions that are not crossposted, and that shows the person's effort of trying or searching... I do not even see the thread again if it is do this for me type... ;)infact if i think i shld buy a drink for every answer he had answered me... i owe him a barrel by nowThat's nice of you... ;) I'll take the barrel, and you take all the liquor in it... I don't drink... I am coke addict though... The barrel could be a good thing I can use in the house... ;)
Hehe... As a matter of fact, my wife sometimes jokes that if I've charged $1 for all my answers, I'd have bought a new computer or something nice for her...
Geez... The forum was down whole day yesterday, eh??? I think I am addicted... I was keep typing the URL almost whole day... :(
skillet
07-01-2003, 04:48 PM
I'm trying to do the exact same thing that you guys are trying to do with the states, but I just need the background of my buttons to remain rolled while I touch the rollover buttons.
Here's and example: http://www.zymocreations.com/index_f.htm
I'm using MC's as my rollovers by turning the true and false, but nothing I come up with works.
Anyone have any idea on how they did that?
CyanBlue
07-01-2003, 05:52 PM
Nice site you've got there, skillet... ;)
I am not sure which menu you are talking about though...
Can you create little sample so that I could try what you are trying to achieve???I just need the background of my buttons to remain rolled while I touch the rollover buttons.You mean the background of the button to remain rolled over when the mouse is over the button???
skillet
07-01-2003, 06:13 PM
The link I provided was just a sample, it's not my site. I was refering to the buttons on the bottom left side of that site. You'll notice that the background turns white when you rollover the block. After that, the background stays white, and it allows you to rollover the buttons.
My problem is that when I rollover the button, the background doesn't stay in it's over state.
EXAMPLE: I have a block with 2 buttons inside.
I'd like the block to fade to white on rollover.
After the BG is white, I'd like to rollover the buttons.
Here's the example again: http://www.zymocreations.com/index_f.htm
Timmee_3Styler
07-02-2003, 10:11 PM
cyanblue - maybe set up paypal donations..... hehe
yay zymo with a new site ;)
ps... any chance @ freelance opportunities @ zymo
- im a waterloo student nearby
subquark
07-16-2003, 06:50 PM
nice code CyanBlue! I was looking for something and came ccross this, sweet (of course, nothing less form the CodeBeast! :D
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.