Convert comment to asdoc format
[potlatch2.git] / net / systemeD / halcyon / DebugURLRequest.as
1 package net.systemeD.halcyon {
2
3         import flash.net.URLRequest;
4         import flash.net.URLRequestMethod;
5         import flash.system.Capabilities;
6         import net.systemeD.halcyon.Globals;
7
8     /**
9     * If nocache has been set to 'true' via FlashVars, this will make the URLRequest using
10     * POST rather than GET - thereby preventing FP from caching it.
11     *
12     * <p>Sadly we can't just subclass URLRequest, which is defined as final. So you need to create your
13     * new DebugURLRequest, then refer to its .request property.</p>
14     *
15     * <p>We use an evil Global because we don't know where loaderInfo.parameters will be.</p>
16     *
17     * @see http://www.ultrashock.com/forums/actionscript/force-reload-files-only-using-as3-123408.html
18     */
19
20         public class DebugURLRequest {
21
22                 public var request:URLRequest;
23
24                 public function DebugURLRequest(url:String=null) {
25                         request=new URLRequest(url);
26                         if (Globals.vars.hasOwnProperty('nocache') && Globals.vars.nocache) {
27                                 request.method=URLRequestMethod.POST;
28                                 request.data=true;
29                         }
30                 }
31
32         }
33
34 }