View Full Version : moving around from button to button
pacodataco
03-26-2003, 06:11 PM
this effect can sort of be done with html, but
I would like to know the script that pulls this
off purely in flash mx. www.thebanmappingproject.com (http://www.thebanmappingproject.com)
the zoom ins, the way it moves from one tomb
to another as you click on it.
any help would be greatly appreciated. I'm
like Corky when it comes to actionscript.
thanx,
michael
if u make a mc which contains the whole landscape with the buttons placed in position inside it.
place this mc on your main timeline and put this code on the mc itselfonClipEvent (load) {
_root.targetx = 0;
_root.targety = 0;
}
onClipEvent (enterFrame) {
//moves the clip horizontal
startx = getProperty(this, _x);
movedx = _root.targetx-startx;
setProperty (this, _x, startx+(movedx/5));
//moves the clip vertical
starty = getProperty(this, _y);
movedy = _root.targety-starty;
setProperty (this, _y, startx+(movedy/5));
}then on each of your buttons you just need to set the co-ordinates you want you landscape to move to. for exampleon (release) {
_root.targetx = -50;
_root.targety = -50;
}hope it helps
pacodataco
03-27-2003, 03:57 PM
thanks a lot. you got me started in the right
direction on this thing.
now I can use my newfound knowledge
to impress the chicks.
thanks again,
mike
ubauba
04-08-2003, 07:20 PM
Thanks for the code Bleeda. I am still in need of further assistance :D. I tried to implement your code but have a couple of problems.
1) the Map automatically moved when it loads. It moves out of frame and i can only see a small corner of my map.
2) How do i make a reset button that will put everything in persepective?
3) when i click on a section of a map how do i make it zoom in like the website? I tried tween and masking and it works ok, but i think there's a much more effecient way.
your help is GREATLY APPRECIATED. Thank you.
T.N.
the code above doesn't feature any zoom. i didn't put this as it only zooms at the beginning once and then its just a matter of moving the map around. i fugured u could do the first zoom with a tween and that would be that.
1.the piece of code below sets the starting position for the map. the registration point of your map movieClip will move to this point when the file loadsonClipEvent (load) {
_root.targetx = 0;
_root.targety = 0;
}
2.set the target positions to there original value and tween back out i guess. u could make ur movie rewind to make it tween back.
3.like i said the example given only zooms in once. is this what u mean? or do u mean moving the map around. to move the map around u just change the value of the 2 target positions.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.