Which may fail, since PxLoaderimage, PxLoaderSound and PxLoaderVideo will try to add some methods on PxLoader prototype through it's global definition.
As AMD do not load files orderly, the sound, image and video plugins may finish loading first, specially because they are much smaller. And every time it happens, an error will be raised.
Uncaught ReferenceError: PxLoader is not defined
In order to fix this, this raw prototype calls should be made as a AMD require as well in case define and amd.define is present, so the PxLoader reference will never be undefined.
Even tough there seems to be some work done for providing AMD compatibility, there are some inconsistencies that may still fail.
For example, I can have:
Which may fail, since
PxLoaderimage
,PxLoaderSound
andPxLoaderVideo
will try to add some methods onPxLoader
prototype through it's global definition.As AMD do not load files orderly, the
sound
,image
andvideo
plugins may finish loading first, specially because they are much smaller. And every time it happens, an error will be raised.In order to fix this, this raw prototype calls should be made as a AMD
require
as well in casedefine
andamd.define
is present, so thePxLoader
reference will never beundefined
.