all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

interactive map



Re: interactive map tralfaz
12/4/2005 12:30:43 PM
flash actionscript: [quoted text, click to view]

I can answer this one question for you. Hopefully others will have
time to answer the others.
To have buttons work within a draggable movieclip you need to avoid
giving mouse click (onPress) events to both. For it to work you can
use onClipEvents for dragging the movieclip and use onRelease for the
buttons like this...
This example has a movieclip with an instance name of mc1 and buttons
inside of it with instance names of b1 and b2.

// code for the draggable movieclip:
//************************************
onClipEvent (mouseDown)
{
if (hitTest(_root._xmouse, _root._ymouse, true))
this.startDrag(); // start dragging the movieclip
}

onClipEvent (mouseUp)
{
stopDrag();
}

onClipEvent (mouseMove)
{
updateAfterEvent(); // smoother looking
}

//************************************
// code for buttons.. (don't attach to anything)
// put the code in the root.
// 2 buttons inside of movieclip mc1 with instance names of b1 and b2

_root.mc1.b1.onRelease=function()
{
// do something with this button
}

_root.mc1.b2.onRelease=function()
{
// do something with this button
}

//************************************
Hope that helps
tralfaz

interactive map Esha_K
12/4/2005 7:15:22 PM
Hello everyone...

I am trying to create this interactive map application for one of my projects
and facing BIG problems.

I will be honest and let you guys know that I am NO expert at either
actionscript or XML, but doing this project so as to learn both of these.

Now my requirements are that:
1) the map can be dragged around the screen (so the user can view parts of it,
that aren't shown as it loads).

2) its a sculpture park map (quite big location), so once they locate the
section they want to see, they click to zoom into it. (this should display a
zoomed in version of that section)

3) once they zoom in, they get details and locations of the sculptures in that
section, now once they mouseover or click on a sculpture icon, i wld like to
have a pop up (movieclip or whatever suits the best in this situation) that
shows the details of the sculptures like their name, price, dimesions, edition
no. etc.
for this point i would really like to use data that is loaded from an xml
file, as from time to time they keep on changing locations or certain
sculptures are sold, so i want the application to be update able.

<b>my progress:</b>
1)i have got the map in a movieclip, which is then placed on the stage.
2)i have tried dragging the map, using startDrag and so far it works.
3) i tried having an invisible button inside the movieclip, that show the name
of sculpture, on mouseover (just for practising purposes), but when an instance
was placed on the stage, the button didn't work, could someone tell me why....

<b>i need help with: (and i hope i am not asking for much</b> :-( !!!)
1) how shall i structure my application? do i have the map in a movieclip or
in the main timeline
2) can i have buttons in a movieclip that would work in the main timeline when
an instance is dragged on to stage.
3) how will the xml bit work.

any help, big or small, towards this application would be appreciated alot.

<b>Many Thanks</b>
Esha
AddThis Social Bookmark Button