Stage is Null Object in Fullscreen?

Hi,

Ive got an application working that displays pictures from an XML that updates every 10 seconds or so - well, works fine in a browser, but it breaks when going fullscreen mode. The application is meant to be run in full screen mode, but this prevents it from being done so.

I use MovieClips as my containers for these pictures as I animate them in and out, and added them to the display using “stage.addChild(mcName)”. However, with MovieClips using the timeline, I tried just “addChild(mcName)” for the movie clips. That didn’t work either.

I have tried using Senocular’s TopLevel actionscript to help with this, as well as his Tip of the Day, but I couldn’t get it to work, although that sounded like the ideal solution?

The bit of code that seems to break when going fullscreen is when it first access the stages properties through a custom function to check for a child of a particular name:


function childSearch(childName:String):Boolean {
            var counter:Number=0;
            for (var i:int = 0; i < stage.numChildren; i++) {
                if (stage.getChildAt(i).name==childName) {
                    counter++;
                }
            }
            if (counter==1) {
                return true;
            }
            else {
                return false;
            }
        }

There is probably a much neater/efficient way to write it, but I’m still new to programming in general…

It will break at “stage.getChildAt(i)…” saying “TypeError: Error #1009: Cannot access a property or method of a null object reference.”

I had another function which involved another “stage.getChildAt(…” statement, which I removed, and the next error I got was the same thing, so it’s got something to do with this (I can’t seem to get trace’s out of a flash debugger in a web browser). I do need this code because I depend on the names/index numbers of stage.children to remove them and appropriate other children.

I’m racking my head over this, I’ve read numerous other people having similar problems (albeit different applications?), and I’ve tried other things from this forum including:


If it works in non-fullscreen mode, and that the stage returns a list of display objects when traced non-fullscreen mode, how can everything be nulled when it goes to fullscreen? I think I’m at the end of my tether … and running out of clever things to google!