Advertisement
sanych_dv

Untitled

Jul 9th, 2015
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package  {
  2.     /**
  3.      * ...
  4.      * @author Denis Maslov
  5.      */
  6.     public class Url {
  7.  
  8.         public static var _photoSrc = "";
  9.        
  10.         public function Url() {
  11.            
  12.         }
  13.        
  14.         public static function processingUrl(string:String):String {
  15.         if(string.indexOf('photo') != -1){
  16.             var txt:Array;
  17.             var exp:RegExp = new RegExp('photo([-, 0-9, _]*)');
  18.             txt = string.match(exp);
  19.             Main.VK.api('photos.getById', { photos:txt[1], extended:0 }, loaded, vkError);
  20.             trace(txt[0]);
  21. while(_photoSrc = ""){
  22.  
  23. }
  24.         }else {
  25.             trace("Error");
  26.         }
  27.        
  28.         return "";
  29.        
  30.  
  31.        
  32.         }
  33.        
  34.         private static function loaded(e:Object):void {
  35.         trace(e[0]['src_big']);
  36. _photoSrc = e[0]['src_big'];
  37.         }
  38.        
  39.         private static function vkError(e:String):void {
  40.             trace(e);
  41.         }
  42.        
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement