Pages: [1]
  Print  
Author Topic: Multiple preloaders: Inheritance and Interfaces  (Read 122 times)
Chris G
Gaia User
**
Posts: 38


« on: February 08, 2010, 10:04:12 AM »

Hi all,

I'm putting together a site which will use a number of different preloaders and select which one to use based on the current branch. The selection process is a breeze thanks to Gaia's hijacking features.

My intention is to have a collection of interchangeable Preloader classes, all sharing common inheritance and interfaces.

From reading the documentation it appears that there are two ways of replacing the default preloader:

1. At compile time using
Code:
preloader="myCustomPreloader.swf"
in the site node or,

2. At run time using
Code:
setPreloader(asset:MovieClipAsset)

So a preloader added at compile time must:
Implement the IPreloader interface either directly or by extending AbstractPreloader.

...and a preloader added at runtime must:
Be a loaded MovieClipAsset

In theory, could I write custom preloader Classes that would satisfy both of these conditions whilst still inheriting from AbstractBase? If so, you could have one big package of homogenous preloader classes and not have to worry about whether the custom preloader was to be used at compile or run time.

If each transition (EDIT: sorry, meant preloader not transition!) was a compiled swf with a document Class that extended AbstractPreloader, could the resulting loaded asset be cast to AbstractPreloader AND MovieClipAsset ?

« Last Edit: February 08, 2010, 02:15:04 PM by Chris G » Logged
Chris G
Gaia User
**
Posts: 38


« Reply #1 on: February 11, 2010, 06:13:09 AM »

My bad, please ignore the above. I'd made a wrong assumption about Gaia's chain of inheritance...

*slaps hand to forehead*
Logged
Pages: [1]
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc