I'm embarrassed to even ask this, but: what does 'this' refer to?

I am losing the plot trying to Google 'this'; it just isn't working. BUT I did find a description by looking at the ActionScript 3.0 documentation index. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#this
Here it is:
"A reference to a method's containing object. When a script executes, the this keyword references the object that contains the script. Inside a method body, the this keyword references the class instance that contains the called method."
Soooo, to access a property or method from a method within the same class, you would type this: this.method() or this.property, right? I'm pretty sure it works without 'this.', but it's confusing me because I learnt PHP before ActionScript, and you always require 'this ->' in this circumstance.
Also, what the aubergine does 'this' refer to when used from the main timeline (not within a class)?
Post script:
Sorry about using the word 'this' so much……… this.

1. I think Ned's explanation linking this keyword to timeline is limiting because timline can be an attribute of MovieClip instance only whereas this keyword refers to ANY AS3 object's instance scope. Main clue is the word INSTANCE. So, this keyword has much wider meaning and usage.
2. Although this is true that one of the conveniences of this is to use it as an associative array, I wouldn't say it is the main usage. In my opinion, in well designed OOP applications the is not need for associative array syntax because there are many more efficient approaches to reference to properties.
"I won't be needing to use the 'this' statement to access other methods and properties from within the same class."
You should reconsider.
Here are examples when this is very useful:
A. Methods parameters vs instance properties/methods naming conventions.
In this example method's parameter and instance property have the same name but there is no confusion:
private var width:Number;
public function changeWidth(width:Number):void {
    this.width = width;
B. Names of instance property and method's variable are the same. Again, references are clear:
private var myVariable:String;
private function doSomething():void {
    var myVariable:String = "BLAH";
    this.myVariable = "ANOTHER BLAH";
Also, although AS3 doesn't support overloading, one can call methods scoping them to either this or super.
override protected function myFunction():void {
private function callMyFunction():void {
    this.myFunction();
    super.myFunction();
In addition, when static vs instance propertied/methods are used - one cannot scope static ones to this which sometimes is useful as well.

Similar Messages

  • This is probably a stupid question, but what does the red circle with a number in it mean on iCal? It looks just like the emails notification. I do not have anything do or up in my cal.

    This is probably a stupid question, but what does the red circle with a number in it mean on iCal? It looks just like the emails notification. I do not have anything do or up in my cal.

    Actually, another person on the "more like this" had the right answer. It meant I had a notification for an invite that I needed to respond to.
    Hope this helps you as much as it helped me.
    D

  • Finally MS-8348A's new firmare is here, but what does it do?

    The 150D MS-8348A's new firmare is online, but what does it do? Are we suppose to try it and see by ourselves? Does it allows new cd's capacity, better compatibility?
    Snoopo

    I just installed an MS-8345A (took a while to figure out whether I had an A or a B model -- this should be easier to tell).
    It won't read a CD-R made on another computer running NERO 5.  All other CDROMs can read this CD.
    I saw a very new firmware update (1.50) and downloaded it.  Absolutely bad install instructions.  It says to copy the files into the C:\ drive and then run the install program in "real dos" what ever that is.  I move the files to the C:\ drive, booted to a DOS 6.22 system. and WOW DOS can't read an NTFS file on the C:\ drive.  So, I copied files to the diskette, booted to DOS 6.22 and the install went OK, as near as I could tell.  The last message said that my firmware version 140D was updated to version 150D.
    Didn't fix a thing.  Still can't read the CD-R.  The note on the Support Driver Download page said that it was to "improve medium compatibility".  Didn't
    I also had a real hard time getting this CD/RW drive to boot from the Windows XP Home setup CDROM.  Took many tires before it would boot.
    So far I'm not impressed.
    Anyone else tried this?  Anyone else having trouble reading CF-Rs?

  • To clear cookies i should access tool menu but what does this llok like as I cant see one!

    I want to delete all cookies but I need to access the Tool menu. What does it look like as I cant find/ recognize it. A list of the screen functions and where to access things from would help
    Thanks
    Neil

    You can find the Options menu item in the right column if you click the orange Firefox button.<br />
    Via the arrow at the right of Options you can open an extra menu with other Option choices.<br />
    Items that show a distinct highlighted arrow act as two different choices: the main item on the left and an extra menu with choices if you click the arrow. Items with an ellipsis (&hellip;) indicate that another window will open.

  • On my mini ipad, I cleared the cookies/histories in the safari setting.  But what does the advance-setting of the clearing the website data does?  What's that used for? Thank you!

    On my mini ipad, when I'm on the internet -- a few times I will see a blue small pop-up boxes telling me to allow down/load or add something like the bubble-splash game or something similar.  I jusr click ignore and it goes away.. I'm not sure why it's showing up lately.. I'm not sure if it's a virus or hacked in or a web brower matter..
    Should I go to the cookies/histories in the safari setting and have it cleared out?  Will that help resolve that?? 
    And what does the advance-setting of the clearing the website data does?  Sorry, I'm not familiar.. what's is that used for? Should I use that feature as well?? Thank you!

    This indicates corrupt files.
    A restore should resolve.

  • A:; is valid, but what does that stand for?

    hi guys,
    just wonder why when doing this:
    public static void main(String args[])
                a:;
    }the a:; is valid, no compile/runtime error. what does that stand for?

    It can be used to exit a deeply nested loop structure:public class Loop {
      public static void main(String [] args) {
        outer: for (int i = 0; i < 100; ++i) {
          for (int j = 0; j < 100; ++j) {
            for (int k = 0; k < 100; ++k) {
              for (int l = 0; l < 100; ++l) {
                for (int m = 0; m < 100; ++m) {
                  if (m > 42) {
                    break outer;
                  System.out.println(i + " " + j + " " + k + " " + l + " " + m);
    }(Although yawmark's use is much more entertaining)

  • I have two accounts and need to merge into one account. How? Where to even ask this question? Chat will not assist in this.

    Over the years I accidentally opened a second Adobe account, both with product registrations. I need to merge these accounts into one and see no way to do that. Updates to software will not install because serial for previous version not found on upgrade versions now installed. Could the 2 different accounts be a cause for this?  I got no help at all from chat.

    Adobe chat support is likely to be the only resource capable of dealing with your account.
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Adobe ID and registration chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service-c1.html ( http://adobe.ly/19r6ZDp )

  • "Move to trash",  ask password but still does not delete the file

    hi, when i try to delete any file on my mac, the laptop ask for password, then i put the password but it still does not delete the file. Anybody can help?

    Make sure the application or document you are trying to delete is not open or running.

  • I have the Itunes.msi file it asks for, but what network are they talking about as I am not on a network with WIN XP SP3

    When I try to install the newest Itunes, I get a message saying that it cannot find Itunes.msi.  I have that file in the Apple updates directory and I point to it.
    After hitting enter, it comes back to the same question with the implication that I am not on the right network. I am not on any network. Please help

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • So my iPod touch 4g 8gb cracked the other day. This is my SECOND iPod, receiving this one free from apple. I know there is no chance for gettin free again, but what does the repair price(100$ online) replace OR repair? Because i see some say 150$.

    I really need to know. ASAP

    The Apple exchange price is $199 for 65 GB 4G and $99 for the other 4Gs. The 5G is $149.
    Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • MSFT calls it Tracking but what does Apple Call it?

    You know when you send out an email and once the person at the other end receives they send an auto email that yes I got your email?
    Anyone know what it's called for mail.app.
    I've slowly done the switch over to using full mac at work and so far loving it.

    I don't recommend it, but it can be done. Quit mail and run Terminal. Type this command and press return:
    defaults write com.apple.mail UserHeaders '{"Disposition-Notification-To"="your@address";}'
    using your correct email address instead of your@address.
    All messages sent with Mail will now include the Disposition-Notification-To header which is the one asking for a return receipt.
    If you wish to turn off this feature in the future, the Terminal command is:
    defaults delete com.apple.mail UserHeaders
    It is a hidden feature, and comes with several warnings:
    use at your own risk
    once you set it, it applies to all messages until you unset it
    it can only be done from the terminal, with mail shut down
    using it does not guarantee a response - some mail clients will ignore it, and many mail users will have told their clients to ignore it
    AK

  • Airport is functioning, but what does connection timeout mean

    When I try to join my network, I get a "connection timeout" message. HELP!

    Do you have a picture of it?
    Seriously this is the iPhoto forum - try the network forum - http://discussions.apple.com/forum.jspa?forumID=1222 if you have Leopard
    LN

  • Ipod Nano 2nd generation (Its asking to Restore, what does that mean)

    I just dont understand why it wants me to restore, how do i do it!

    dont do it!
    i did it and its not working now..

  • New apps indicated in iTunes on mac - what does this mean?

    I am using iTunes 10.7 on a Mac running 10.8.2 Mountain Lion and sync with my iPad 3 running iOS 6.0.1.
    I have 770 apps of which about 500 are ON THE iPAD and another 270 are in the purchased but not on iPad section on the cloud I guess.
    All apps are up-to-date.
    BUT when I go to to iTunes on my Mac, when I look in the sidebar I see next to Apps a gray oval with the number 107 in it.  Now I have a similar gray oval (there is a special name for this "gray oval"…) for other things, like Podcasts or TV Shows.  I know the number in those gray ovals means "Unwatched" and it is correct-- any Podcasts which I have downloaded or TV Shows which I have that I HAVE NOT WATCHED are so indicated.
    BUT what does the number mean for APPS??  Someone told me it may mean "APPS THAT NEED UPDATES" - but ALL my Apps on my iPad 3are up-to-date and this syncs regularly with my iPad---
    So what in the world is this number 107 indicating and how to get rid of it or what action to take to respond to it?
    Thanks for any comments.
    Best regards,
    Steve Schulte
    Saturday 8 December 2012

    Thanks for the feedback! From your reply I think I may understand this better: I have downloaded 700+ apps and deleted over 200 of them.  I show 116 in my iTunes that "have an update available" - but I believe these are all apps that I deleted, so they have NOT been updated on my iPad as they are no longer on the iPad.  (But iTunes keeps essentially all versions on my Mac it seems).
    OK why not just hit "update" for the 116 apps?  Because I have 2 that I downgraded intentionally - and don't want to take the chance that ZITE 1.3.3 or Bloomberg version 1.x are replaced by the (in my opinion) poor upgrades.
    I will try to reinstall a few of the "deleted" apps, then see if they have upgrades.  If so I will do that and then see if this syncs to iTunes and thereby reduces the number of upgrades-- well indeed I'll look for the specific apps I have re-installed and upgraded!  Then I'll report back here.
    Thanks again,
    Steve--

  • TS3988 I use iCloud. I have an iPhone, Apple laptop, and I recently bought an iPad. The pictures I take on my phone can be viewed on my iPad, but what about all the pictures on my phone that I took before I bought my iPad? How do I view those with my iPad

    I use iCloud. I have an iPhone, Apple laptop, and I recently bought an iPad. I can view the pictures I take on my cell phone on my iPad. But what about all the pictures I took on my phone before I bought my iPad? How do I view those on my iPad?

    POP: yahoo, aol, comcast/time warnder/road runner
    Imap: google, hotmail, and more including icloud.
    If you want to use multiple devices - move to imap, I would even say "exchange", but Google does not support free exchange anymore, since January of that year. So Ironically  Icloud or Hotmail would be my choices right now.
    To find out more about what happens to you, search on Google "difference between pop and imap"

Maybe you are looking for

  • Logical Fact Column -Urgent

    Hi All, I have a measure in my production reporsitory which is working fine & giving expected results. I have one more environment which is similar to production, and in that environment the repository is pointing to Production Database. One Measure

  • It says i need to download the new version of pages but i already have. What do i do!?

    my mac pages wont let me access any of the documents i have editied on my ipad with the new update. Every time i click on a document it says u need to download the new softwhere, but i already have! So why isnt it working! i need to access those file

  • Large jump in my BB usage in October 2010 - is it ...

    I use the basic BB service with 10Gb per month allowance. I typically use between 9 and 14Gb per month. In October, this jumped to 35GB so I am being charged £25 for the privilege when nothing has changed wrt my usage pattern. Two questions for every

  • Can't edit titles or transitions in iMovie 10.0.2

    I just recently upgraded to OSx 10.0.2 and with came an upgraded iMovie. Unfortunately I am unable to edit either my transistions or titles. I have never had a problem before in all the years that I have used iMovie until the upgrade. Any suggestions

  • Domain controller anomalous connection to remote Redplaid SMTP server

    We've been battling some bandwidth issues at my company lately and so we've done extensive scouring of our Cisco ASA logs to try and find the source(s) of the problem. Over the weekend I ran into this little gem: 2014-03-22 12:14:13        Local4.War