why file can not be read in adobe flash , air or actionscript on server

I used this function to load a text file

public function load_ways(zoom)
{
    finish_working = false;
    _zoom = zoom;
    var data:URLLoader = new URLLoader();
    data.addEventListener(Event.COMPLETE, onLoaded_KV);
    data.load(new URLRequest("zoom\\" + _zoom + ".txt"));
}

That worked correctly when i ran my application on my computer. But when I moved the file to a server, the file won't load.

Actually, onLoaded_KV function was called but with empty data.

Answers


You can't have a backslash in an URL change it to:

public function load_ways(zoom)
{
    finish_working = false;
    _zoom = zoom;
    var data:URLLoader = new URLLoader();
    data.addEventListener(Event.COMPLETE, onLoaded_KV);
    data.load(new URLRequest("zoom/" + _zoom + ".txt"));
}

Need Your Help

Convert.ToDouble non-numeric string

c# regex string

I want to extract the number out of a string that might contain non-numeric characters

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.