A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Location Map

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    8

    Location Map

    I am making a location map on a website and want it to be different to most others so I am trying to make one using 3DFA. I am still using version 3.72. I have made a lot of it already, but certain parts I am having trouble with.

    I have a large image file which is going to be the map. Over the top I have a mask so only a smaller window of the map is visible. I have buttons that allow the map to be moved around and zoomed in and out of. That was all pretty easy. I used a layer of elements for the map as I want to have clickable buttons on the map.

    I have made it so the map image is draggable, but for some reason you can only drag it using the lower right hand corner of the image, not from anywhere else. Any ideas how I make it draggable from anywhere on the image?

    Also I have added some buttons to the map, by adding them to the layer of elements and even though clicking them does work, the mouse over on these buttons does not trigger the event I have set. The mouse pointer does not change to a hand when you point at the buttons on the map either, but does with the navigation buttons.

    I was also wondering if there was some way of checking for mouse events, like whether a mouse button is clicked, or what the mouse coordinates are?

    Any help would be greatly appreciated.

  2. #2
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    ummm, for alll the other stuff i would really need to see the movie to help, but maby one of the other 3dfa pewople help. Anyway, for the last question about the mouse, if you click "add new element" there is a element called "mouse". It has stuff like if mouse is clicked and stuff. And if you want the mouse cordinates, just use

    mouseX()
    and
    mouseY()

    like if you wanted to display the cordinates you could make an two edit boxs called something like "mousecordY" and "mousecordX" and have a code like

    mousecordY=mouseY()
    mousecordX=mouseX()

    thats pretty vauge explanation, but if you used edit boxes before it should be easy.
    BC

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    8
    Thanks for the advice. I think the first thing I should do is get the latest version of 3dfa. The older version I am using does not have "mouse" in the list of elements. I will start again and see how I go.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    You can access the mouse coords in 3.72 I'm pretty sure. I seem to remember a problem with dragging layers though. What you described should work just fine in the current release.

  5. #5
    Junior Member
    Join Date
    Aug 2005
    Posts
    8
    Yes, the newer version works a lot better for what I am doing. I am trying to work most of this out myself, but I am having trouble with a couple of things. I now have a map that I can move around, and zoom in and out on. With the dragging of the map, I have set drag limits, but I need to be able to change the drag limits depending on the scale of the map. Making the map smaller (zoom out) is OK, but when I make the map larger (zoom in) I don't get to drag the whole map around. The drag limits need to be changed. Is there some way I can do this?

    I notice there are no "Choosers" in this version. Do I just use child movies and "Show" and "Hide" them?

    Another thing I was hoping to do was be able to double click on the map and have that point move to the center, but I guess I better take it one step at a time.

    Thanks for any help.

  6. #6
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    m not sure if this would work but you could make a varible called Limitleft, limitright, ect. and make the limits eqaul the original limits. Then say if map.scale>watever#{ limitleft, right, ect =watever}. I have no clue fi this would work but you could try it.
    BC

  7. #7
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    You can reset the drag limits in script.

    Assuming your map is named map

    map=element("map")

    map.startDrag(true,leftlimit,toplimit,rightlimit,b ottomlimit);

    Didn't test this so you might have to stopDrag() first not sure but try that.

  8. #8
    Junior Member
    Join Date
    Aug 2005
    Posts
    8
    Thanks, that helped a lot, still having fun working out the exact formula for determining the limits based on the scale of the map. Can't seem to get my head around the maths.

    Hopefully I won't bother you much after this. Is there a way of triggering an event when the mouse is double clicked and not when single clicked?

  9. #9
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    lets see if you map is increased 2x then the limits would move half the difference so

    oldwidth+newwidth/2 does that sound right?

    I'm not good at that either. What I'd probably do is make another movie with just the scaling and some editboxes that show the info and just sort of sus it out that way.

  10. #10
    Junior Member
    Join Date
    Aug 2005
    Posts
    8
    At the moment I have a heap of edit boxes that are displaying all sorts of information so I can sus out the formulas.

    Any ideas on the double click of a mouse, I have been playing with the getTimer() function, but I just can't quite get it.

  11. #11
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    I think I'm gona like you anyway I'll play with the double click thing when I get a chance maybe next week

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center