Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- /**
- * ...
- * @author Denis Maslov
- */
- public class Url {
- public static var _photoSrc = "";
- public function Url() {
- }
- public static function processingUrl(string:String):String {
- if(string.indexOf('photo') != -1){
- var txt:Array;
- var exp:RegExp = new RegExp('photo([-, 0-9, _]*)');
- txt = string.match(exp);
- Main.VK.api('photos.getById', { photos:txt[1], extended:0 }, loaded, vkError);
- trace(txt[0]);
- while(_photoSrc = ""){
- }
- }else {
- trace("Error");
- }
- return "";
- }
- private static function loaded(e:Object):void {
- trace(e[0]['src_big']);
- _photoSrc = e[0]['src_big'];
- }
- private static function vkError(e:String):void {
- trace(e);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement