Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
244
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 function Url() {
  9.            
  10.         }
  11.        
  12.         public static function processingUrl(string:String):String {
  13.         if(string.indexOf('photo') != -1){
  14.             var txt:Array;
  15.             var exp:RegExp = new RegExp('photo([-, 0-9, _]*)');
  16.             txt = string.match(exp);
  17.             Main.VK.api('photos.getById', { photos:txt[1], extended:0 }, loaded, vkError);
  18.             trace(txt[0]);
  19.         }else {
  20.             trace("Error");
  21.         }
  22.        
  23.         return "";
  24.        
  25.  
  26.        
  27.         }
  28.        
  29.         private static function loaded(e:Object):void {
  30.         trace(e[0]['src_big']);
  31.         }
  32.        
  33.         private static function vkError(e:String):void {
  34.             trace(e);
  35.         }
  36.        
  37.     }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement