/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
You can use loaderInfo.loaderURL to get the full path and name of you swf Example of a class: public class Main extends Sprite { private function init():void { removeEventListener(Event.COMPLETE, init); var myUrl:String=loaderInfo.loaderURL; var tmp:Array=myUrl.split("/"); var myName:String=tmp[tmp.length-1].split(".swf")[0]; } public function Main() { super(); if (stage) init(); else addEventListener(Event.COMPLETE, init, false, 0, true); } }