Skip to main content
Known Participant
June 1, 2011
Answered

Flash CS4: Can't find it's built in classes!

  • June 1, 2011
  • 2 replies
  • 1404 views

I am using CS4. I am finding that I can't import any built in classes other than
those in the Flash package (e.g. MovieClip, TextField). I can not import, for
example, fl.controls.Button. When I write that statement in a script I get an
error:

import fl.controls.Button;

"1172: Definition fl.controls:Button could not be found."


I have found the location of the class paths folders (C:\Documents and
Settings\user\Local Settings\Application Data\Adobe\Flash
CS4\en\Configuration\Classes\) but adding these paths in the AS3 prefs doesn't help, because I
then get a new error related to the Object.as class file within the FP8 folder in that folder:

"5007: An ActionScript file must have at least one externally visible
definition.
"

This is a recent problem. I would like to reset the program to whatever it was
when it was installed, since it behaved normally when I first installed it.
Otherwise, the program is essentially unusable for doing almost anything with action script

Any help would be greatly appreciated.

Chick


This topic has been closed for replies.
Correct answer Ned Murphy

You will get that error if you do not have a Button component in your library.

2 replies

relaxatraja
Inspiring
June 2, 2011

The button component should export itself to do a actionscript from the library. Press Ctrl+F7 to get the component panel and drag a button on the stage and delete it, then you will get the list of items in the library and check for the properties of the button how they exported it for action script. The below screenshot will help you.

Ned Murphy
Ned MurphyCorrect answer
Legend
June 1, 2011

You will get that error if you do not have a Button component in your library.

Known Participant
June 1, 2011

I am creating a button component strictly via script. After importing the

Ned Murphy
Legend
June 1, 2011

You still need to have a Button component in the library.  If components were strictly made from code you could probably do that, but they rely on assets that are built into them, such as graphics and the like.  These need to be available via the library like anything else that is not strictly code-based.

Just drag one out onto the stage so that it's in your library then delete it from the stage.  You'll be good to go.