0
votes

I have a class that holds an object from another class. When I want to call some function from this class, I get the above error... See code to get a better idea!

MainMenu.as

package portfolioSource  {      
    public class MainMenu extends MovieClip {

        private var movieContainer:MoviePlayerContainer;

        public function MainMenu() {

            movieContainer = new MoviePlayerContainer();
            this.addChild(movieContainer);

        }

        function ef_btnTheme1CLICK(event:Event){

            movieContainer.playContent(1);//It breaks here

        }           
    }       
}

and MoviePlayerContainer.as

package portfolioSource  {    
    public class MoviePlayerContainer extends MovieClip {   

        public function playContent(_parameter:Number){

            trace("I do not work");

        }
    }

}

Any ideas on what I'm doing wrong? Not one of the functions in the movieContainer object works. I get the same error every time. The constructor (omitted here) does not get executed, but it generates no error...

When I remove the package part and leave it default like :

package {
    public class someClass{
    }
}

Then it works. So I am really confused now.

Thanks!

1
Are You extending MovieClip from library ? If yes , thats because MoviePlayerContainer have wrong path to Your class , close to class alias label is button that can chack connection to external .as file . Click it and check linkageturbosqel

1 Answers

0
votes

It looks like you have 2 classes being defined with the same name on different packages. You should remove or rename one of them.

I'm unaware if Flash supports this, but see if this works: private var movieContainer : portfolioSource.MoviePlayerContainer;