Flash :: Socket Class Is Not Working On Flex SDK 4.5?

Jun 1, 2011

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.

[code].....

View 1 Replies


Similar Posts:


Flex :: Actionscript 3 - Flex Socket And Erlang Socket Communication

Jun 29, 2011

I'm creating a client-server game. My client is a flex based game, and my server is erlang server. At the beginning, when I test directly my flex client in flash player, I can establish a connection easily to my erlang server through socket connection. And both can exchange data with no problem. The problem rise when I deploy my flex app at Apache http server, and running it using a browser by calling [URL] my flex socket sends message requesting for a crossdomain policy to my erlang server. So I create an xml message that represent a crossdomain policy, and send it back to my flex app as a response for that request.

Yet still I can't establish any permanent socket connection between my flex client and my erlang server. I know this because I add listener on my flex socket that will modify its internal state to CONNECTED, if a connection between client-server has established.

View 2 Replies

ActionScript 3.0 :: Using Flash.net.Socket In Class Definition?

Apr 5, 2009

I'm writing my first AS3 class and basically I'm trying to take code from an AS3 .fla and incorporate it into the class. I've been getting plenty of errors, but this one seems to be at the crux of the problem:Code:1120: Access of undefined property socket.Here is all the code that is required to cause this error:

PHP Code:
package{ public class ScratchSocket { import flash.events.Event import flash.events.ProgressEventimport

[code]......

View 3 Replies

ActionScript 3.0 :: Flash Chat Application Using XML Socket Class?

Apr 8, 2009

build a chat application in Flash/Flex and Actionscript using XML Socket class.

View 1 Replies

Flash :: Flex Socket Crossdomain

Apr 28, 2010

I am trying to connect to a socket server from flex. I read, on adobe's documentation, the client automatically sends a "request-policy-file" xml element to the socket before allowing it to be opened, and should receive a policy file.

The client sends the xml element as expected, My server receives it (on the port I want to use, port 6104) and replies on the same port with:

[Code]...

View 1 Replies

Flex :: Play MP3's From Socket Connections In Flash AS3?

Mar 7, 2010

How to play mp3's from socket connections in Flash AS3?

I have some simple programm which is listening to some port (TCP).

I connect to it using as3 sockets and it starts sending me mp3 data

How to play that data?

View 1 Replies

Php :: Flash/Flex & PHP Socket Application Sandbox Error?

Dec 3, 2010

I am running a socket server using PHP. The socket server runs fine because I can connect to it using PHP.Now, I have a flash application that is trying to connect to it:

this.socket.addEventListener(Event.CONNECT, onSocketConnect);
this.socket.addEventListener(Event.CLOSE, onSocketClose);
this.socket.addEventListener(IOErrorEvent.IO_ERROR, onIOError);[code]....

When I run the application locally, it works! However, when I upload it to my server I get a sandbox security error (#2048). The flash app is actually hosted on the same server as the socket server, and there is cross domain policy file in place.

View 3 Replies

Flash :: Flex 4.6 Increasing Socket Receive Buffer Size?

Apr 5, 2012

I am having an issue with sockets where the data I'm sending is getting truncated on the client side (Flash/Flex). The data that is sent by my server is full and in tact, but flash does not wait the appropriate amount of time before firing an event saying to read the data. This results in the data not getting fully read and (as such) I can't parse the object out of it after that. We are exploring the possibility of stripping the object into smaller chunks, but the idea is for it to be as lightweight as possible so we would much rather get it to work the way it's supposed to than patch in a temporary solution.I'm not entirely sure if referring to it as the receive 'buffer' is correct, as some computers are able to receive all of the data and others are having it truncated (which means the buffer is adequate but flash isn't waiting the appropriate amount of time to dispatch the event for whatever the reason).

View 1 Replies

Flex :: AMF Class Mapping Not Working?

Oct 28, 2011

I am building an application using Flex 4.5 and Zend_AMF as my AMF endpoint.I would like to map a class called CRequest in PHP to a class called Request in Flex.This is my php class:

<?php
namespace appweb;
class CRequest{

[code].....

View 2 Replies

ActionScript 3.0 :: XML Socket Class - TCP Signals Lost

Jan 10, 2011

I am working on a project involving two actionscript clients and a java server. XML messages are sent from the clients to the server (and vice versa) via the XMLSocket class. The problem I am running into is that when messages are sent too quickly to one of the clients the client seems to lose track of them (it will not respond to them at all). The wierd part is when subsequent messages come in, the client will respond to old messages instead. It's as if the XML messages are getting queued up somewhere, but the signal that prompts the program to deal with them gets lost.

View 4 Replies

Flex :: UIComponent Base Class Not Working

Jan 4, 2010

I have a BaseComponentClass that I am using as the class that all my custom components extend.For some reason, none of my custom components show up at runtime. I am not getting any compile or runtime errors either.I am implementing all the protected UIComponent methods.[code]The Button never shows up at runtime.

View 3 Replies

ActionScript 3.0 :: Socket Class: Null-byte Throwing EOF

Oct 22, 2009

Could you please explain how to disable this unnecassery, bogus, and semantically invalid behavior of the network communication classes when it receives a 0 valued byte? (specifically the Socket class.)

View 8 Replies

ActionScript 3.0 :: Stream Video Over Socket Class (or XMLSocket)?

Nov 3, 2009

How to stream video over Socket Class (or XMLSocket) IN as3?

View 1 Replies

ActionScript 2.0 :: Get A Client Socket Class To Work With Events?

Jun 25, 2006

I'm new here, so maybe i'm posting in the wrong channel. Please tell me if it is the case. I'm trying to get a simple client socket class to work with events. I have tried each example found with google with no luck, i just tried the "radio listeners" example from here, which worked fine until i put the broadcaster object within my class.

[Code]...

View 1 Replies

ActionScript 3.0 :: Connect To A MySQL Database Directly Through The Socket Class?

Nov 2, 2006

is possible to connect to a mySQL database directly through the socket class?

View 1 Replies

ActionScript 3.0 :: Socket Class Unable To Connect To Internal Loopback?

Feb 16, 2011

I am building an AIR application where I receive UDP messages from Max/MSP using the Socket class. When testing in an internal loopback environment ( messages sent from 127.0.0.1 at port 7400 ) I can see the UDP messages being sent, as in: I can receive the messages I'm broadcasting in Max/MSP by listening to port 7400.However, the AIR app throws IO errors when trying to connect ( via the Socket class, using Socket.connect ) to aforementioned IP and port and I for the life of me can't find out why the app has no access to the internal loopback sending UTP ( if for instance, I start a Apache server at the same IP but at different port, the Socket class connects immediately to that IP - it won't receive data of course, but at least it can establish a connection )I am thinking the problem lies outside of the AS app and is an internal networking issue, I'd like to know if someone has experienced a similar error ( I'm on OS X, btw ) as I don't think it's a security sandbox error ( as the event isn't thrown, and the application type is trusted ).

View 1 Replies

Actionscript 3 :: Socket.readInt() And C# Socket.Send() Different Values Of Int-variable?

Nov 19, 2011

When I send number (int)52 s.Send(BitConverter.GetBytes((int)872415232));, flash show me trace(socket.readInt()); 872415232 If i send 872415232, flash show 52.Why? And how it fix?

View 1 Replies

Flex :: 9scalling Is Not Working At Runtime (although Working In Flash)?

Jul 10, 2010

I created a 9-scalled background in Flash CS5 which is working fine in Flash CS5.But when i imported it as embeded graphic in Flex, and change dimensions in runtime, 9-scalling doesnt work.Here is my code.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]....

View 1 Replies

ActionScript 3.0 :: Error #2048 Socket Security Sanbox Error While Policy Server Is Working

Jun 9, 2011

I have an application that connects to a binary socket server running on port 2234. I use the python policy file server, which I downloaded from [URL], which runs on port 843. If the client app is trying to connect to a socket I can see that the server is receivng the request for a policy file and that it sends it to the client. However, in the client, I get a security sandbox error. How is this possible? And is it possible to check whether the client really received the policy file? BTW, here is my policy file:

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>

View 3 Replies

Flash :: Flex - Net.Socket "complete Event"

May 31, 2011

Is there any way to know if data is completely received on the other end of a flash.net.Socket? Like a complete event? Based on the event documentation there is none. If there is no way, what are the alternative strategies?

View 1 Replies

Flash :: Instantiating A AMF PHP Class Not Working

Jul 9, 2010

I am trying to use AMF PHP to pass variables to a flash file, thus far I cannot see anything wrong with my code, but I have very little experience with creating classes, so here it goes, here is my code,

index.php:

<?php
include "amfphp/services/flashMe.php";
$session = true;

[Code].....

Flash is looking for the flashMe class and the push method within that class, but I keep getting null variables in my flash file when I run it

View 3 Replies

AS2 :: Flash - Simple Class Not Working?

Jul 1, 2011

So I'm trying to learn to create a public class, and this is what is in my class file:

class com.RCN.Menu.Menu{
public var title:String;
public var menuItems:Array;

[code]....

and in a seperate SWF I use the code:

import com.RCN.Menu.Menu;
var Accountability:Menu = createMenu("hello",[a,b,c,d]);
trace(Accountability);

yet Accountability traces as undefined?

View 1 Replies

Flex :: Cannot Connect To Socket In Same Domain

Dec 30, 2010

I have a Flex web app (compiled to regular SWF) that tries to connect to a (binary, not XML) socket on its own server. So if the swf is at [URL], the socket is [URL] This should be possible, AFAIK, but when I try to connect I get a security error saying that [URL] cannot access [URL]. Even though it shouldn't be needed, I also have a crossdomain.xml file containing

[Code]...

View 2 Replies

Java :: When To Use Socket And When To Use XMLSocket In Flex

May 18, 2011

In what situations should i use Socket class or XMLSocket when trying to connect from Flex to a Java Server that is going to listen to a port?

View 1 Replies

ActionScript 3.0 :: Flex PHP Socket Server

Nov 28, 2008

I want to test a simple PHP socket server with Flex, server seems to work fine when trying to test using telnet, but Flex doesn't display any responses, here's my code:[code]

View 4 Replies

Flash :: Calling Function In Other Class Not Working?

Feb 25, 2010

Basically I have a function that is needs to tell 2 other classes to do something. It works for one of the classes: BigPlayButton, but not Background for some reason.TabMenu.as Class functionNote: The function below WILL call the hitPlayCircle function in my BigPlayButton class, but I get an undefined property error for the Background switchTitle function.

private function thumbClick(e:MouseEvent = null):void
{
trace("YOU CLICKED THUMBNAIL: " + e.target.id);

[code].....

View 2 Replies

Image - Flash AS2 - MovieClipLoader Class Not Working?

Feb 3, 2011

I have a problem with loading an image path reference into a movieClip.On my movie loading I attachMovie according to i (no. of instances)Then I generate a copy of the instances (these are prepared ready for print - I have this working)

However, the initial creation of these instances is handled when the Flash movie loads and uses part of the code below to generate thumbnails:

myScroll.content.attachMovie("fav_content", "Stadium"+i, i);
var imgPath = mySharedObject.data["img"+i];
myScroll.content["Stadium" + i].imageLocation = imgPath;

[code]...

The class is called multiple times once then when triggered in a duplicate movieclip but fails somehow - maybe the clue is duplicate tho tried that (duplicateMovieClip..)

View 1 Replies

IDE :: Loader Class Working In Flash, But Not In Browser?

Sep 21, 2009

I'm running into a problem loading an external swf. Check it out here: [URL]

If it's working right, the top and bottom red areas should end up looking exactly the same.

I have "init.swf" loading "cc_home.swf" into a container. When successful, it should fade up (that animation is in "init.swf") and then load the white text (cc_home.swf). What you're seeing on that page is init.swf on top, and cc_home.swf down below.

When I test init.swf directly from Flash, it works fine. In the browser, though, it doesn't load the movie.

Here's the code I'm using in "init.swf" to load cc_home.swf (which I got from Kirupa):

var mycontainer:MovieClip;
var myloader:Loader = new Loader();
var urlrequest:URLRequest = new URLRequest("cc_home.swf")
myloader.load(urlrequest);

[Code]....

View 1 Replies

ActionScript 3.0 :: Flex Socket Communication With C# Produces

Jul 15, 2010

I use C# to read a string (BinaryReader.ReadString()) from the socket stream. But the problem is that flex doesn't writes the string in suitable format, so C# will be able to read that. C# reads a 7 bit encoded integer which indicates the length of the string, and just then reads the string. But flex doesn't writes a string in this format (I use socket.WriteUTF(), and even socket.WriteUTFBytes() didn't work), so C# can't read the string. Here's a little information of how C# reads/writes a string from a socket stream:
[URL]

View 1 Replies

Flex :: Client / Server Messaging (RPC Or Socket)

Apr 9, 2010

I'm building a Flex application, which is going to perform many server requests (let's say, that almost all interactions require an update from server). At the moment I'm using remote procedure calls for it. But I was wondering if using a socket would be better. In other terms, is maybe better to keep the connection alive rather then performing many calls in sequence? For my demo app I only have 1 client. Is the number of clients connecting to the server a factor for this choice?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved