A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Difference between 'This' and 'Stage'?

  1. #1
    Member
    Join Date
    Oct 2010
    Posts
    55

    Difference between 'This' and 'Stage'?

    what are the differences between '.this' and '.stage'?

    I've searched, found nothing

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Well I can't be 100% positive, but this refers to the current object. It will change based on which class or level you are current at. Within a class, this will refer to the class itself. Stage refers the main displayObjectContainer. This is the area in which all displayObject are added to.

    I know someone can explain it better, but that is how I understand it.
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Member
    Join Date
    Oct 2010
    Posts
    55
    thanks samac, I believe I got the idea.

  4. #4
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    760

    Smile

    Quote Originally Posted by samac1068 View Post
    Well I can't be 100% positive, but this refers to the current object. It will change based on which class or level you are current at. Within a class, this will refer to the class itself. Stage refers the main displayObjectContainer. This is the area in which all displayObject are added to.

    I know someone can explain it better, but that is how I understand it.
    Good explanation.

    I would add that the "this" statement is a common term used in many different languages that refers to the current object.

    The "stage" statement however is found specificlly in flash and was added to the language with as 3.0.
    [SIGPIC][/SIGPIC]

  5. #5
    [Horse Thief] gotoAndCrash's Avatar
    Join Date
    May 2007
    Location
    NW, USA
    Posts
    576
    Perhaps the "stage" of an object could be defined as any area (of the object) not inhabited by graphics or other "physical" objects???

    Edit: Well, I guess that's fine for MouseEvents & such, but in terms of something like KeyboardEvents, it's more like a ghost with an event listener on it!
    1 Infinite Loop, Cupertino is a portal of Hell.

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