Inheritance problem: base class does not see stage instances

I'm writing a series of Search windows for an application. I create the FLA files on the stage, each has 3 simple buttons: next_btn, prev_btn, and close_btn. Those all have event listeners which call findNext(), findPrev() and closeWin() respectively. Each search window looks for different things, some with a text box and some with a combo, etc.
So I have a base class com.search that extends Sprite and adds the eventListeners at startup (actually, on addedToStage). Like this:
function isAddedToStage(evt:Event){
   next_btn.addEventListener("click",findNext);
   prev_btn.addEventListener("click",findPrev);
   close_btn.addEventListener("click",closeWin);
Then I write the appropriate find functions in each derived class.
For example, I have
package com {
     import com.search;
     class searchText extends search {
In my FLA file, I set the class to com.searchText.
But when I compile and run the window, I get runtime errors:
ReferenceError: Error #1065: Variable next_btn is not defined.
at com::search()
at com::searchtext()
If I add the event listeners in the derived class rather than the base, it works fine. But that seems to defeat the purpose of inheritance, plus it infers that I won't be able to derive new classes/swfs from those derived classes.
So the question is, how does one reference objects created on the stage from a base class of that document's class?

Found it. After messing around with trying dynamic classes and overriden functions that returned the desired button (that worked, but was ugly.)
Simply and silly once you know how.
You have to explicitly reference the stage objects (or any newly declared methods or properties) in the derived class as members of "this" in the base class - so:
class Search {
function isAddedToStage(evt:Event){
   this.next_btn.addEventListener("click",this.findNext);
   this.prev_btn.addEventListener("click",this.findPrev);
   this.close_btn.addEventListener("click",closeWin);
function closeWin(e:Event){
and then create the buttons on stage in the FLA using the derived class.
You can also declare the event handling functions in the base class as empty functions and then override them in the derived classes. Or fill in the functions in the base class to throw a runtime error, and then override - that's as close to an abstract class as you can get, I think.

Similar Messages

  • Airport Extreme Base station does not 'see' Airport w/Airtunes.  HELP!

    I just purchased and installed an Airport Extreme Base startion (802.11n), and it does not 'see' my Airport Extreme with Airtunes. I have already tried re-setting the Airport + Airtunes to the factory settings, but since I installed the new Base station software, I no longer have the Airport Express Sett up assisstant?!?
    What am I doing wrong?

    Your Mac won't be able to communicate with your Airport Express until you reconfigure your Airport Express to join the wireless network now being created by your new Airport Base Station.
    The "Airport Setup Assistant" has been replaced by the "Airport Utility". You can find that new utility installed in your Mac's Applications->Utilities folder.
    What you should do now:
    1. do an factory default reset of your Airport Express.
    2. plug the Airport Express (temporarily) into power in the same room as your Base Station and your Mac.
    3. on your Mac, run the Airport Utility. It should "see" your Airport Express. Click on the Airport Express icon, click to continue (your Mac will switch wireless networks temporarily), click Continue, and follow the instructions for configuring the Airport Express so that it "joins" the existing wireless network created by your Base Station.

  • Boot-archive problem - failsafe kernel does NOT see disks!

    Is there a way to fix the boot archive in 'normal' mode? I can see the disk in 'normal' mode, but not in 'failsafe'.
    HP585 w/RAID5 SAS disks, 1 logical volume
    Thanks!
    Message was edited by:
    bdeeley

    Thanks. I had actually tried that with the boot mode set at UEFI and it didn't work, but I gave it another try set at legacy and it works fine.
    The documentation for this seems confusing to me, though. Isn't this RAID card considered a mezzanine card? The documentation here says to enable the onboard controller to get a mezzanine card to work:
    http://www.cisco.com/en/US/docs/unified_computing/ucs/c/hw/C200M1/install/RAID.html#wp1016766

  • Having problems with one computer not "seeing" the Airport base station.

    Aloha:
    I have an Airport router hooked up to the internet via Cable. I have a laptop and G4 desktop talking to the the Airport Base Station via their respective Airport cards. This allows me to get to the internet with both of my computers. This system has worked just fine for several years, but recently my desktop computer has started to be unable to connect to my Airport Base Station. At first it was intermittent, but now it has stopped completely. The laptop continues to be able to get to the internet via my Airport base station.
    The desktop is running OS 10.3.9 and the airport card in the desktop passes the hardware test that came with the laptop. But it can no longer see the signal from the ABS.
    What might my problem be?
    Dan

    Hi Clinton:
    I have tried that to no avail. I don't see any
    signal, so I see no networks "in the box below" to
    choose. My airport card does not see a signal, but
    the airport card checks out ok in the hardware test.
    Thanks for replying, Clinton, much appreciated.
    Dan
    Have you tried choosing "other..." and then entering the name of your network?

  • Airport Management Utility on new MacBook Pro does not see base station

    I have an old "flying saucer" Airport base station. I
    recently started using a new MacBook Pro. Airport
    connection is fine, Airport Admin Utility works normally,
    but Airport Client Monitor 1.0 shows blank graphs and
    Airport Management Utility 1.0 does not "see" the
    base station. I don't know if the problem is the
    change to Tiger, to Intel, or to AE card. MacStumbler
    and friends also are "blind".
    MacBook Pro Core 2 Duo   Mac OS X (10.4.8)  

    Try rebooting the airport, then going to airport utilities and go thru the set up proceedure following the prompts.  Also go to system prefernces in location select automatic.

  • I am having problems opening images renerated in lightroom5 into cs6. Cs6 bridge does not see the lightroom libarary. If I open lightroom and right clik the image, edit in cs6, 6 opens but the picture doesnot follow. What is going on? Give me a hand.

    I am having problems opening images renerated in lightroom5 into cs6. Cs6 bridge does not see the lightroom libarary. If I open lightroom and right clik the image, edit in cs6, 6 opens but the picture doesnot follow. What is going on? Give me a hand, thanks.

    What edition of LR 5? What edition of ACR does PSCS 6 contain. If they are not parallel (same edition number x in [5 or 8].x ), is LR making a tiff or psd rendition of the image?

  • HT1918 Itunes store will not let me use the money on my account. It wants to make me use a credit card. I have already redeemed a card yet it does not see it. What's the problem?

    Itunes store will not let me use the money on my account. It wants to make me use a credit card. I have already redeemed a card yet it does not see it. What's the problem?

    Some Purchase require a Credit Card... For example Gifting and In-App Purchases.

  • Airport Utility does not see Base Station but I'm still online

    I have an original airport base station and just downloaded Airport Utility 5.5.1
    The base station is working because I'm online with it posting this thread.
    But Airport Utility 5.5.1 does NOT see it...
    The strange thing is that I have one of the early dome Airport Extremes here as well. That one IS recognized but the Airport Utility.
    Anyone have any suggestions as to why the original Airport is not showing up in the utility even when I know it's obviously being seen by my card and connecting to the web?
    Thanks
    g

    Did you power cycle your network as follows?
    Power everything on the network down, order is not important
    Wait a few minutes, then start the modem first and let it run a few moments by itself.
    Then start the next device connected to the modem and let it run a few moments.
    Then start each device the same way until everything is up on the network.

  • I have had no previous problem downloading iPhone pict to my Mac, but now, although the Mac sees the iPhone, iPhoto does not see the camera roll. Any ideas?

    I have had no previous problem downloading iPhone pict to my Mac, but now, although the Mac sees the iPhone, iPhoto does not see the camera roll. Any ideas?

    Repair your disk permission: http://bit.ly/OeD7U3.
    Run Cleanup tool http://bit.ly/vnukXY
    Download updated driver from Lexmark website www.lexmark.com
    Run firmware update http://bit.ly/AcNqbg
    Reset printing system http://support.apple.com/kb/HT1341

  • I told my wireless network to forget two airport expresses so that I could rename them.  Now the network does not see them even when plugged in about 10 feet away from the airport extreme base station.  Does "forget" mean forever?  How to reset?

    I told my wireless network to forget two airport expresses 1 1st gen, 1 2nd gen so that I could rename them.  Now the network does not see them even when plugged in about 10 feet away from the airport extreme base station.  The network does recognize a totally new 2nd gen express.  Does "forget" mean forever?  How to reset?

    The network does recognize a totally new 2nd gen express.
    Then, it sounds like you have already reset the 2nd Gen Express, and now you need to set it up again, like you did the first time. Only, this time, assign the device name that you want to the AirPort Express.
    Do NOT use the name that Apple suggests.....which will be something goofy like........Sueswimsf's Red Apple AirPort Express
    Assign a simple name.....something like     2ndGenExpress

  • Object Category CL_ABAP Class does not exist

    Hi Experts,
      When Iam creating a workflow tasks or template the object category CL_ABAP Class does not exist in drop down box. Only BOR Business object is appearing. Could anyone help me the problem and how to resolve it.

    Jose,
    Note: If you are in a 6.20 system and can't see the Object Category choice "ABAP Class", then you first need to execute report SWF_CATID to enable "ABAP Classes" as an available object category. It's already done for you in releases 6.40 and higher.
    I am guessing you are in SAP_BASIS 620 version.
    Courtesy:
    This is from blog written by jocelyn dart of ABAP OO Workflow.
    For more details pls check this:
    /people/jocelyn.dart/blog/2006/12/19/using-functional-methods-in-workflows-and-tasks
    Hope this will help.
    Cheers
    Jai
    PS: Small correction report name is RSWF_CATID not SWF_CATID

  • MacBook Does Not See HP Photosmart C4480 Connected to Airport Express

    I have an AT&T 2wire wireless & router as my internet access. Today I turned off the 2wire wireless and was able to set up an Apple-based home network with an Airport Extreme Base Station and Airport Express which I configured to extend the AEBS network. Both the AEBS and Airport Express show "green" for setup.
    iTunes sees the Airport Express.
    The Airport Express sees a HP Photosmart C4480 printer I have connected to it via the USB port.
    - I do not have the C4480 driver installed on the MacBook.
    PROBLEM: The Macbook sees the AEBS and Airport Express but DOES NOT see the HP printer connected to the Airport Express. When I go to System Preferences > Printer > Add Printer it does not see the HP and I don't know the IP address to add it. What can anyone recommend?
    Thank you

    Apple Tech Support solved this problem quickly and easily. In short, the USB connected printer was pointed to the computer and not the Airport Express. Here's what they ran me through:
    - Assumes the Airport Express sees the printer as connected via USB
    1. Open System Preferences > Print & Fax
    2. Regardless of the printers you see, click the "+" button to add a printer
    3. Select the Default icon
    4. Check the Kind... should be Bonjour
    5. Select the printer type connected to the Airport Express... the system will start to add such a printer
    6. Ensure the Location is the Airport Express (mine was previously pointed to the MacBook)
    -- You can change the name here is you like also such as "Kitchen HP Photosmart c4480)... recommend a different name than the original one installed so you know which one to remove later
    7. Select Add
    8. Remove the original printer which is pointing to the MacBook
    You should be good to go.... Key points: Bonjour and Location as the Airport Express

  • Edge does not see the edge actions file.

    Working with Edge version 1.5.0 and Visual Studio 10.  Just about finished with a project and now all of my code has disappeared from Edge, I can't see any of my triggers on the timeline or events on the buttons.  I can still open the html in a browser and everything still works but I can't do any more edits inside of Edge because I can't see the code in there.
    The edge actions file has all the code, but Edge does not see any of it inside Edge.   I tried pasting the full code back into Edge but it would not save it.  How can I get edge to see the code again?

    Elaine,
    Thanks for getting back, however, I cannot ZIP up the project since it is proprietary.  It is fairly large with multiple levels of symbols.  I can open the Edge Actions file outside of Edge and see all the code just fine.  When I open the code in Edge this is all I get:
    * Adobe Edge Animate Composition Actions
    * Edit this file with caution, being careful to preserve
    * function signatures and comments starting with 'Edge' to maintain the
    * ability to interact with these actions from within Adobe Edge Animate
    (function($, Edge, compId){
    var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes
       //Edge symbol: 'stage'
       (function(symbolName) {
       })("stage");
       //Edge symbol end:'stage'
    })(jQuery, AdobeEdge, "EDGE-157779901");
    I cannot paste over this and save.  Not sure what I need to do. Thanks for your help.
    -Stephen

  • Aperture import does not see files on hard drive

    This happens again and again, and it's EXTREMELY irritating.
    I am trying to import some existing JPEGs on my Desktop. When I try Import in Aperture, the file browser simply does not see most files and folders. Sometimes it does and sometimes it doesn't. It seems to happen on a whim. This is very bad, I have just about had it with Aperture. And yes, permissions are set correctly.
    Can anyone figure out on what basis Aperture sees or does not see certain files/folders?

    I am trying to import some existing JPEGs on my Desktop.
    Do you mean your Desktop folder? And is the Desktop folder the only folder that is showing this behaviour?  I have never had problems to open images directly from the Desktop. Have the image files been dropped directly onto the the Desktop or into a subfolder of the Desktop?
    Previous MacOS X versions had problems with a huge number of files on the Desktop because this folder has been treated in a special way.
    Which version of Aperture and MacOS X are you using?
    It might be a problem with permissions or file ownership.
    If the problem with your Desktop folder persists you could try to reset the permissions,ownership, and access control lists on your Home folder as described in Linc Davis's post here:  Re: iPhoto returns OSStatus error -54
    Have you by any chance encrypted your Home folder by File Vault?

  • Dell Laptop does not see AEBS

    I have a Dell Inspiron laptop with a built in wireless card. Airport Utility does not see the AEBS. I disabled the "radio" on my Intel ProSet Wireless and connected the AEBS to my laptop using an ethernet cable. I can then see and configure the AEBS. I've tried adjusting the settings, picking either 802.1 "b" or "a" compatibility, but I still do not see the base station unless it is connected by the ethernet. Are there settings I need to adjust on the base station or on my laptop so that the wireless will work?
    Terry

    Did you ever figure out how to get your dell to recognize the AEBS? I am having the identical problem.

Maybe you are looking for