Skip to main content
Inspiring
December 3, 2016
Answered

ComboBox Used to Change Frames

  • December 3, 2016
  • 4 replies
  • 545 views

I have a couple of programs where a ComboBox is used to change frames.  Mostly it works okay but if the ComboBox is held open and the mouse pointer is moved back and forwards repeatedly over the options (sort of thing you do when Debugging) I get the error:

ypeError: Error #1009: Cannot access a property or method of a null object reference.

  at fl.controls::ComboBox/close()

  at fl.controls::ComboBox/onListItemUp()

This only happens on ComboBoxes where the options are used to change frames.  An example of the code i use is below

CalcCombo.addEventListener(Event.CHANGE, CalcSelectPage);

function CalcSelectPage (event:Event):void

{

  if (CalcCombo.selectedItem.label == "FLOW") {

  gotoAndStop(3);

  }

  else if (CalcCombo.selectedItem.label == "EFFICIENCY") {

  gotoAndStop(4);

  }

  else if (CalcCombo.selectedItem.label == "POWER") {

  gotoAndStop(2);

  }

}

Does anybody know whats going on?

This topic has been closed for replies.
Correct answer Stivushka

I had a "Eureka" moment and fixed it. 

I needed one ComboBox spanning two frames instead of two ComboBoxes now in each frame. 

Easy when you know how!

4 replies

StivushkaAuthorCorrect answer
Inspiring
December 9, 2016

I had a "Eureka" moment and fixed it. 

I needed one ComboBox spanning two frames instead of two ComboBoxes now in each frame. 

Easy when you know how!

StivushkaAuthor
Inspiring
December 8, 2016

Yeah just tried it same results.  I will redesign to avoid using ComboBoxes to switch frames.

StivushkaAuthor
Inspiring
December 5, 2016

I tried running it in 2015 R2.  Same issue I don't think this is related to a bug with the ComboBox

I think it has something to do with changing frames and then having a ComboBox in the same position in the next frame.

kglad
Community Expert
Community Expert
December 5, 2016

create a new fla with your 2015 version and add a combobox and add one or more items to the dataprovider.

test.

any problem?

kglad
Community Expert
Community Expert
December 3, 2016

there's a bug in animate cc 2017.  i think you'll need to create your own combobox or use an earlier version of animate.