A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: UPDATE X & Y

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    19

    Post

    I'm trying to track the cusor and display the x and y coords in dynamic text fields.
    Heres what I have:
    /*I created 2 dynamic text fields and gave them var names of
    xpos and ypos inside a new mc. I placed the new mc on the main stage*/

    onClipEvent (enterFrame) {
    xpos = _root.blank._x;
    ypos = _root.blank._y;
    }

    /*Then made another new mc named cross hairs placed on the main stage*/

    onClipEvent (load) {
    Mouse.hide();
    }
    onClipEvent (mouseMove) {
    _x = _root._xmouse;
    _y = _root._ymouse;
    updateAfterEvent();
    }

    Everything works great execpt the x and y only show the first 3 digits, no decimals. BUT WAIT!!! In Flash 5, the movie works great in test mode, but when exported to .swf format it only shows 3 digits. (Ocassionaly I'll see a .95 pop up on the xpos field.) BUT THERES MORE!!! In a Flash 5 exported movie, that isnt working, it will work if I manually resize the window, or full screen it. Crazy! In Flash MX, it does exactly the same thing but will not work in test mode or a manually resized window like in Flash 5.
    Any thought would be appreciated!!!!

  2. #2
    Senior Member
    Join Date
    Dec 2000
    Location
    The Kingdom
    Posts
    124
    May sound a bit silly, but are you sure your text fields are long enough to display all the digits?

  3. #3
    Junior Member
    Join Date
    May 2002
    Posts
    19
    Yep. They're long enough. That was one of the first things I checked.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    why do you want decimals? if it's for a visual effect divide by .12 or some other fraction. But not if you use these vars for reference of course.
    gparis

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    9

    Found You talking about mouse coords an can you also help me? ....

    I have also a problem -

    How to make these dynamic textfields drging(dragable) with mouse(or near My_Pointer_clip) and displaying current(realtime) the _x _y coordinate values ?
    Or how to duplicate these dyn.textfields in custom mouse trail clip so that they will display values?
    Please, any ideas

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