[Flashcoders] Yahoo Maps: Detecting latitude and longitude of mouse over map

2006-07-20 Thread Dave Wood

Hi

I'm trying to detect the latitude and longitude of the cursor as the  
user moves their mouse around a map. Should be straightforward I  
thought - if I use LatLonRect data and then calculate based on  
_xmouse and _ymouse data and the height and width of the movieClip  
containing the map, I should be able to do this right?


Weird problem is that flash reports the _height and _width of the  
movieclip incorrectly.


I have a movieClip mapTable_mc in which there is a map named map

The actual dimensions of the movieClip (and also the map) are 400 X  
300 pixels.


trace(mapTable_mc._height)
…output is 1280
trace(mapTable_mc._width)
…output is 1280

Trace mapTable_mc.map._height
…output is 1280
Trace mapTable_mc.map._width
…output is 1280

Height and width are not only incorrect but also the same as each other!

If I trace _xmouse and _ymouse values, they are exacly as expected.

Can anyone shed any light?

David

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Yahoo Maps: Detecting latitude and longitude of mouse over map

2006-07-20 Thread Dave Wood
The actual dimensions of the movieClip (and also the map) are 400 X  
300 pixels.


Sorry, that was a typo - they are actually 500 X 400 pixels.

David
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Yahoo Maps: Detecting latitude and longitude of mouse over map

2006-07-20 Thread David Rorex

When flash calculates _width and _height, it also includes things
inside the movieclip which may be invisible, or masked out. Try this
simple example:
On the stage, create an empty movie clip A which contains two square
movieclips B and C, which are placed next to each other

This code will produce the same output 4 times:

trace(A._width);
A.B._visible = false;
trace(A._width);
A.C._visible = false;
trace(A._width);
A._visible = false;
trace(A._width);

Not sure if this is related exactly to your problem, but I've had
issues with _width  _height before, and this is usually the cause.

-David R

On 7/20/06, Dave Wood [EMAIL PROTECTED] wrote:

 The actual dimensions of the movieClip (and also the map) are 400 X
 300 pixels.

Sorry, that was a typo - they are actually 500 X 400 pixels.

David

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Yahoo Maps: Detecting latitude and longitude of mouse over map

2006-07-20 Thread Dave Wood

Hi David


When flash calculates _width and _height, it also includes things
inside the movieclip which may be invisible, or masked out.


Good thought, but no, the movieclip contains nothing beyond the area  
covered by the map instance.


Note that it wsan't just the clip containing the map the gave the  
strange values, but also of the map itself.


Cheers

David

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com