flash/flex 4 application - why/when it works differently in different environemnts?

Since a week I am seeing my flex 4 application is working differently in my local environment and the remotely deployed environment.

I copied entire bin-debug folder into the remote and I have no clue why this happens? its the same swf copied into the remote and its the same browser I am using to run the app but it just behaves differently.

Well, I read some of the posts who has issues with layouts appear differently in the local and remote but let me clarify you that in my case I have not see layout issues but its the code seems working differently. Like, I have implemented dynamic masking, collusion detection, depth sorting algorithms in my code which works perfect in local environment and wont in remote environment.

If you think it could be cache problem, then let me tell you. I have cleared cache of my browser (in fact I do it almost ever time before I run the app). Also, I have completely deleted files in the remote and copied all the files again. I have also tried by deploying the "release" build also but the same thing. I have did each of the above steps multiple times in different combinations to see the fix but no luck yet.

I am sure this should't matter

I am using WAMP in local environment and LAMP in remote

To make sure I am seeing the latest version, I have added a version number and displayed in debug window. both environments shows the same number so this tells both are same versions.

These are all the files I have copied along with my main swf

framework_4.0.0.14159.swf
main.swf
osmf_flex.4.0.0.13495.swf
rpc_4.0.0.14159.swf
spark_4.0.0.14159.swf
sparkskins_4.0.0.14159.swf
test.swf
textLayout_1.0.0.595.swf

I dont know how to resolve this. please help

Answers


Thanks shaunhusain thanks a lot. I used the trace using the snipping tools and found the bug.

Its all in the host name. I was finding the asset type based on the extension found in the url. I remove transparent pixels if the asset type is an "image" and ignore if its not an image (xml,swf etc.,)

and this is the code which determines the asset type (note the default value is 'unknown')

    private function getAssetType(url:String):String{

        var type:String = "unknown";

        var ext:String = getExtension(url);

        if (ext == "png" || ext == "jpg" || ext == "jpeg" || ext == "bmp"){
            type ="image";
        }else if (ext == "swf"){
            type = "swf";
        }

        return type;

    }
    // this is the buggy code
    private function getExtension(str:String):String{
        return  str.split(".")[1];
    }

The bug is in the getExtension() function. I was expecting the dots only in the filename and the split returns two array elements and the 2nd element is the extension.

if you pass this variable

http://localhost/assets/images/Rendered/aksum_se.png

it returns png

http://19x.19x.24x.xxx/assets/images/Rendered/aksum_se.png

it returns 19x and thus its an unknown format. Well I fixed it.

Now I am little curious why my depth sorting is not working which is nto related to any image url but I think I will make it.


Need Your Help

adding points to a weather map

jquery map clickable

I have a weather map on my website (jpg), but it does not indicate cities. I would like to add point (with an index) show particular cities. What is the best way to do that. Can I use jquery for that?

NSEvent modifier flags not updating until mouse moves

cocoa osx-snow-leopard osx-leopard nsevent

In Mac OS X 10.6, NSEvent has a +modifierFlags class method to determind the currently pressed modifier flags. In 10.5, using [[NSApp currentEvent] modifierFlags] only updates after mouse move. Is ...