• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Flash sdk 3.5 give me a null object reference error.

New Here ,
Jun 23, 2010 Jun 23, 2010

Copy link to clipboard

Copied

I have a componet popuo window buiilt and it has few text and labe and also a combo box. I use popupmanager to load the window first and then give text and combox definitions.  It works fine with Flex SDK 3.2 until I  migrate to SDK 3,5 using FLASH BUILDER 4.0. The window is built with canvas. Here is the code

1 var pInfo:ParcelInfor=new ParcelInfor();

2 PopUpManager.addPopUp(pInfo,map,false);

3 PopUpManager.centerPopUp(pInfo);

4 pInfo.txtPin.text= "PIN: "+"056197374";

5 pInfo.multiSel.visible=false;

It gave me an error on line 4 or line 5. Saying null object of txtPin and null object of multiSel. I know these two component are there in the canvas window. For some reason it looks like these component not fully loaded. It works with SDK 3.2 but not SDK 3.5. Anyone could help will be greatly appreciated? T

Views

362

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 23, 2010 Jun 23, 2010

Copy link to clipboard

Copied

LATEST

Yes I would have to agree, it looks like the components are not finished initializing before you try to use them.

One workaround would be to create 2 public variables for the popup, and set those instead, as they should be immediately available. Then have an onCreationComplete function that set's the component attributes to what the vars are.

Hope that helps.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines