ActionScript 3

1) Loader.loaderURL returns "wrong" location.

Location of the protected SWF differs from location of the unprotected SWF.
Example:

trace("URL="+stage.root.loaderInfo.loaderURL);

Unprotected version output:

URL=file:///C|/FlashProjects/Protector/out/testparams.swf

Protected version output:

URL=file:///C|/FlashProjects/Protector/out/protected%5Ftestparams.swf/[[DYNAMIC]]/1/[[DYNAMIC]]/2/[[DYNAMIC]]/3/[[DYNAMIC]]/4/[[DYNAMIC]]/5

You can see here tracks of 5 protection wrappers around of the original SWF.

Please use the following code template to get "right" location:

function getLocation():String {
  var url:String = stage.root.loaderInfo.loaderURL;
  var endOfUrl:int = url.indexOf("/[[DYNAMIC]]/");
  return  (endOfUrl > 0)? url.substr(0,endOfUrl) : url;
}

2) Wrong initialization.

When a loading operation is not complete, some properties of the loaded movie are not available. Loading of protected movie differs slightly from loading of original movie. Check initialization logic if protected movie is not working.

It is a good practice to move code from the main constructor to onInit event handler, see example below

public function main() {
    super();
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    ...
}
        
public function main() {
    super();
    root.loaderInfo.addEventListener(Event.INIT, onInit);
}
		
private function onInit(e:Event):void {
    root.loaderInfo.removeEventListener(Event.INIT, onInit);
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    ...
}

ActionScript 2

1) Protected movie is loaded by internal Loader as AVM1Movie.

You should consider limitations of AVM1Movie.

2) _root._url returns "wrong" location.

Location of the protected SWF differs from location of the unprotected SWF.
Example:

trace("URL="+_root._url);

Unprotected version output:

URL=file:///C|/FlashProjects/Protector/out/testparams.swf

Protected version output:

URL=file:///C|/FlashProjects/Protector/out/protected%5Ftestparams.swf/[[DYNAMIC]]/1/[[DYNAMIC]]/2/[[DYNAMIC]]/3/[[DYNAMIC]]/4/[[DYNAMIC]]/5

You can see here tracks of 5 protection wrappers around of the original SWF.

Please use the following code template to get "right" location:

function getLocation():String {
  var url:String = _root._url;
  var endOfUrl:Number = url.indexOf("/[[DYNAMIC]]/");
  return  (endOfUrl > 0)? url.substr(0,endOfUrl) : url;
}

3) Protected SWF file can't read parameters.

To provide SWF file parameters as properties of the main timeline you should place the following lines at the begin of your program.

// ---- init SWF parameters
var pars:String = "_$_`S";
var items:Array = pars.split("`");
var len:Number = items.length;
for (var i:Number = 0; i

You can change names of variables, but don't change the text constant - "_$_`S". Protector will search this string and replace it by actual parameters.