This content has been marked as final. Show 5 replies
You don't need the first script tag, the reference to the class file will be worked out from the names. I think when you import the script you are already in a default package, so when it sees the package declaration in the source file it throws the nesting error.
I think you also need to import multiupload.*; as you need to import the actual classes not the package itself (similar to Java). Alternatively you could replace * with the specific class name (e.g. "import multiupload.MultiUpload;").
Thanks for your answer.
I have just few questions about this.
var test:multiupload = new multiupload();
Why is multiupload not MultiUpload on line 2? Since the class name start with uppercase letter?
and why cannot I see the functions in the dropdown list when I type
and thanks again for your help :)
It should be the same case as the class name. I think you should get a compiler error when you build that code.
The easiest way to import and use classes is using autocomplete. I'd scrap the import and the var declaration, then just type "var test:" and when you press colon you should see all the available classes in the project, then if you select your class from this list and press Enter the import statement will be added for you automatically, and var type will be declared in the correct case.
As for using autocomplete to find methods and vars, you must be inside a function body, as it would be illegal to call any methods otherwise. If you to run some code at start up, you need to place it in the creationComplete of the Application.
I'm still new to Flex, so I don't know how to do the auto complete thing you are talking about.
I'm still facing the problem which is using the class with my application?
I cannot access any functions from my class?
Is there any tutorial you can point me :)?
Well, suddenly everything is working :D
I hate when this happen hehe