I'm creating the instance in the timeline of the .fla, with this line:
var c:SomeClass = new SomeClass();
Have you tried that? Just to see if it works from the timeline and check if
you can compile and run the code without errors... (
As I said, the code I pasted compiles fine and it traces the right value
creating the instance in the timeline... (should work if done in a class
too, but just to check)
2008/2/1, Robin Burrer <[EMAIL PROTECTED]>:
>
> >> Works fine for me... How are you creating SomeClass instance?
>
> like this - it's all really basic ....
>
> package
> {
> import flash.display.MovieClip;
> import de.formDivision.fdCD.view.slidePlayer.SectionButton;
>
> public class Test extends MovieClip
> {
> public function Test()
> {
>
>
>
> var mySectionButton:SectionButton = new
> SectionButton();
> this.addChild(mySectionButton);
>
> // here I get the compiler error
> trace (SectionButton.ON_PRESS);
>
>
> // The foo class does not extend the Movie Clip
> class - no coplier
> errors here...
> var myFoo:Foo = new Foo();
> trace (Foo.VALUE);
>
> }
>
>
>
> }
>
>
>
> }
>
> ///////////////// and here is the SectionButton Class - I deleted
> everything but the static variable declaration
> package de.formDivision.fdCD.view.slidePlayer
> {
> import flash.display.MovieClip;
> import de.formDivision.fdCD.vo.SectionVO;
> import flash.events.MouseEvent;
> import flash.events.Event;
>
> public class SectionButton extends MovieClip
> {
> // events
>
> public static const ON_PRESS:String = "onPress";
>
> }
>
> }
>
>
>
> On 01/02/2008, at 3:47 PM, Kenneth Kawamoto wrote:
>
> > Works fine for me... How are you creating SomeClass instance?
> >
> > Kenneth Kawamoto
> > http://www.materiaprima.co.uk/
> >
> > Robin Burrer wrote:
> >> Hi All,
> >>
> >> I want do declare a constant in a class that extends the Movieclip
> >> class.
> >> That all works fine in Flexbuilder:
> >>
> >>
> >> public class SectionButton extends MovieClip
> >> {
> >> // events public static const ON_PRESS:String
> >> = "onPress";
> >> }
> >>
> >>
> >> Referring to this constant from another class seems o be fine as
> >> well (Felxbuilder does not give me a syntax error.):
> >>
> >> import SectionButton;
> >>
> >> public class SomeClass
> >> {
> >>
> >> public function SomeClass()
> >> {
> >> trace (SectionButton.ON_PRESS)
> >> }
> >>
> >>
> >> }
> >>
> >>
> >> But if I try to compile my fla file in Flash CS 3 I get the
> >> following error Message:
> >>
> >> 1119: Access of possibly undefined property ON_PRESS through a
> >> reference with static type Class.
> >>
> >> Any Ideas?
> >>
> >>
> >> Robin
> >
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders