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 6004703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:18:01+00:00 2026-05-23T01:18:01+00:00

I am migrating an application from flex sdk 3.4 to flex sdk 4.5. I

  • 0

I am migrating an application from flex sdk 3.4 to flex sdk 4.5.

I am using a telnet example of AS3 tutorials as base to construct a generic socket class that implement a specific protocol.

The main problem is that the new application with the validated socket class does not fire any event (no error – no connected – no data – nothing). The try catch with the connect method does not throw any error. I checked if the events were successfully connected, but they are not fired never.

Update: I used the suggestions to modidy the code. Actually, now I am receiving an error on the security policy.

This is the constructor:

         public function GenericSocket(server:String, port:int, output:TextArea) {
            // set class variables to the values passed to the constructor.
            serverURL = server;
            portNumber = port;
            ta = output;

            // Create a new Socket object and assign event listeners.
            socket = new Socket();
            socket.addEventListener(Event.CONNECT, connectHandler);
            socket.addEventListener(Event.CLOSE, closeHandler);
            socket.addEventListener(ErrorEvent.ERROR, errorHandler);
            socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                    //Added by suggestions
                    socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            socket.addEventListener(ProgressEvent.SOCKET_DATA, dataHandler);

            // Load policy file from remote server.
            Security.loadPolicyFile("http://" + serverURL + "/crossdomain.xml");
            // Attempt to connect to remote socket server.
            try {
                msg("Trying to connect to " + serverURL + ":" + portNumber + "\n");
                socket.connect(serverURL, portNumber);
            } catch (error:Error) {
                /*
                Unable to connect to remote server, display error 
                message and close connection.
                */
                msg(error.message + "\n");
                socket.close();
            }
        }

This is the connectHandler, securityErrorHandler and the ioErrorHandler (Never called Update: Security handler is beign called)

        private function connectHandler(event:Event):void {
            if (socket.connected) {
                msg("connected...\n");
            } else {
                msg("Error: unable to connect\n");
            }
        }

//Added by suggestions

private function securityErrorHandler(event:SecurityErrorEvent):void {
            msg("securityErrorHandler: " + event+"\n");
        }

        public function ioErrorHandler(event:IOErrorEvent):void {
            msg("Error: Unable to connect: socket error.\n");
        }

Some idea or directive could be useful. Maybe some test to try the generic socket? maybe the type of the application?

Update:
The error that I received is:

securityErrorHandler: [SecurityErrorEvent type=”securityError” bubbles=false cancelable=false eventPhase=2 text=”Error #2048″]

I am using these includes in the project:

           xmlns:mx="http://www.adobe.com/2006/mxml" 
           xmlns:s="library://ns.adobe.com/flex/spark"
           xmlns:mx2="library://ns.adobe.com/flex/mx"
  • 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-23T01:18:02+00:00Added an answer on May 23, 2026 at 1:18 am

    Here you can find an answer I gave some time ago to the same problem you have. Be sure to read the comments and follow the links, there is a good example/tutorial on one of the links. It’s basically related to the way you serve the security policy, you have to serve it via socket after the app has sent a request for it on port 843. For this, you need of course a sever app, can’t be served by a the webserver via HTTP.

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

Sidebar

Related Questions

I am migrating an application from .NET 1.1 to .NET 2.0. Should I remove
What kinds of considerations are there for migrating an application from NHibernate 1.2 to
I am migrating a struts application from Websphere to Tomcat 6 and my application
I have a Grails application that I am migrating from 1.0.3 to 1.3.7 It
I am using Ruby on Rails 3.0.7 and I am migrating from Prototype to
Whats the best resource to look at for when migrating dotnet applications from 32bit
In the very near future I'll be migrating some web applications from VS2003 projects
I'm testing out my application with the hopes of migrating to SQL Server 2008
Found the following in an Oracle-based application that we're migrating (generalized) : SELECT Table1.Category1,
Migrating a project from ASP.NET 1.1 to ASP.NET 2.0 and I keep hitting this

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.