Patrick Jean schrieb:
[..]
So in my 2nd Class , I put :
-------------------------------------
import SequencerOBJ;
class ComOBJ extends LoadVars {
private var myTest:SequencerOBJ=new SequencerOBJ("It works");
public function ComOBJ() {
}
}
-------------------------------------
Finally, in my FLA , I have :
import ComOBJ;
_global.myComOBJ = new ComOBJ();
And when I compile I get an error saying :
**Error** C:\!PROJECTS\Resweb\ComOBJ.as:
Line 6: A class's instance variables may only be initialized to compile-time
constant expressions.
private var myTest:SequencerOBJ=new SequencerOBJ("It works");
-------------------------------------
Did I screw up on the syntax or something ?
Yeah, you should - besides your issue - NEVER rely on values passed
during variable declaration! These values sometimes are not stored
inside the variables...
To make your code work (I hope) you'd better write your class as follows:
-------------------------------------
import SequencerOBJ;
class ComOBJ extends LoadVars {
private var myTest:SequencerOBJ=null;
public function ComOBJ() {
myTest = new SequencerOBJ("It works");
}
}
-------------------------------------
This should do the job.
Best regards,
Roman.
--
-------------------------------------------------------------------
gosub communications gmbh | fredersdorfer str. 10 | 10243 berlin
t [030] 29 36 39 1 - 43 | f [030] 29 66 88 84 | http://www.gosub.de
-------------------------------------------------------------------
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com