ActionScript error on the menu bar click event after migrating to Flex 4.5.1

Now that I have converted my app for Flex 4.5.1 one click event of MenuBar throws the following error:

TypeError: Error #2007: child parameter must be non-null.

at flash.display::DisplayObjectContainer/getChildIndex()

at mx.core::Container/getChildIndex() [E:\dev\4.5.1\frameworks\projects\mx\src\mx\core\Contai ner.as:2839]

to mx.containers::ViewStack / set selectedChild() [E:\dev\4.5.1\frameworks\projects\mx\src\mx\containers\ViewStack.as:639]

at com.views::publicCanvas/mouseClick() [C:\ColdFusion9\wwwroot\ifq2\src\com\views\publicCanv as.mxml:54]

at com.views::publicCanvas/__menuBar_click() [C:\ColdFusion9\wwwroot\ifq2\src\com\views\publi cCanvas.mxml:86]

The throwing function the error is:

private void mouseClick(event:MouseEvent):void

{

var tempMenu:MenuBarItem = MenuBarItem (event.target)

If (XMLList (tempMenu.data). * () .length == 0)

{

publicViewStack.selectedChild = this [(MenuBarItem (event.target).data.@view)];

}

}

The ViewStack is defined as:

< mx:ViewStack id = "publicViewStack".

x = '0 '.

y = "22".

Width = '100% '.

height = "564".

selectedIndex = "0" >

<! - selectedIndex = 0 - >

< s:NavigatorContent >

< views: publicHomeCanvas id = "publicHomeCanvas" / >

< / s:NavigatorContent >

<! - selectedIndex = 1 - >

< s:NavigatorContent >

< views: viewDealers id = "viewDealers" / >

< / s:NavigatorContent >

< / mx:ViewStack >

Menu data are defined in the file menuDataPublic.as as:

<? XML version = "1.0" encoding = "UTF-8"? >

elements <>

< point position = 'top' label = 'Home' view = "publicHomeCanvas" menuindex = "0" / >

< point position = 'top' label = "View Dealers" view = "viewDealers" menuindex = "1" / >

< / object >

In point 3.6, it worked perfectly.  Under the 4.5.1 it fails as indicated.  Has anyone encountered a similar problem?

Thanks again!

Lee

Well, you made your point of view as children of a NavigatorContent and then try to make the child the selectedChild, not its NavigatorContent container.

Tags: Flex

Similar Questions

  • How to create the scroll to the menu icon click event bar

    How to create the scroll to the menu icon click event bar

    (as the "field of scrolling image")

    In my opinion, it is better for you to try something to help implementation of your solution to ask for the code.

    For example, create a few BitmapFields with icons that act as buttons.  There is source for this sort of thing on the forum if you look at, I think, looking FRO Image button, icon or Bitmap button.

    Once you have these buttons work, add these in a HorizontalFieldManager.

    Good luck.

  • The menu bar clock freezes after recovery from sleep mode

    After the upgrade to Sierra, I noticed that the clock in the menu bar (top right) show wrong time.  This occurs when the iMac comes out of his SLEEP.  When I hoover the pointer of the mouse on the clock, it would turn into a spinning ball (i.e. no response).  I have to disconnect and reconnect so that the clock in the menu bar to indicate the correct time.  She would continue to work until the next time that the iMac comes out of SLEEP.

    Anyone facing this problem?

    Have you tried booting in safe mode (hold down the SHIFT key at startup)? The problem persists?

    If you create a new user account, does?

  • Questions from the menu bar

    Recently, I opened Firefox and everything is messed up. All my settings were gone. I managed to change some settings back, but now the menu bar does not respond, it's just all in gray. The back button is the same way. The address bar does not even address, or if this is the case, it's a different tab. And all my changes to my settings disappear after I close the program. What exactly happened here?

    1. In the menu bar, click on the help menu, and then select restart with modules disabled... Firefox starts with the Firefox Safe Mode dialog box.
    2. Put a checkbox reset bars of tools and controls and to reset all preferences default Firefox user.
    3. Click make changes and restart

    For more information, you can try to look at the changes to the toolbars and window sizes are not saved , and the Preferences of Firefox reset to troubleshoot and resolve problems.

  • How to display the MENU bar. Aide said "right-click on a blank section of the band to tabs. What is a tab strip?

    My friend just bought a laptop Windows 8 so I told her to download the latest version of FireFox. Unfortunately, a fool has removed the menu bar, which most people like. You can see all of your options in plain language. In any case, I aimed to help and can't believe it's so hard to get a simple answer to this question. Why FireFox makes it so difficult to get a menu shaped bar old?

    Aide said: "right click on a blank section of the band tabs and check the menu bar". OK, what is a "BAND as TABS" and where she finds it? Who writes these tips help stupid and useless?

    Yo, man! Chill out!

    In order to display the menu bar, press Alt. Once this is done, you have temporarily. Now, all you have to do is go to view > toolbars and check menu bar.

    And the band to tabs is as follows:

    https://support.Mozilla.org/en-us/gallery/image/9469 (one below the address bar)

  • How can I add the "open a new tab" button back to tabs &amp; bookmarks to the menu bar? I was able to click and drag the bookmarks there and the tab button has always been thr

    How can I add the "open a new tab" plus button back to tabs & bookmarks to the menu bar? I was able to click on and drag the bookmarks and folders containing the bookmarks in the menu bookmark to a bar of tools and click the tab + button was always on the right side of a tab before seeing ff 13.0.1 on windows 7.

    I need back, areas have red around em

    http://i48.Tinypic.com/25gue0x.jpg

    Draggin ' bookmarks toolbar items, it's done. Thank you for the mind can.

  • How do I reopen it the status bar and the menu bar, I accidentally turned off one of them and now they are not accessible by right-clicking anywhere on the browser

    If you right click on the bar at the top of the page in the browser, you can check and uncheck what bars appear. I accidentally disabled something there and now when I click I can't get any menu to double-check my menu on the right, State bars so that they are visible. Currently they are not visible, I have no way to move or change settings.

    OK, got it fixed, I kept fishing around this site and found an answer. Press the Alt key and the menu bar appear temporarily, long enough to restore the bar to be visible.

  • continue to get coupons for popup - says that it can be removed by clicking the coupon on the menu bar, but I don't see a

    Recently started having a lot of popup coupons - on the coupon it says you can stop it by clicking on the coupon on the menu bar button, but I don't see a button for coupon on any of the menu bars. How can I remove this problem?
    Thank you

    That's good news. You're still using Windows XP?

  • My XI Acrobat Standard 11.0.09 lost menu bar (F9) and crazy jumps full screen, losing windows buttons high bar, passing just above the menu bar with the mouse cursor, without clicking.

    My XI Acrobat Standard 11.0.09 lost menu bar (F9) and crazy jumps full screen, losing windows buttons high bar, passing just above the menu bar with the mouse cursor, without clicking.

    Yes, it's important somehow. Kapersky broke it somehow and fixed. http://Forum.Kaspersky.com/index.php?showtopic=307391&HL=Adobe

  • Creative cloud does not load. I can see the icon in the menu bar, but when I click on it I only see the loading wheel. No applications will appear.

    Creative cloud does not load. I can see the icon in the menu bar, but when I click on it I only see the loading wheel. No applications will appear. My MAc system is a fresh update 10.9.3

    Divaviva please try the solution 2 in desktop applications lists CC as "up to date" when the no facility not - http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html.

  • HOWTO enable disable items of the menu bar in actionscript

    Hello
    My problem is I want to toggle buttons in a menu bar according to the loaded page.
    So what I did when the user clicks on the menu bar, it triggers a function. Inside that function it will become a check on what page is at the front. According to this page I put on and outside menuitems.
    It's the idea that I had, so now my problem.
    First of all, I try to create a simple solution as my code under.
    ----------------------------------------------------------------------------------------- ------------

    I suggest you to change things around. See if the following works for you. The clickHandler() method has the syntax you're looking for.

    TS

  • Access the menu bar drop down everything by changing the menu items

    Hello

    I use a design of producer/consumer.  In the producer, I have a structure of the event which generates messages for the consumer based on the event.  One of the events in the event structure is placed to get the menu selection.  In the loop of consumption, some States modify the menu bar items.  For example, if the program mode from automatic to manual, the items of the menu bar change accordingly.

    The problem I have is if the mode is changed to auto, for example, and then a menu bar dropdown can be reached quickly afterwards (sometimes happens accidentally even), before the menubar item change happens, there is a mistake and labview crashes.  I guess the problem is that the menu bar is connected the user while he tries to be changed. ?? Disable the menu followed until the elements are correctly changed does not help, because it does not prevent you from pulling a menu down, only to make a selection.

    Any advice?  This is the problem because it seems to me, in any case.

    Thanks as always!

    Greg

    You can set the cursor "Occupied" until such time that your Menu is updated.

    So user will not be able to click on the Menu.

  • I have a grey spinning wheel in the menu bar...

    I have a wheel that turns in the menu bar. I can't delete it, and if I click it, the words "close - close subfolders ' seems... what? What should I do to remove it?

    The following thread might solve your problem.

    Clock bar menus and spinning wheel

  • Icon not appearing SIRI is not in the menu bar

    Just installed Sierra - Siri icon appears in the dock but no menu bar. How do I configure that?

    Go to the system preferences window click the siri, then in the window to disable the Siri display in the menu bar and then on again.

  • "Terrible blue ' seeps into the menu bar

    in 2014, I asked this question:

         Several new Firefox Support questions relate to the new "awful blue" in the menu bar in 29.0.1. But that "awful blue" was ALWAYS there as the Windows windowframe color (in Windows XP, SP 3). The real problem is that the windowframe has now "leaked" or "fused" its way into the Firefox menu bar. The two should be separate. Please separate them again, so that Windows controls the windowframe only, while Firefox controls the menu bar only. 
    

    It is visually important when there are several tabs as a single tab is visible. The other tabs have nothing left but their legends. See photo.

    At the time where I got this reply and found it useful.

         In the customize settings you can add the title bar to separate the two. I hope this helps. I will lock this thread unless you need further support, please feel free to post another question.
    

    But now (v41.0.2) it doesn't seem to be a title bar, and I can't make this thing work.

    Please allow the color of the Firefox menu bar was separated from the windowframe Windows color, whereas Windows controls the windowframe only, while Firefox controls the menu bar alone.

    Try setting browser.tabs.drawInTitlebar to false on the topic: config page to disable the display of the tabs in the title bar.

    You can open the topic: config page via the address bar.
    You can accept the warning and click on "I'll be careful" to continue.

Maybe you are looking for