Hi everyone.
I’m trying to learn to extend/split up my classes. For example say that I have a preloader, I want to load different things different ways so that’s why I have several loading functions.
What I want is to have the base preloader that holds functions that all preloader functions can use. Then I want all the different loaders functions in different classes.
Preloader.as
- Preloader_preloadIntroElements.as
- Preloader_loadSwfs.as
- Preloader_preloadMovies.as
How schould I solve this?
I started a little like this:
[COLOR=Red]Preloader.as[/COLOR]
import com.broadcaster.EventBroadcaster
class com.loaders.Preloader extends EventBroadcaster{
function Preloader(){
//some things
}
function preloadIntroElements(){}
}
and then in the [COLOR=Red]Preloader_preloadIntroElements.as[/COLOR]
import com.loaders.Preloader
class com.loaders.Preloader_preloadIntroElements extends com.loaders.Preloader{
function preloadIntroElements(alot of values){
// Do all loading stuff
}
}
The problem is that I cant get to the Preloader_preloadIntroElements.as class. it stays and just runs the preloadIntroElements function in Preloader.as