bennyxqg / bulk-loader

Automatically exported from code.google.com/p/bulk-loader
0 stars 0 forks source link

{preventCache: true} is not working on FlashIDE #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.

What steps will reproduce the problem?

on Flash CS3 IDE

1. bulkLoader.add("content.swf", {preventCache: true});
2. test movie
3. follow errors were happened.

[BulkLoader] After 3 I am giving up on
content.swf?BulkLoaderNoCache=1_1_121&BulkLoaderNoCache=1_1_1188&BulkLoaderNoCac
he=1_1_9953
[BulkLoader] Error loading LoadingItem url:
content.swf?BulkLoaderNoCache=1_1_121&BulkLoaderNoCache=1_1_1188&BulkLoaderNoCac
he=1_1_9953,
type:movieclip, status: error Error #2035: URL が見つかりません。 URL:
file:///C|/foo/content.swf?BulkLoaderNoCache=1_1_121&BulkLoaderNoCache=1_1_1188&
BulkLoaderNoCache=1_1_9953

Please provide any additional information below.

suggestion:
loadingtypes/LoadingItem.as line 245

if (preventCache)

instead,

var workingOnHTTP:Boolean = !(stage.loaderInfo.url.match(/^https?:\/\//)
=== null);
if (preventCache && workingOnHTTP)

but, I have no idea how to get stage reference in BulkLoader.

Original issue reported on code.google.com by tanab...@gmail.com on 1 Sep 2009 at 6:20

GoogleCodeExporter commented 9 years ago
Hi Tanablog.

While I do understand the usage case, I'd rather keep that decision to client 
code. BulkLoader is pretty agnostic if it's running locally or not, and it 
would be better to keep it that way.

My suggestion is to create a BulkLoader subclass and overwrite the add method, 
something like this
public class LocalAwareBulkLoader extends BulkLoader{

    overwrite public function add(url:*, props) : LoadingItem{
       if (url.indexOf("file://") > -1 && props && props["preventCache"]) del props["preventCache"]
       return super.add(url, props)
    }
}

This is just an illustration (haven't tested the code or anything), but it's a 
good way to wrap that funcionality outside of bulkloader.

Cheers
Arthur Debert

Original comment by debert on 7 Sep 2009 at 5:08

GoogleCodeExporter commented 9 years ago
Hi Arthur.

I get it. I create BulkLoader subclass.
thanks.

Original comment by tanab...@gmail.com on 8 Sep 2009 at 2:21