Jump to content


Photo

Need help with map.


  • Please log in to reply
12 replies to this topic

#1 cip6791

cip6791

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 07 October 2006 - 10:52 PM

Hello. I looked around but couldn t find anything that can help me. I want to make an interactive map of Europe. All I want is each country to change color when the cursor goes over it, and if pressed on, link to a different page. I have the map in .jpg format. How do i pick each country and make a button out of them ?


If anybody can help ... pls do :love:

Thanks

#2 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 08 October 2006 - 03:58 AM

Well, import your map into Flash. Put it on the first layer, and then add another one. Now you need to trace the map with a line tool. No, theres no easy way other than this (unless you photoshop it, but you might not have that). Then fill in all the countries with the bucket tool, and convert all of them to buttons. Make nothing on the first frame, but on the second, third, and fourth (Over, Down, Hit), change the colour.

Then, when you've done all the buttons, add this code to them:
on(release) {
_root.gotoAndStop(MapPageNum);
}
Change the MapPageNum to the number of the frame that you want to link the country to.

#3 cip6791

cip6791

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 08 October 2006 - 04:51 AM

Thank you for your help. I have photoshop. Will that make it easier ? So i import the map, and then layer another one on top of it , and then trace the borders. ... got it :love: hope it works ...


thanks again

#4 funkysoul

funkysoul

    The Funky Stuff

  • Publishing Betazoids
  • PipPipPipPip
  • 2,307 posts
  • Gender:Male
  • Location:Zurich, Switzerland
  • Interests:Music: HIM, HIM, HIM, Cafe del Mar, Linkin Park, Fort Minor, Coldplay, Eric Jordan<br />Sports: Snowboarding, KiteSurfing, Extreme Sports<br />Computer: Flash, After Effects, Actionscript

Posted 08 October 2006 - 06:35 AM

if you have an eps map, then you can import it to flash, and fill it easily by using the paintbucket.
Makes things much easier

#5 cip6791

cip6791

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 08 October 2006 - 09:34 AM

thanks for the help. i wish i can find an eps map that is free :)) but i ll keep looking. i think i ll make my own

#6 cip6791

cip6791

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 12 October 2006 - 05:15 PM

Thanks for all your help. The only stupid problem i have now. pls don t laugh. I don t know how to add the links to each button. Where do i add the code for each button ?

thanks ...

#7 PixelHiveDesign

PixelHiveDesign

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male

Posted 12 October 2006 - 09:09 PM

I'm assuming you have made every state a Movieclip and that every Movieclip has 2 frames, one regular color, one highlight color.

If not, do that.

Then give every MovieClip state a instance name:
Posted Image

Replace <instance name> with "state" + (sequential numbers, start with 0).
example:
state0
state1
state2
state3... and so on until you hit 49!

Yes 49 states... remember we start with 0.

Then put this code on the timeline where all the Movieclips are:
// Setup rollover highlights for EVERY state at once.
// No way I want to see define each one, one by one.
// See "var i = 0" - it is the reason we started with 0 in the naming scheme.
for(var i = 0; i < 50; i++){
	// Loop through every state.
	var thisState = this['state'+i];
	// Assign rollover action, in this case goto frame 2 of the state. (the highlight state).
	thisState.onRollOver = function(){
		this.gotoAndStop(2);
	}
	// Assign rollout action, go back to normal un-highlighted state.
	thisState.onRollOut = function(){
		this.gotoAndStop(1);
	}
	// Do something if the state is clicked. You only mentioned rollover.. so I just traced the MovieClip name.
	thisState.onRelease = function(){
		trace("Clicked:"+this._name);
	}
}

And now comes the hard part...

Just kidding, your done.

Max
Pixel Hive Design (PHD) - site coming soon!

#8 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 13 October 2006 - 12:52 AM

Thats a good way to link buttons, but to link it to frames, change this part:
thisState.onRelease = function(){
	trace("Clicked:"+this._name);
}

to:
thisState.onRelease = function(){
	_root.gotoAndStop(this._name);
}

And name each frame state0, state1, state2, like the buttons (make sure the numbers on the buttons a corrospondent to the numbers on the frames).

#9 cip6791

cip6791

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 13 October 2006 - 01:16 AM

The way i did it is: Traced each individual country, each country has it s own layer. Then selected the layer that way only the country i selected was showing, then pressed F8 picked button, then double clicked on the button, changed the Up Over Down, and that s it. The map came out just the way i want it, but all that code u guys are talking about :P I just don t know where to put that.

thanks

#10 Ben

Ben

    P2L Jedi Master

  • Publishing Betazoids
  • PipPipPipPip
  • 1,366 posts
  • Gender:Male
  • Location:VIC, Australia

Posted 13 October 2006 - 07:46 AM

Yeah thats the easy way.. But I guess when you code for a while you dont like doing the easy stuff :P

#11 PixelHiveDesign

PixelHiveDesign

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male

Posted 13 October 2006 - 10:44 AM

To add actions to your buttons:

Click once on a button in the Flash authoring environment.
Then in top menu click: Window>Actions

Make sure the Actions window is titled: "Actions - Button" and not "Actions - Frame".

Then in the Actions window type:
on(release){
		getURL("maine.html","_blank");   // Example of opening Maine's html file in new window.
}

Do that for every state, and change the actions in between { and } for each state to what you want.

Max (PHD)

#12 zoom4267

zoom4267

    Young Padawan

  • Members
  • Pip
  • 191 posts
  • Gender:Female
  • Location:USA

Posted 04 August 2007 - 08:07 PM

thanks for this, its exaclty what i was looking for. giving it a go

#13 zoom4267

zoom4267

    Young Padawan

  • Members
  • Pip
  • 191 posts
  • Gender:Female
  • Location:USA

Posted 06 August 2007 - 02:05 PM

got this working . it links to the page i need but i lost the hover color, i made each spot a button and a movie clip

also, how do i do the alt, id like the words to show on hover, and i want it to open in the same window

also, i have a border around the images. i would like to make them thicker but i cant seem to bring that up. do i have to redraw?

thanks

Edited by zoom4267, 06 August 2007 - 07:41 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users