Sprite won't display on stage.

I'm sure you're expecting me to have forgotten to use addChild. I wish it was that easy. I will say I'm very new to AS3.0. I have a movie clip in my library that contains a small PNG file and a text label. The linkage properties are: Class: shapes.HorizontalIcon, Base class: flash.display.Sprite.
The Horizontal Icon class isn't doing much yet.
package shapes {
    import flash.display.Sprite;
    public class HorizontalIcon extends Sprite{
        private var type:String = "horizontal";
        public function HorizontalIcon(){
            super();
            this.x = 33;
            this.y = 104;
            trace( "horizontal" );
And then there's the code in the parent sprite:
import shapes.*;
var horiz:HorizontalIcon = new HorizontalIcon();
addChild(horiz);
As far as I can tell this should work. There are no errors. The trace statement above shows up in the output. The parent sprite is also an item from the library. It shows up on the stage. I tried adding a random TextField to the parent sprite it showed up on the stage just fine.
Something isn't working right, but I don't know where to start debugging this. Any insight or pointers will be greatly appreciated.
-Sean

Well, the first thing I did, was make sure the constructor for HorizontalIcon was being called. In the interest of being able to give as much info as possibile I went back in can traced everthing. ADDED_TO_STAGE is firing alright, but it seems to be firing twice.
So what I'm trying to do is create an accordian navigation element. The Accordian class kicks everything off with
function init( e:Event ):void{
     trace( "Accordian:init" );
     panelArray[0] = new SPanel( true, this.firstPosition );
     panelArray[1] = new CPanel( false, this.hiddenPosition );
     panelArray[2] = new DPanel( false, this.hiddenPosition );
     panelArray[3] = new BPanel( false, this.hiddenPosition );
     panelArray[4] = new CPanel( false, this.hiddenPosition );
     panelArray[5] = new EmPanel( false, this.hiddenPosition );
     panelArray[6] = new EtPanel( false, this.hiddenPosition );
     panelArray[7] = new PPanel( false, this.hiddenPosition );
     panelArray[8] = new TPanel( false, this.hiddenPosition );
     for( var i = 0; i < 9; i++ ){
          trace( "   " + this.panelArray[i] );
          this.addChild( this.panelArray[i] );
Each of the panels created here is a subclass of AccordianPanel. AccordianPanel looks like this:
public class AccordianPanel extends Sprite {
     public function AccoridanPanel( showing:Boolean, y_pos:Number ){
     this.addEventListener(Event.ADDED_TO_STAGE, init);
     protected function init(event:Event):void{
     trace("AccordianPanel.init");               
And SPanel like this:
public class SPanel extends AccorianPanel {
     public function SPanel( showing:Boolean, y_pos:Number ){
          super( showing, y_pos );
          trace( "SPanel" );
     override protected function init(event:Event):void {
          trace("SPanel.init: "+event.target);               //these two are different because I was
          trace("SPanel.init: "+event.currentTarget);        //wondering if event bubbling was the cause
          var horiz:HorizontalIcon = new HorizontalIcon();   //for dups. Doesn't seem to be.
          trace("adding");
          this.addChild(horiz);
All the other panels look just like SPanel. The only difference is they only have a single trace statement in init. I never see the trace statement from AccordianPanel.init as expected, but the trace statements from all the AccordianPanel subclasses show up twice.
Here's the trace output (with comments I've added):
Accordian
Accordian:init                          // this is where the loop in Accordian starts
SPanel
   [object SPanel]                      // these [objects] are the trace statements in the loop
SPanel.init: [object SPanel]
SPanel.init: [object SPanel]
horizontal                              // this is a trace statement from HorizontalIcon's constructor
adding
   [object CPanel]
CPanel.init
   [object DPanel]
DPanel.init
   [object BPanel]
BPanel.init
   [object CPanel]
CPanel.init
   [object EmPanel]
EmPanel.init
   [object EtPanel]
EtPanel.init
   [object PPanel]
PPanel.init
   [object TPanel]
TPanel.init                             // so far so good. This is what I would expect to see.
ShapePanel.init: [object ShapePanel]    // But wait there's more! What is up with all these?
ShapePanel.init: [object ShapePanel]    // The trace statements from the loop aren't here, so it's
horizontal                              // not the loop again.
adding
ColorPanel.init
DesignPanel.init
BronzePanel.init
CarvingPanel.init
EmblemPanel.init
EtchingPanel.init
PortraitPanel.init
TextPanel.init
As far as I can tell the code is correct. It doesn't seem to be running twice, but the event ADDED_TO_STAGE is firing twice. This is odd to me, but that may just because I'm new to AS3.0. Does it help explain why the HoriztonalIcon never appears on the stage?
kglad, I appreciate you taking the time to walk me through this.
-Sean

Similar Messages

  • Final stage of the installati​on bombs ... won't display the webpage with IE9

    Multiple retries for automatic, tried re-typing, won't display last setup dialogue either way.

    so return it for another one if its within the 14 day return policy.  If not, bring it in for repair.

  • Won't display main menu, even after holding on/off and home buttons simultaneously. Can't get beyond "connect to iTunes " which I can't do anyway.

    After several days of inactivity iPad won't display main screen. When I first turned in on, it asked for a four digit passcode. I never had a four digit passcode. After entering "incorrect" passcode, it told me I could try again in 60 minutes. That was day one. Since then, it displays "connect to iTunes" which I can't do. I've tried holding on/off and homebuttons simultaneously. "connect to iTunes" keeps coming up. I'm stuck on that commmand.

    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school enviroment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • My iPhone 5 won't display smart text options.

    My iPhone 5 won't display smart text. It did when I initially downloaded the new OS, now those options don't appear at all. Did I click something to make them disappear?
    I went into Settings to see if there was a component of it within Messages. I don't see anything.
    Thoughts please.....
    Thanks much
    Ginger

    Awwww......that's it....the dash! I tapped it. Tried to drag it up/down and it didn't move. Now I swiped and it's back!
    So I need to remember to drag up/down and now swipe.....
    Thanks much!
    Ginger

  • ITunes won't display current voice memos from my iPhone 4S. How can I tranfer this data without loosing it?, iTunes won't display current voice memos from my iPhone 4S. How can I tranfer this data without loosing it?

    Please help! My iTunes won't display my voice memos from iPhone 4S when trying to sync data. Files are to large for emailing. I want to back up the files on to my computer.

    JustinV72 wrote:
    How do I get the audiobook onto my iphone without erasing anything?
    You transfer the purchases to the computer you use to sync the iPhone.  You can use a thumb drive or an external HD, etc.  Read this: iTunes for Mac - How to copy purchases between computers:  http://support.apple.com/kb/HT1373

  • I updated to iOS 7 and now some of my apps won't display in landscape mode and they did before the update. Any ideas on how to fix it?

    I updated to iOS 7 and now some of my apps won't display in landscape mode and they did before the update. Any ideas on how to fix it?

    This could be from having restrictions enabled. Icons completely disappear when "restricted"

  • IMac 2.66 Radeon HD 2600 Pro: some Excel files won't display in ppt decks

    Running Leopard 10.5.8 and MS Office 2004
    Two iMac (8.1) 2.66 GHz with ATI Radeon HD 2600 Pro video won't display some Excel files in PowerPoint decks, but iMac 1.83 GHz Core Duo will display o.k. as will MacBook Pro, MacBook, etc. Installing a trial version of Office 2008, both iMac 2.66 GHz display the PowerPoint files o.k.
    I could downgrade the users to Intel iMac 1.83 GHz, or buy two copies of Office 2008 and support them, neither of which is a great solution.
    Looking for a simple fix or workaround on what seems to be a video card issue. Don't seem to see this problem or a fix on the ATI site. I've googled this but haven't run into a similar issue.

    Well, Office 2008 is only $110 USD at http://www.amazon.com/Microsoft-Office-2008-Home-Student/dp/B000X86ZAS/ref=sr11?ie=UTF8&s=software&qid=1251560959&sr=8-1
    That seems the least expensive solution to me.

  • ITunes won't play music and won't display some of my album art.

    iTunes won't play music and won't display some of my album art. I'll click play but the song wont play and some of my album art doesnt appear anymore. When I go on iTunes music store non of the pictures will appear it will just be black where a picture should be. What can i do to fix all of this?????

    I am having the exact same problem and have been trying to solve it for a couple of weeks. So far I havent found a soulution. But if you get one can you please let me know? Good Luck

  • Difficulty using a projector. I have a MBP 17" and am running 10.6.8. Often I need to make a Powerpoint or other presentation  at a client and I want to connect my computer to their projector. Either it won't display on the projector at all. HELP!

    Difficulty using a projector. I have a MBP 17" and am running 10.6.8. Often I need to make a Powerpoint or other presentation  at a client and I want to connect my computer to their projector. Either it won't display on the projector at all. Once it displayed but the presentation mode was on the big screen and the presentation I wanted to show was on my MBP screen. I have the adapter( white ones) to attached to the projector cables.  I am so frsutrated...it looks so silly not to have a computer work during a presentation..
    Another problem one the rare occasion that it shows on the screen is that the presentation does show just my desk top.  Any ideas?
    Thanks !

    You often have to turn off Mirroring to be able to set the second "screen"s resolution to something reasonable. When you do, the two screens become an "Exceeded Desktop" joined along one edge, and the Arrange pane in displays prefs can allow you to specify what edge. Initially, it will show a vacant extension of the built-in screen's desktop.
    The mouse moves freely across that shared edge, and can allow you to drag the presentation window across to the the projector screen and re-size it to fit.

  • Private Photos App - pictures not displaying This app was working fine, then suddenly it won`t display any of the photos.

    This app was working fine, then suddenly it won't display any of the photos. One day the photos were there, gone the next. It still shows how many photos are there but just shows a white screen. I can't export anything to the photo album. Adding photos to existing folders yields the same result, only white screen displayed. However, I can create new albums and add photos to those without issue. Does anybody know how to recover the "missing" photo"  I was going to try reinstalling the app but it's no longer available in the iTunes App Store. Thanks, Tracy

    1, you can't at the moment, though with iOS 5 in the Autumn, from http://www.apple.com/ios/ios5/features.html#photos :
    Even organize your photos in albums — right on your device
    2, by removing it from you synced from and re-syncing. Only photos taken with the iPad, copied to it via the camera connection kit, or saved from emails/websites etc can be deleted directly on the iPad (either via the trashcan icon in the top right corner if viewing the photo in full screen, or via the icon of the box with the arrow coming out of it in thumbnail view)
    3, the location of the photos that you synced to the iPad should be listed on the iPad's Photos tab when connected to your computer's iTunes.
    4, you can copy the photos from your iPad to your computer : http://support.apple.com/kb/HT4083 . You should also be able to delete them from the iPad as part of the transfer process to your computer, and it's then your choice whether to add them to your sync photo list so as to copy them back to the iPad. Copying them to your computer would allow you to organise them into folders and therefore be able to sync them back into separate albums.
    5, I don't use Dropbox either. There are some third-party browser apps in the iTunes App Store that allow you to download pages so that you can view them when offline e.g. Atomic Web (the whole page is saved within Atomic Web, it doesn't place a photo into the Photos app)
    6, deleting content should help. If you remove an app from your iPad then you also remove the content that it's got on the iPad - so if you then decide to reinstall it back onto the iPad then you will need to manually add back any content that you want in it. None of the Apple built-in apps (including Photos) can be removed from the iPad

  • Database field won't display

    I'm new to Crystal Reports in .NET but I do have my 1st report working except for one field that I'm trying to use in a sub report.  It's in my database fields just like the other field for the sub report.  I can see data for both fields in the Browse Data.  One field and it's heading display just fine but I can't see the other one anywhere.  The field heading that's created when I drag it into the Detail area won't display in the report either.  I've tried deleting the field and readding it but nothing helps.  As far as I know I've done nothing to suppress this field from printing.  I REALLY need to get this working.  Thanks for your help.

    Hello Paul,
    I recommend to post this query to the [.NET Development - Crystal Reports|SAP Crystal Reports, version for Visual Studio; forum.
    That forum is monitored by qualified technicians and you will get a faster response there.
    Also, all Crystal Reports .NET Development queries remain in one place and thus can
    be easily searched in one place.
    Thanks a lot,
    Falk

  • HP Photosmart Plus B210a all-in-one won't display any networks in the list.

    Hi, I recently purchased a HP Photosmart Plus all in one printer and I've been having trouble with it from day one.
    First off, it won't connect wirelessly.
    It won't display any networks in the list when searched for, it won't take my network details when I manually input them and it won't take any static IP address I've tried from other suggestions.
    Secondly, the print quality is very bad. Streaks and fading are occuring and after using up 70% of my ink trying to sort it out through troubleshooting it's still bad.
    It's extremely important for me to be able to have web access using the printer as all members of my household use it and it'll get fustrating having to car laptops and computers around to print.
    Can anybody help at all?

    Top line says "The wireless radio is not functioning. Contact HP support"
    I take this as a very bad sign and needs replacing?
    The tests I done produce streaks, fading and lines. I printed off two photos, one from a memory card and one from a scan. The memory card produced heavy blocked lines of color and the scan was just dull.
    I'm using a Wanadoo Wireless Livebox and Windows 7 64 Bit
    One other question... is this like a brilliant printer for photos mainly? I'm a Graphics design student and although my final prints are made from home I would like accurate and decent printouts for my portfolios. Should I keep this or go for another one with similar features and better print quality?

  • Over half my albums in iPhoto won't display the enlarged photo. How can I correct this?

    Over half my albums in iPhoto won't display the enlarged photo. How can I correct this?

    There are several possible causes for the Black Screen issue
    1. Permissions in the 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. Include the option to check and repair permissions.
    2. Minor Database corruption: 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.
    3. A Damaged Photo: Select one of the affected photos in the iPhoto Window and right click on it. From the resulting menu select 'Show File (or 'Show Original File' if that's available). (On iPhoto 11 this option is under the File -> Reveal in Finder.) Will the file open in Preview? If not then the file is damaged. Time to restore from your back up.
    4. A corrupted iPhoto Cache: Trash the com.apple.iPhoto folder from HD/Users/Your Name/ Library/ Caches...
    5. A corrupted preference file: Trash the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. (Remember you'll need to reset your User options afterwards. These include minor settings like the window colour and so on. Note: If you've moved your library you'll need to point iPhoto at it again.)
    If none of these help: As a Test:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Updated to iOS 7.1.1 newsfeed in Facebook won't display?

    Updated to iOS 7.1.1 this morning and the newsfeed in Facebook won't display, instead it's find a friend page! How do I fix this please?

    Contact your carrier

  • Layered text and graphic in Word won't display when converted to PDF

    I have several simple shapes with text layered in front in my Word document. After they are converted to PDF using Acrobat XI, only the shape will display. I can tell the text is still there, because I can use my cursor tool to select it, but it won't display visually. It looks like it isn't there but it really is. One bit of text is even an internal link, and the link still works but I can't see the text I'm clicking on.
    If anyone has any suggestions I'd appreciate it.
    Thank you,

    Hi Lori - this was perfect! It was an issue with the layers being misordered. I used the Edit Text & Images tool listed under Tools > Content Editing, found the layers, then by right-clicking I was able to bring the text to the front and it all looks great now.
    I would like to know why this happened, or if not why, how I could make sure it doesn't happen again. If there's a check box or other setting I could use to remove this problem that would be fantastic.
    Thank you so much for pointing me in the right direction!
    -Scott

Maybe you are looking for

  • My iPad wont let me connect you my iTunes account or do the new upgrade, Help!

    I need help please. My iPad wont let me do any apple updates for apps etc. I can't download music etc. used to be able to but doesn't seem to connect to I tunes. Everything else works

  • Creative Cloud app has nothing in it.

    This is a 2 part issue. The first is when I attempt to open the Creative Cloud App there is noting inside, no tabs, nothing. I want to know how to re-install. When ever I open Photoshop CC 2014 after I sign in I get a popup asking if I want to try Ph

  • ITunes stops working when accessing iTunes store

    The latest tunes 11.1, when you access the iTunes Store, iTunes stops working and wants to shut down.

  • ADF problem when use tomahwak's dataScroller

    Hi, I has tried to use ADF in apache's MyFaces. when I use tomahwak's dataScroller get from MyFaces's sample code <h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" > <t:dataScroller id="scroll_1" for="d

  • Can't Select Graphical Borders

    Hi All Am playing with my Website and updating it after re-installing OS, since one of my hard drives failed some time ago, so bang went my OS. My iWeb was all backed up on my .Mac, but since i've restored it, it can't seem to apply the "stroke - gra