-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStein_Flickr_Utils.as
More file actions
50 lines (43 loc) · 1.07 KB
/
Stein_Flickr_Utils.as
File metadata and controls
50 lines (43 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package
{
//feel free to use this how you want in any of your projects.
public class Stein_Flickr_Utils
{
public function Stein_Flickr_Utils():void
{
}
//Use this function to get the URL you need to load a picture.
//Example this assmes you have a photo object (com.adobe.webapis.flickr.Photo) named p
//loader.load(new URLRequest( Stein_Flickr_Utils.getPhotoURL(p.server, p.id, p.secret, "square") ));
static function getPhotoURL(server:int, id:String, secret:String, size:String):String
{
var path:String = "http://static.flickr.com/" + server + "/" + id + "_" + secret;
switch (size)
{
case "square" :
path += "_s";
break;
case "thumbnail" :
path += "_t";
break;
case "small" :
path += "_m";
break;
case "medium500" :
path += "";
break;
case "medium640" :
path += "_z";
break;
case "large" :
path += "_b";
break;
case "original" :
path += "_o";
break;
}
path += ".jpg";
return path;
}
}
}