Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7556213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:48:34+00:00 2026-05-30T11:48:34+00:00

I am working on integrating the social network vkontakte into my desktop application using

  • 0

I am working on integrating the social network “vkontakte” into my desktop application using Adobe AIR. The flow of authorization in the app is as follows:

  1. Open the web browser with a url, and when the user inputs login and password, redirect to somePage.html.

  2. From that URL, I need to get an access_token to sign all future API requests.

So the question really is: How can I listen to an event, which will indicate that the user has logged in successfully, or failed to get that access_token?

Here is the code I am using:

package
{
    import air.net.URLMonitor;

    import flash.display.Sprite;
    import flash.events.ErrorEvent;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.StatusEvent;
    import flash.net.*;

    public class VKPlayer extends Sprite
    {
        private var url:URLRequest;

        public function VKPlayer()
        {
            this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
        }

        private function onAddedToStage(event:Event):void
        {
            this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
            //draw black background
            with( graphics ) 
            {
                beginFill(0x0)
                drawRect(0, 0, stage.stageWidth, stage.stageHeight);
            }
            init();
        }

        private function init():void
        {
            trace("Starting application");

            //vk init params
            var scope:String = "friends,video,audio";
            var appID:String = "1111111";
            var redirect_uri:String = "http://oauth.vkontakte.ru/blank.html";
            var browserType:String = "popup";
            var response_type:String = "token";
            var baseURL:String = "http://oauth.vkontakte.ru/authorize?client_id=";

            var initUrl:String = baseURL + appID + "&scope=" + scope + "&redirect_uri="+redirect_uri+"&display="+browserType+"&response_type="+response_type;
            trace(initUrl);

            url = new URLRequest(initUrl);
            navigateToURL(url, "_blank"); 
            makeQueries();
        }

        private function makeQueries():void
        {
            var str:String = "https://api.vkontakte.ru/method/getProfiles?uid=36396528&access_token=23ef280b0482a7604aa9191a414bef70b421bd54bc475e1cc7fa3d8a854d8ac";
            var req:URLRequest = new URLRequest(str);
            var uLdr:URLLoader = new URLLoader(req);
            uLdr.addEventListener(Event.COMPLETE, onComplete);
            uLdr.addEventListener(ErrorEvent.ERROR, onErrorHandler);
            uLdr.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        }

        private function onComplete(event:Event):void
        {
            trace(event);
        }

        private function onErrorHandler(event:ErrorEvent):void
        {
            trace(event);
        }

        private function ioErrorHandler(event:IOErrorEvent):void
        {
            trace(event);
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:48:36+00:00Added an answer on May 30, 2026 at 11:48 am

    Your answer is tagged with Flash so I’m not sure if this is applicable as I think it may only be available in the Flex SDK.

    The Flex SDK contains a HTML component which lets you display HTML content in your application.

    This will essentially create a holder for a webpage – in this case your authorisation page. Once the user has authorised you app, you can listen for a LOCATION_CHANGE event which will occur when the application redirects you to a sucess or failure page.

    With some services, they will pass the Access token in the url that they redirect you to, so you can inspect the new location and extract the access token from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on integrating affiliate sales into few existing sites. We are using
I'm integrating a reCAPTCHA into my Cappuccino app and I have it all working
Im integrating local notification into my app. It is working fine. But client want
I'm working on integrating Facebook support into a blogging engine. I registered an app
I'm integrating ShareKit into an app and all is working as desired except for
I'm integrating Facebook into my iPhone app and I have the code working to
I'm working on integrating Ben Gottlieb's Twitter-OAuth-iPhone code into my cocos2d 0.99.5 project using
I am working on integrating Facebook into my iOS app and am wondering how
I am integrating Unity 2.0 into my ASP.NET application (using the UnityPageHandlerFactory approach) and
I am working on integrating Assetic into an application that I am building. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.