Browse Source

added resource.

Nicolas Cannasse 19 years ago
parent
commit
a26970ef40
1 changed files with 15 additions and 0 deletions
  1. 15 0
      std/Std.hx

+ 15 - 0
std/Std.hx

@@ -202,4 +202,19 @@ class Std {
 		#end
 	}
 
+	/**
+		Return the given resource stored using -res, or null if not defined.
+	**/
+	public static function resource( name : String ) : String {
+		return untyped
+		#if flash
+		flash.Boot.__res[name];
+		#else neko
+		__dollar__objget(neko.Boot.__res,__dollar__hash(name.__s));
+		#else js
+		js.Boot.__res[name];
+		#else error
+		#end
+	}
+
 }