Skip to main content
Participating Frequently
October 8, 2013
Answered

ActionScript 3 Error: 1046: Type was not found or....

  • October 8, 2013
  • 1 reply
  • 6796 views

Hi,

I am completely new to Flas and AS3. I am trying to create an opacity slider using the slider component. I foudn a similar tutorial and tried to alter it to fit my opacity needs. In line 8 (function opacityChange (event:SliderEvent):void{) I get the error message 1046. When I test it in Flash the slider flickers on and off very rapidly too. Though I have searched, I am clueless as to what the problem is.

Any help will be appreciated.

Thanks!!

importfl.events.SliderEvent;

percent_txt.text = "Opacity %:0";

slider.value = 0;

slider.addEventListener(SliderEvent.CHANGE,opacityChange);

function opacityChange (event:SliderEvent):void{

          percent_txt.text = "Opacity %: " + event.target.value;

          logo.alpha = event.target.value;

}

This topic has been closed for replies.
Correct answer kglad

that should be:

import fl.events.SliderEvent

(and you need a slider component in your library or you'll trigger and 1172 error:

1172: Definition fl.events:SliderEvent could not be found.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 8, 2013

that should be:

import fl.events.SliderEvent

(and you need a slider component in your library or you'll trigger and 1172 error:

1172: Definition fl.events:SliderEvent could not be found.
Participating Frequently
October 8, 2013

Awesome. That was it. All the difference a space makes. Really appreciate your help!

Amy Blankenship
Legend
October 8, 2013

Note that if you start typing SliderE... where you are using SliderEvent and press Ctrl-Space, Flash or Flash Builder (whichever you are using) will automatically add the import statement where it's needed, using correct syntax.