Hello List !!
I try to fully create a project (F7) with the combo swfmill/mtasc.
I have to use a shared library, a main application and a Loader.
To create my library, I use the following xml :
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="768" height="652" framerate="31">
<background color="#ffffff"/>
<frame>
<library>
<clip id="circles" import="libraries/circles.png" />
<clip id="bottom" import="libraries/bottom.png" />
<clip id="minilogo" import="libraries/minilogo.png" />
<clip id="_graphics">
<frame/>
</clip>
</library>
</frame>
</movie>
My library is stored in the "/libraries" directory
After that, I create a main application with this xml file :
<?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="768" height="652" framerate="31">
<background color="#ffffff"/>
<frame>
<import url="./libraries/graphics.swf" symbol="_graphics"/>
<!--<place id="_graphics" name="_graphics" x="-20" y="20"
depth="1" />-->
</frame>
</movie>
The only first <import> is needed to access to the shared library stored
in /libraries
I build a main file and somes classes, compile my application, and all
seems to be ok
Now I want to implement a loader swf, who preload via loadVars the
library, the data used by the application and the application itself.
The loader is in the same directory than the main application.
My loading function is at end of mail. It use a "aDataProvider" array of
objects to store each element to preload. The last element is the
application :
The problem is when I load application in loader, I don't have access to
the library... I don't know what, because when I start directly
application, all is ok...
If anyone has a solution/idea about this problem, please share it :)
Thanks in advance
Thierry
private function loadMovies()
{
var mc:MovieClip = createEmptyMovieClip('mc', 100 );
mc._visible = false;
var d:Date = new Date();
mc.loadMovie( aDataProvider[nIndex].data ); //+ "?date=" +
d.getDate() );
var flag:Number = 0;
this.onEnterFrame = function()
{
mc._visible = false;
var mcLoader = this.mcLoader;
var l:Number = mc.getBytesLoaded();
var t:Number = mc.getBytesTotal();
var r:Number = l * 100 / t;
if( 0 < r )
{
}
if( 0 < r < 100 && t > 4 )
{
mcLoader.tTxt.text = Math.round(r) + " / 100%";
mcLoader.bar._xscale = r;
}
else
{
mcLoader.tTxt.text = r + " / 100%";
mcLoader.bar._xscale = 100;
flag++;
if( flag > 10 )
{
mcLoader.tTxt.text = "";
mcLoader.tInfos.text = "";
if( this.nIndex == this.aDataProvider.length - 1 )
{
if( mcLoader._alpha > 0 )
mcLoader._alpha -= 10;
else
{
mc._lockroot = true;
mc.focusManager.enabled = false;
mc._visible = true;
mcLoader.removeMovieClip();
//mc.removeMovieClip();
delete this.onEnterFrame;
}
}
else
{
if( flag > 31 )
this.onLoadMovies();
}
}
}
}
}
_______________________________________________
swfmill mailing list
[email protected]
http://osflash.org/mailman/listinfo/swfmill_osflash.org