A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: this command...

  1. #1

    this command...

    I am trying to skip a couple of levels in my actionscript book and ask a question I still don't understand.


    what does this._x and this._y do exactly.
    lamens terms please?

  2. #2
    _global.chosenson="flash"; chosenson's Avatar
    Join Date
    Jul 2002
    Location
    BIG APPLE
    Posts
    716
    _x/_y refer to the x/y coordinates of the object they are referencing.

    for instance, I have a movie clip on stage at a postion of x=100, y=100

    On the movieclip i place a script like :

    onClipEvent(mouseDown){
    yPos = this._y;
    xPos = this._x;
    trace(yPos);
    trace(xPos);
    }

    this would show an out put of
    100
    100
    If you have a question, need some help, email me:chosenson

    It's always the simplest things that escape the complex mind!

    always be just

  3. #3
    Left-Handed Flash User mickbrit55's Avatar
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    1,375
    .... andthis refers to the timeline you are in

  4. #4
    \/\/EB/\/\ASTER lukesquall's Avatar
    Join Date
    May 2003
    Location
    Solitude
    Posts
    683
    Originally posted by mickbrit55
    .... andthis refers to the timeline you are in
    Slighty true. If you are adding code to a frame, then yes, this refers to the timeline, but if you are adding code to an MC then it will only refer to that MC.

  5. #5

    so with drag what will it do

    So how do I use this

    onClipEvent(mouseDown){
    yPos = this._y;
    xPos = this._x;
    trace(yPos);
    trace(xPos);
    }

    with drag....????

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