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 7657835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:06:51+00:00 2026-05-31T13:06:51+00:00

In my Flex 4.6 web application I use mainly spark components, but there is

  • 0

In my Flex 4.6 web application I use mainly spark components, but there is also an mx-component – a PopUpButton extended by me (the source code is below).

Users report problems with that button, but I can’t reproduce any – since weeks.

I’ve tried replacing mx:Menu attached to it by a s:List but it hasn’t changed anything. I suspect there is a “null pointer exception” or some other failure, that I don’t hit when testing myself…

My question is: why does Flash Builder reports warning about my custom button as if its methods would be private or not present?

enter image description here

Can anybody please spot the reason?

My main App.mxml:

<?xml version="1.0" encoding="utf-8"?>
<s:Application  
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:comps="*">

    <fx:Script>
        <![CDATA[
                   _auxBtn.update(obj.aux);
                    ......
                   _auxBtn.disable();
        ]]>
    </fx:Script>

    <comps:AuxButton id="_auxBtn" enabled.normal="false" enabled.ingame="false" aux="handleAux(event)" />

My custom button AuxButton.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:PopUpButton
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:mx="library://ns.adobe.com/flex/mx"
    popUp="{_list}"
    initialize="init(event)">

    <fx:Metadata> 
        [Event(name="aux", type="PrefEvent")] 
    </fx:Metadata>

    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.events.FlexEvent;
            import mx.utils.ObjectUtil;
            import spark.components.List;

            private const EXACT:String = 'Своя игра';
            private const REVEAL:String = 'Показать';

            private var _str:String;

            [Bindable]
            private var _data:ArrayCollection = new ArrayCollection();

            [Bindable]
            private var _list:List = new List();

            private function init(event:FlexEvent):void {
                _list.dataProvider = _data;
                _list.addEventListener('click', handleList);
                addEventListener('click', handleClick);
            }

            public function update(aux:Array):void {
                var found:Boolean;

                // nothing has changed
                if (ObjectUtil.compare(_data.source, aux, 0) == 0)
                    return;

                if (aux == null || aux.length == 0) {
                    disable();
                    return;
                }

                _data.removeAll();
                for each (var obj:Object in aux) {
                    _data.addItem(obj);

                    if (!_str) {
                        if (EXACT == obj['label']) {
                            _str  = obj['event'];
                            label = obj['label'];
                            found = true;
                        } else if (REVEAL == obj['label']) {
                            _str  = obj['event'];
                            label = obj['label'];
                            found = true;
                        }
                    } else if (_str == obj['event']) {
                            found = true;
                    }
                }

                if (!found) {
                    _str  = _data[0].event;
                    label = _data[0].label;
                }

                enabled = true;
            }

            private function handleList(event:MouseEvent):void {
                var index:int = _list.selectedIndex;
                if (index >= 0 && index < _data.length) {
                    _str  = _data[index].event;
                    label = _data[index].label;
                }
                close();
            }           

            private function handleClick(event:MouseEvent):void {
                dispatchEvent(new PrefEvent(PrefEvent.AUX, _str));
                disable();
            }

            public function disable():void {
                _data.removeAll();
                enabled = false;
                _str    = null;
                label   = '';
            }
        ]]>
    </fx:Script>
</mx:PopUpButton>
  • 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-31T13:06:52+00:00Added an answer on May 31, 2026 at 1:06 pm

    Don’t worry about Flash Builder warnings, sometimes it has difficulties analyzing custom mx extended code (even spark sometimes!).
    If it runs it’s okay, warnings will eventually go away after a clean or a FB restart.

    You can also try to reproduce same feature using a mix of spark component, depending on a feature, it is maybe the best thing to do.

    Stay assured, I pasted your code in my Flash Builder (and removed the PrefEvent), there are no warnings at all on my computer 🙂

    For the error you users are reporting, you should give us more detail so we can try to help.

    Cheers

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

Sidebar

Related Questions

Is there a way to connect my flex web application to Active Directory, and
I want to use Twitter OAuth in my flex 4 web application and post
I'm building a Flex web application where there is an option to export data
I'm trying to get a loader working in a flex web application, but it
I have created a flex web application with php server side support. There is
Newbie question. I'm developing a web application (I'm using Flex/AS3, but for the purposes
I have a flash (flex) web application and when it first loads the cursos
I am starting a web application project that will have an Adobe Flex front-end
I'm working on a Java web application (Adobe Flex front-end, JPA/Hibernate/BlazeDS/Spring MVC backend) and
I am trying to secure my Flex application within my Java web application. Currently

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.