A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: [RESOLVED] Can't invoke a class method unless it's a movieclip?

  1. #1
    Senior Member
    Join Date
    Jul 2008
    Posts
    391

    resolved [RESOLVED] Can't invoke a class method unless it's a movieclip?

    This is what I have
    Main
    PHP Code:
    package {
    ...............
        var 
    test:Sprite = new Test ();
        
    test.Hello ();

    Test
    PHP Code:
    package {
    .................
        public class 
    Test extends Sprite {
            public function 
    Hello () {
                
    trace ("A");
            }
        }

    Ignore the horrible syntax but I get a undefined property error. It only works if I switch Test to extend movieclip instead of sprite. I've always made every single class extend movieclip up until now. I want to make them extend what they only need.

    Edit: Nevermind I changed test:Sprite to test:Test and it worked. I always tell myself to debug more before posting but I never do..
    Last edited by 5Five555; 03-03-2011 at 10:49 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center