Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5978519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:31:39+00:00 2026-05-22T21:31:39+00:00

Below is my code, and the question is explained after it. <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml xmlns:cal=cal.*

  • 0

Below is my code, and the question is explained after it.

 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    xmlns:cal="cal.*"
                    layout="absolute"
                    applicationComplete="init()"    


                xmlns:geometry="com.degrafa.geometry.*"
                xmlns:degrafa="com.degrafa.*"
                xmlns:paint="com.degrafa.paint.*"
                xmlns:containers="flexlib.containers.*"
                xmlns:flexlib_controls="flexlib.controls.*"
                xmlns:mdi_containers="flexlib.mdi.containers.*"
                xmlns:auto="com.hillelcoren.components.*" 
                xmlns:local="*"
                xmlns:components="CollapsibleAccordion.*"
                modalTransparency="0.8"
                modalTransparencyColor="0x000000"
                backgroundSize="100%">
<mx:Script>
        <![CDATA[
import c7.views.components.PhotoViewer.PhotoViewer;
            import c7.config.ServerConfig;
            import mx.core.Application;
            import mx.containers.*;

            import c7.models.GlobalModel;
private var pv_slideshow:PhotoViewer = null;   



    private function toggleFullScreen():void
                {
                    if(stage.displayState == StageDisplayState.NORMAL)
                    {                                                   
                        this.pv_slideshow = new PhotoViewer;
                        Application.application.addChild(this.pv_slideshow); //added as top-most component to application itself                    
                        //set new sizes & go full-screen
                        this.pv_slideshow.x = 0;
                        this.pv_slideshow.y = 0;          
                        this.pv_slideshow.width = stage.fullScreenWidth;
                        this.pv_slideshow.height = stage.fullScreenHeight;
                        try
                        {
                         stage.displayState = StageDisplayState.FULL_SCREEN;
                        }
                        catch(err:Error) 
                        {                    
                     Alert.show(err.toString());
                    }
                    stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenEventHandler, false, 0, true);    //intentionally weak referenced           
                    //refresh the display sizes & display list
                    invalidateSize();
                    invalidateDisplayList();                                                            
                }               
                /*else
                    stage.displayState = StageDisplayState.NORMAL;*/
            }

            private function fullScreenEventHandler(event:FullScreenEvent):void
            {
                if (event.fullScreen) //nothing to do in case when switching to full-screen
                    return;       
                //Alert.show(pv_slideshow.width.toString());
                //application.removeChild(this.pv_slideshow);      
                Application.application.removeChild(pv_slideshow);      //remove the full-screen container
                this.pv_slideshow = null;   //reset             
                //refresh the display sizes & display list
                invalidateSize();
                invalidateDisplayList();                
            }

The toggleFullScreen is fired on the click of a button… and it working absolutely fine. But the issue is in “exit” . When I click escape key fullScreenEventHandler is fired and it should remove the pv_slideshow.

This is where I get a null object reference error on the line:

Application.application.removeChild(pv_slideshow);      //remove the full-screen container

I have tried using this.pv_slideshow and other such things.

Plz help me figure it out. what am i doing wrong and how should I make it work.

This is exact error message I get:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::removingChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3315]
    at mx.core::Container/removeChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2263]
    at index_cloud/fullScreenEventHandler()[C:\development\flex_src\index_cloud.mxml:1661]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:31:39+00:00Added an answer on May 22, 2026 at 9:31 pm

    I wouldn’t use Application.application either.

    Please check first pv_slideshow really exists, you can get it’s parent ( if has one ) and remove it later.

    get the parent

    pv_slideshow.parent
    

    remove it from the parent_item

    parent_item.removeChild( pv_slideshow )
    

    Make sure also the version of Flex you are using, you may need to remove it with removeElement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See also: Similar question The code below is obviously dangerous. The question is: how
Don't let below code scare you away . The question is really simple, only
I am using Polymorphic Models . Simple Question: My code below works without using
I have a basic PHP question, take the code below for example, let's say
I've got a simple question but it has got me confounded. The code below
Note The question below was asked in 2008 about some code from 2003. As
In another question on SO I answered with code like the one below and
I have the following question regarding the code below: public class GenericBridgeMethods <T> {
My question can better be explained via example code. I am using POCO with
Below code saying error incorreect syntax near Main INSERT INTO tbl ( 'Week', Main,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.