Accessing methods of a base class

Subscribe to Accessing methods of a base class 4 posts

avatar for Jiggibidy Jiggibidy 39 posts
Flag Post

Hello,

Basically, I have a class with a couple of methods in it, and I have a second class which extends it.

I’m trying to access a method that’s in the base class within the second class file, and whenever I try to compile, it throws an error my way.

Call to a possibly undefined method stillOnPlatform.

As a last resort, I could override the functions I need into the file, but it might be nice to see where I’m going wrong nonetheless.

Thank in advance. :D

 
avatar for Draco18s Draco18s 6860 posts
Flag Post

In the base class use protected not private

 
avatar for Jiggibidy Jiggibidy 39 posts
Flag Post

Ah, I gotcha.

I’ve always wondered what protected did…

Thanks. :D

 
avatar for Nolander777 Nolander777 222 posts
Flag Post

Remember, though, that private components are still extended and effectual, you just can’t reference them.