Having trouble accessing class get function

Hi;
I am writing a flash AIR application.
I have a document class attached to a FLA to put elements on the stage, It Then instantiates and puts myClass1 an the stage. MyClass1 puts more elements on the stage, and sets the value of a variable _myValue. MyClass1 also has a public getter function which returns _myValue.
The document class then instantiates MyClass2, which is passed a reference to MyClass1. MyClass2 needs to access _myValue in MyClass1.
The following code structure throws an error. While not the exact code, the code below should show haw it was implemented. I have condensed the code to make it understandable.
If you want to see the whole code I'll try.
DocumentClass.as
package ui {
          import flash.display.Sprite;
          public class DocumentClass extends Sprite {
                    public function DocumentClass() {
                              var  myClass1:MyClass1 = new MyClass1();
                              addChild(myClass1);
                              var myClass2:MyClass2 = new MyClass2(myClass1);
                              addChild(myClass2);
MyClass1.as
package ui {
          import flash.display.sprite;
          public class MyClass1 extends Sprite {
                    private var _myValue:int;
                    public function MyClass1() {
                              //some code to add stuff to the stage.............................
                              _myValue = 10;
                    public function get myValue():int {
                              return _myValue;
MyClass2.as
package ui {
          import flash.display.Sprite;
          public class MyClass2 extends Sprite {
                    public function MyClass2(referenceMyClass1:Sprite) {
                              var ref:Sprite = referenceMyClass1;
                              var myValue:int = ref.myValue();
This gives me an error
MyClass2.as, Line 39 1061: Call to a possibly undefined method myValue through a reference with static type flash.display:Sprite.

Thanks for your responce. That was one of the problems.
As it turns out another problem was:
public function MyClass2(referenceMyClass1:Sprite)
should have bee
public function MyClass2(referenceMyClass1:MyClass1)

Similar Messages

  • I have a MacBook Air with OS X and am having trouble accessing the ADT Pulse Home Security System cameras.  The mobile (iPhone and iPad) apps allow access no problem, but I can't get a picture on the MacBook.  Have tried Safari and Firefox browsers.

    I have a MacBook Air with OS X and am having trouble accessing the ADT Pulse Home Security System cameras.  The mobile (iPhone and iPad) apps allow access no problem, but I can't get a picture on the MacBook.  Have tried Safari and Firefox browsers.  Anyone have any ideas?  Thanks.

    From a Catherine to Katherine -- Had the exact same problem!!  I had to enable Java twice - both in Safari and then on the MacBookAir itself.

  • Having trouble accessing photos

    Ever since updating my 4s to the ios7, I am having trouble accessing my photos when using apps such as Facebook, text messaging, and Google hangouts.  It says that the app cannot access my photos and to change my setting in privacy settings.  When I go to the privacy settings and click on photos I get a message saying that if an app wants to access my photos it will be listed and I can change the setting, however none of the apps are ever listed.  How do I change my setting so I can upload pictures that I have already taken on my phone?

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    This is not necessarily a permissions issue, but could also be a corrupt library.
    To repair permissions in the iPhoto Library: Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. You'll see the option to check and repair Library permissions.
    If that doesn't help, what version of iphoto do you have? Assuming 09 or later...
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • Having trouble with the video function..

    I just purchased the 60GB ipod photo. I'm transferring music files easily. However, I'm having trouble with the video function. I've loaded Itunes 6, reloaded the original setup disk, and have loaded the latest updates for the unit. I can download movies from the itunes store and save them to my library, but I cant seem to transfer the video files to the ipod. Ive reinstalled itunes and the update 6 with no success. After syncing the ipod it only shows the music files even after all that Ive tried. Additionally, there is no evidence of the video function on the main menu after the update attempts. Can someone tell me what I'm doing wrong? I'm eager to get past this problem so that I can start tranfering personal movies and video files.

    You Have an iPod Photo, You do NOT have a 5th Generation Video iPod. Get it? You need the 5G model to play video.
    If the salesman told you it was the 5G model he lied, was ignorant or both. If video is important or if thats what you thought you were getting you will need to return your 4G iPod photo for new iPod.
    Rotsa Ruck!

  • I'm having trouble with the repeat function on iTunes 11.

    I'm having trouble with the repeat function on iTunes 11.  The buttons are there but will not allow me to repeat an album when selected under artist from remote app on iPhone.  I have downloaded the update for the remote app but the repeat function now repeats all albums under that artist name.  Selecting the album directly under albums works but is not as easly to access.  Any thoughts?

    Sorry, downgrading is not supported.

  • Just joined cloud computing  having trouble accessing premier pro ...help please

    just joined cloud computing  having trouble accessing premier pro ...help please

    Hi Jeff:  thanks for getting back to me.  My daughter was downloading
    components but had downloaded the free demo last night.  She
    uninstalled what she thought was the demo but now we are unable to
    access the Premier Pro component and no icon is present on the screenor
    otherwise.  This is our first time with a Mac so maybe we just don't
    know where it is but are at a loss right now.  Thinking I should
    cancel my product purchase and then start from scratch if there is no
    easy solution.
      Your thoughts?
      Duarte

  • Having trouble with the str()function

    I'm having trouble with the str() function. The first parameter is the value and I want to set the format but I keep getting an error. I do it like this. str(locals.array[8]-locals.array[9],"%$.6f"). I get a runtime error, so I tried to remove the "" but now the I get a syntax error.

    Hi,
    Can not see a problem with your statement.
    I have attached a TS2.0.1 example using you expression.
    Regards
    Ray Farmer
    Regards
    Ray Farmer
    Attachments:
    Sequence_File1.seq ‏20 KB

  • TS1398 I am having trouble accessing certain websites on my ipad2

    I am having trouble accessing certain websites on my ipad2 which I used to be able to access. all I get is a white/blank screen. One site is www.fodors.com. another is http://www.baseballhq.com/members/. Any suggestions?

    I have no trouble with them. Try this and see if resolves the issue,
    Go to Settings>Safari>Clear History, Cookies and Data. Restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    If that doesn't help, quit Safari and then relaunch it.
    Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    If that doesn't help, try this.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • I have a new Mac, I am having trouble accessing Bill Pay on my banking site. After 2 unsuccessful calls to my bank, I thought I would ask here....is there something I need to do?

    I have a new Mac. I am having trouble accessing the Bill Pay on my bank site. After 2 unsuccessful calls to my bank I thought I would try here. Is there anything I need to change in my settings?

    We can't really say without more information.  It could just be that your bank site stinks and only works in Internet Explorer, which means you can't use it without Windows.  It could be that it relies on Flash or Java and you don't have either installed.  Your bank should be able to tell you if it requires either of those, and we can tell you where to get those things.  Or it could be something else entirely.

  • A connection to the QuickTime server could not be established. This computer may be having trouble accessing the Internet or the server may be offline

    When I select “Update existing software in QuickTime Pro I get an error message saying “A connection to the QuickTime server could not be established. This computer may be having trouble accessing the Internet or the server may be offline”
    This has persisted for several weeks. Any help will be welcomed as I do not know how to contact QuickTime support via Apple.
    I am using Windows 7 64 bit.  
    Many thanks

    I was able to download and install the latest version of iTunes  (10.6.3.25) without a hitch. After the reboot I tried again to update my exisitng Quicktime Pro software as described in my original posting and got exactly the same error message.
    If it happens that there is no software to download because I am already running the latest version, surely a message to that effect would appear and not the one saying “A connection to the QuickTime server could not be established. This computer may be having trouble accessing the Internet or the server may be offline”
    Still seeking advice if possible
    Cheers

  • Why am I having trouble accessing my voicemails?

    I am having trouble accessing my voicemails.  This seems to happen randomly.  Sometimes I can get them and sometimes I can't.  I'm always notifiede that I have a voicemail, but usually I can't get it to play the recording.

    If the App store app is crashing see:
    IOS 6 App store crash: Apple Support Communities
    For othe other problems try:
    Try:
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • TS3899 Having trouble accessing my email account thru the mail app, after entering the account information in the settings page, hotmail returns with the error message " The user name or password for Hotmail is incorrect

    Having trouble accessing my email account thru the mail app, after entering the account information in the settings page, hotmail returns with the error message " The user name or password for Hotmail is incorrect". Help

    Hotmail is having problems:
    http://bostinno.streetwise.co/2013/08/15/hotmail-outage-hotmail-is-down-for-user s-still-photos/
    http://www.engadget.com/2013/08/14/outlook-outage/
    http://www.infoworld.com/d/applications/microsofts-skydrive-outlookcom-are-down- some-users-224940
    http://mashable.com/2013/08/14/outlook-down/
    http://techcrunch.com/2013/08/14/microsoft-acknowledges-outlook-com-messenger-sk ydrive-outages/

  • HT201210 Is anyone having trouble accessing the iTunes store?

    Is anyone having trouble accessing the iTunes store?

    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/ht1311
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
     Cheers, Tom

  • Having trouble accessing internet with new wireless WRT54...

    Having trouble accessing internet with new wireless WRT54G. Used easylink to read existing router BEFSR41 which works great to westell modem provided by Verizon. When connect new router Easylink configures WRT54G but when trying to connect to internet...fails. All lites indicate good. Not using wireless device yet, just the wired ethernet. Router set up as DHCP.
    I keep going back to old router and works great every time. Help! 

    Thanks for response, however I tried setting unit to 192.168.2.1 (leaving DHCP) to no avail. I put my old unit (BEFSR41) back in and I'm back up. I need to sit back and decide which way to go on this. Perhaps it's defective and I should return it.

  • HT6029 Having trouble restricting the restore function on an iPad through Apple Configurator

    Having trouble restricting the restore function on an iPad through Apple Configurator
    I cannot find the setting the allow/disable this feature.

    Configuration profiles do not allow you to apply a static IP address to a device.
    Instead, it would be highly recommended to configure static IP addressing within the DHCP server itself. This would accomplish what you want without worrying about which proifle goes on what device, etc. Configurator can also export the MAC addresses to make life easier in setting this up.
    Right click the 'All Devices' in the Supervise tab, click Export Info > Device Information > WiFi MAC Address.

Maybe you are looking for

  • ORA-00600: internal error code, arguments: [6122], [0], [4], [0], [], [], [

    Hi All, I Got ORA-00600: internal error code, arguments: [6122], [0], [4], [0], [], [], [], [], [], [], [], [] today i check for Oracle knowledge but i can see only until 9i version. I am pasting my OS AND database version below Oracle Database 11g E

  • When saving revisions to a template does it change the editable divs on existing pages?

    I have made changes in a template that has at least 100 child pages.  When I apply the changed template to these pages does it change any of the editable sections of the child pages?  I would guess it does not but I need to know for sure.  It would b

  • BUG: iTunes 7 Visualizer overlayed by new cover brower

    When visualser is active in iTunes window (i.e. not full screen) and the cover browser is active, the cover browser window remains. Is hidden ok when visualser in full screen mode.

  • Portforwarding 3389 requests for more than one pc

    I have 2 computers that I want to acces through internet using Remote desktop. On my WRT54G I have forwarded port 3389 to internal ip 10.0.0.100. for the second pc I thought of using port 3390 external to ip 10.0.0.99 3389 internal. I have done so on

  • Forgot Smartphone password

    My company provided me with a business bb I used for years; its a bb 8800. I left my company in June 2013 and they said, that I can keep the bb. I was abroad the last 3 months and didnt take my bb along. When I returned two weeks ago, I have forgotte