Swf game loading infinity?

i tried to create a swf game. It worked perfectly on my old host and domain. But when i moved my game to new host and domain, it doesn't show loading progress on firefox and with google chrome, it stops working with 'Loading Infinity%'.

Here is my game: http://afcvn.myarsenal.net/afcvn/swf_games/game_matching.swf

And this is my loading code and i export classes in frame 2:

stop();

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void {

    var total:Number = this.stage.loaderInfo.bytesTotal;
    var loaded:Number = this.stage.loaderInfo.bytesLoaded;

    progressBar.scaleX = loaded/total;
    loader_info.text = "Loading "+Math.floor((loaded/total)*100)+ "%";

    if (total == loaded) {
        play();
        this.removeEventListener(Event.ENTER_FRAME, loading);
    }

}

I added a crossdomain.xml: http://afcvn.myarsenal.net/crossdomain.xml

Can anybody help? Highly appreciate! :)

Answers


Look at my answer to this question. (turn off server compression on swf files)

And try to avoid division by zero (Flash allows it but the outcome is Infinity). If bytesLoaded==0 your loading code will stop immediately because bytesTotal==0 too then.


Need Your Help

LINQ to Entities create dynamic field

c# linq entity-framework linq-to-entities entity-framework-5

I am trying to create a dynamic field using LINQ to Entities w/ EF5. Based on certain conditions (which I've encapsulated in a function) the dynamic field will be populated with different values.

Java Pattern Matching: Pattern.compile

java pattern-matching

I have an edit box. I am checking if the email address entered is valid or not.