Created
July 31, 2010 05:58
-
-
Save vorushin/501814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Loader; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.net.URLLoader; | |
import flash.net.URLRequest; | |
import flash.text.TextField; | |
import com.adobe.serialization.json.JSON; | |
public class Main extends Sprite | |
{ | |
private var textField2:TextField; | |
private var wallPostLoader:URLLoader; | |
public function Main() | |
{ | |
addEventListener(Event.ADDED_TO_STAGE, onStage); | |
} | |
public function onStage(evt:Event):void | |
{ | |
var wrapper:Object = Object(parent.parent); | |
var parameters:Object = wrapper.application.parameters; | |
wallPostLoader = new URLLoader(); | |
wallPostLoader.load(new URLRequest('http://drawity.risovaska.ru/vk/wall_post/' + parameters.post_id + '/')); | |
wallPostLoader.addEventListener(Event.COMPLETE, function(evt:Event):void { | |
var json:Object = (JSON.decode(wallPostLoader.data) as Object); | |
var imageLoader:Loader = new Loader(); | |
var image:URLRequest = new URLRequest(json.image_url); | |
imageLoader.load(image); | |
addChild(imageLoader); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment