Hi,
I want to know if someone here has a problema similar to mine.
Well im developing a flash game
Where I want 100 % full flash in the site then I make the html like this:
// HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> </title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js"
type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
AC_FL_RunContent(
'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.
cab#version=9,0,28,0','width','100%','height','100%','src','swf/inicio','qua
lity','high','pluginspage','http://www.adobe.com/shockwave/download/download
.cgi?P1_Prod_Version=ShockwaveFlash','movie','swf/inicio' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=9,0,28,0" width="100%" height="100%">
<param name="movie" value="swf/inicio.swf">
<param name="quality" value="high">
<embed src="swf/inicio.swf" quality="high"
pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Ve
rsion=ShockwaveFlash" type="application/x-shockwave-flash" width="100%"
height="100%"></embed>
</object>
</noscript>
</body>
</html>
// \ HTML
Then in my flash I have the main swf that loads everything else like this:
// AS2 inicio.fla
Stage.scaleMode = "noScale";
Stage.align = "TL";
System.useCodepage = true;
fscommand("trapallkeys", "true");
Stage.showMenu = false;
var path:String = new String
path = "swf/";
function rsize() {
var mc:MovieClip = _root.contentMC;
mc.forceWidth = 960
mc.forceHeight = 580
var width:Number = (mc.forceWidth == null) ? mc._width :
mc.forceWidth;
var height:Number = (mc.forceHeight == null) ? mc._height :
mc.forceHeight;
mc._x = Math.round((Stage.width-width)/2);
mc._y = Math.round((Stage.height-height)/2);
};
var stageListener:Object = {};
stageListener.onResize = rsize();
Stage.addListener(stageListener);
var contentMC:MovieClip = this.createEmptyMovieClip("contentMC",
this.getNextHighestDepth());
var contentLoaderMCL:MovieClipLoader = new MovieClipLoader();
var contentLoaderListener:Object = {};
//cuando ya se acabo de cargar y esta ejecutandose el primer frame de ese MC
contentLoaderListener.onLoadInit = function():Void {
//stageListener.onResize();
};
//Cuando termino de cargarse el MC
contentLoaderListener.onLoadComplete = function(mc:MovieClip):Void {
removeMovieClip(loading)
}
//mientras esta cargando el MC
contentLoaderListener.onLoadProgress = function(mc:MovieClip,
bytesLoaded:Number, bytesTotal:Number):Void {
var porcentaje:Number = Math.floor((bytesLoaded/bytesTotal)
* 100);
loading.back_loading._width = Stage.width
loading.back_loading._height = Stage.height
loading.porcentaje = porcentaje + "%";
loading.barra._xscale = porcentaje
loading._x = Math.floor((Stage.width - 960) / 2);
loading._y = Math.floor((Stage.height - 580) / 2);
}
//cuando empieza a cargarse el MC
contentLoaderListener.onLoadStart = function(mc:MovieClip):Void {
attachMovie("loading", "loading",
_root.getNextHighestDepth());
loading._x =Math.floor((Stage.width - 960) / 2);
loading._y = Math.floor((Stage.height - 580) / 2);
}
contentLoaderMCL.addListener(contentLoaderListener);
contentLoaderMCL.loadClip(path+"template.swf",contentMC);
rsize();
stop();
// \AS2 inicio.fla
Well as you can see I have an stage listener where I center my main movie
(template.swf)
Inside this I make a lot of things and I have one part of the game where is
a racing car game, where I detect a lot of colitions but theres my problem
where I test the swf inside flash all works fine.
But when I test it with the 100 % of the flash movie where is the stage
listener the game brokes
it seems I make colitions all the time.
If I remove the stage listener all works fine.
I want to know if someone has encounter some similar problem.
thanks
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders