This content has been marked as final. Show 9 replies
Can we see the AS Class please? Are you sure you are extending and importing the correct/needed classes?
there we go:
Are you importing the custom class in the main app or component where you intend to use it?
the same class works, when added to the preloader property of Application - but that is not what i want:
No, no, my question was if you are importing the Class where you are using it. :)
private function init() : void
var p : AppPreloader = new AppPreloader();
There is no import here. That's why I'm asking.
"marcink" <email@example.com> wrote in message
> in a flex application i have this code:
> private function init() : void
> var p : AppPreloader = new AppPreloader();
> AppPreloader is a custom as class that extends DownloadProgressBar.
> but when i execute the code, i get an error saying the type can not be
> form AppPreloader to IUIComponent...
> anyone has a idea why i can not add AppPreloader to the displaylist?
Wrong question. The right question is "Why can't I add AppPreloader to the
DisplayList to a _container_ class?" The answer is in the error message.
Solution...either implement IUIComponent on your class, or wrap your
component in something that is not a container but that implements
IUIComponent like, for example, UIComponent.
got it. :) but i posted the code for the application as well... just previous to your post...
ok solved this.
it was my mistake... here what adobe writes:
While the child argument to the method is specified as of type DisplayObject, the argument must implement the IUIComponent interface to be added as a child of a container
DownloadProgressBar extends in fact DisplayObject, but doesn't implement IUIComponent...