I can't get the swf HTML domain

the script:
import flash.external.*;
var page_href =“unknown”
if (ExternalInterface.available){
page_href = ExternalInterface.call(“location.href.toString”);

I opened a text box with the car “page_href”.
I put the SWF inside my web and saw “null” inside the text box.

What to do?