XMLSocket problems in mtasc (using SOS)

View: New views
8 Messages — Rating Filter:   Alert me  

Parent Message unknown XMLSocket problems in mtasc (using SOS)

by Marlin Mixon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,
 
I'm Marlin and I'm new to the list.
 
Trying to get SOS to work in mtasc.  I can get SOS to respond using plain old flash with the following three lines:

  var sock = new XMLSocket();
  sock.connect("localhost",4444);
  sock.send("Hello World");
 
When the swf launches, it writes Hello World to SOS.  When I build these same lines into a class like this:
 
/**
* ...
* @author Default
* @version 0.1
* @mtasc -swf D:\Junk\TestSOS.swf -mx -main
*/
class TestSOS {
 static function main() {
  _root.inText.text = "in main";
  var sock = new XMLSocket();
  sock.connect("localhost",4444);
  sock.send("Hello World");
 }
 
}
 
I know I get to main because my text field inText gets populated with "in main" but SOS does not do a thing.  My environment: Flash 8 IDE->swf->Flash Develop->injected swf.
Any Ideas?   Thanks!
 
Marlin


Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now!
--
MTASC : no more coffee break while compiling

Re: XMLSocket problems in mtasc (using SOS)

by ekameleon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello :)

you must wait the connection with the onConnect callback if you want send a message in the socket server :)

If you want use a easy log tool with SOS you can use my opensource framework VEGAS and this log model based AS3 mx.logging implementation (work in AS2/AS3/SSAS)

Install my framework : http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN

Tutorial (in progress)
http://code.google.com/p/vegas/wiki/VegasTutorialsLogging

Example with the SOS console :


import vegas.logging.ILogger ;

import vegas.logging.ITarget ;
import vegas.logging.Log ;
import vegas.logging. LogEvent ;
import vegas.logging .LogEventLevel ;

import vegas. logging.targets.SOSTarget ;

// 1 - Creates the ITarget reference of the application

var sosTarget:SOSTarget = new SOSTarget() ;

// 2 - Setup the attributes of the ITarget reference.

sosTarget
.filters = [ "vegas.logging.*" ] ;

sosTarget.includeDate = true ;
sosTarget .includeTime = true ;
sosTarget.includeLevel = true ;
sosTarget.includeCategory = true ;
sosTarget. includeLines = true ;

sosTarget .level = LogEventLevel. ALL ;

// 3 - Register the ITarget reference in the Log static manager class.

Log .addTarget( traceTarget ) ;

// 4 - Dispatch the log messages in your application.

var logger: ILogger = Log.getLogger( "vegas.logging.test") ;

logger
.log ( LogEventLevel.DEBUG, "here is some debug message : {0} and {1}" , 2.25 , true) ;

logger
.info( "here is some information : {0} and {1}", 2.25 , true) ;

logger
. fatal("here is some fatal error.") ;

logger
.error("here is some error.") ;

You can find the SOSTarget class in the SVN repository of my framework :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/vegas/logging/targets/SOSTarget.as

PS : my target with the SOS console contains lots of feature (change the color of the log levels, bufferize the message if you send a log message before the XMSSocket connection etc..

EKA+ :)



2007/10/18, Marlin Mixon <marlin_mixon@...>:

Hi,
 
I'm Marlin and I'm new to the list.
 
Trying to get SOS to work in mtasc.  I can get SOS to respond using plain old flash with the following three lines:

  var sock = new XMLSocket();
  sock.connect("localhost",4444);
  sock.send("Hello World");
 
When the swf launches, it writes Hello World to SOS.  When I build these same lines into a class like this:
 
/**
* ...
* @author Default
* @version 0.1
* @mtasc -swf D:\Junk\TestSOS.swf -mx -main
*/
class TestSOS {
 static function main() {
  _root.inText.text = "in main";
  var sock = new XMLSocket();
  sock.connect("localhost",4444);
  sock.send("Hello World");
 }
 
}
 
I know I get to main because my text field inText gets populated with "in main" but SOS does not do a thing.  My environment: Flash 8 IDE->swf->Flash Develop->injected swf.
Any Ideas?   Thanks!
 
Marlin


Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now!

--
MTASC : no more coffee break while compiling


--
MTASC : no more coffee break while compiling

RE: XMLSocket problems in mtasc (using SOS)

by Marlin Mixon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.



Unbelievable!  It works in mtasc using SOS.  Thanks EKA. 
The installation of TortoiseSVN and Vegas was a bit slow and suprisingly large (35 MB for Vegas)
 
BTW in your example, I changed:
Log.addTarget( traceTarget ) ;
to
Log.addTarget( sosTarget ) ;
 
Somehow I found the correct classpath and added that to FlashDevelop and then the build went cleanly.  It looks like Vegas assumes your SOS is at localhost on 4444 which is fine for now and probably 95% of most uses.
 
Marlin
 


Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare! Try now!
--
MTASC : no more coffee break while compiling

Re: XMLSocket problems in mtasc (using SOS)

by ekameleon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello :)

Yes VEGAS is big beacause there are 3 versions of the framework (AS2/AS3/SSAS) and with this versions you can find the examples, unit tests, documentation etc...

Sorry for the little error in the example but you can find in the AS2/trunk/bin/test/vegas/logging directory of the SVN repository the example to use my logging implementation :)

PS : When i don't use the SOS Console, i use the FlashInspector abd the vegas.logging.target.LuminicTarget class (see the AS2/trunk/tools directory to test it). You can use too the FireBugTarget class ... or create your custom target class with the ITarget interface and if you extends your custom class with the LineFormatterTarget class.

EKA+ :)

2007/10/18, Marlin Mixon <marlin_mixon@...>:



Unbelievable!  It works in mtasc using SOS.  Thanks EKA. 
The installation of TortoiseSVN and Vegas was a bit slow and suprisingly large (35 MB for Vegas)
 
BTW in your example, I changed:
Log.addTarget( traceTarget ) ;
to
Log.addTarget( sosTarget ) ;
 
Somehow I found the correct classpath and added that to FlashDevelop and then the build went cleanly.  It looks like Vegas assumes your SOS is at localhost on 4444 which is fine for now and probably 95% of most uses.
 
Marlin
 


Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare! Try now!

--
MTASC : no more coffee break while compiling


--
MTASC : no more coffee break while compiling

RE: XMLSocket problems in mtasc (using SOS)

by Marlin Mixon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

On the SOS website the FAQ says:

 

-----------------

How can I debug from an external server?

 

Take the IP from the SOS Computer as Host for your XMLSocket.
With Flash as Client, a local Web server is necessary. The CrossDomainPolicy - XML file must admit the external server. Host must be "localhost".

 

-----------------

 

I think this is what I'm trying to do.  I'm hosting the swf on a remote server, but when I run the SWF, SOS communication fails. 

 

The solution given, doesn't make sense where it says: With Flash as Client, a local Web server is necessary.  I'm somewhat familiar with CrossDomainPolicy files, but I'm not sure what they are suggesting as far as setting up a local Web Server.  Any Ideas?

 

Thanks.

 

Marlin

 


Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it now!
--
MTASC : no more coffee break while compiling

Interpreting Flash Player Debugger messages

by Marlin Mixon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,
 
I'm trying to interpret the runtime messages I'm getting from the Flash Player Debugger.  I'm getting messages that seem to suggest my installation is sick, rather than the code I've written.
 
The error messages I'm receiving are:
 
Warning: addEventListener is not a function
Warning: addEventListener is not a function
Warning: createAccessibilityImplementation is not a function
Warning: _endInit is not a function
Warning: Reference to undeclared variable, 'UIComponent'
Warning: 'UIComponent' has no property 'prototype'
Warning: 'prototype' has no property 'clipParameters'
Warning: 'mx' has no property 'setDataProvider'
Warning: 'mx' has no property 'getDataProvider'
Warning: 'mx' has no property 'addItem'
Warning: 'mx' has no property 'addItemAt'
   :    
   :
 
My environment is Windows, FlashDevelop, flashplayer_9_ax_debug.exe.  I'm using MX V2 components and I'm starting with an existing swf and having mtasc compile and inject (must be a more elegant way to describe that).  Anyway, the error messages I'm getting look to me like some MM libraries are missing.
 
Any suggestions on what to check or change?  I'm able to cleanly build using mtasc.
 
Thanks!
 
Marlin Mixon

 


Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power. Play Now!
--
MTASC : no more coffee break while compiling

Re: Interpreting Flash Player Debugger messages

by Alias™-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

These are general errors created by the UI component code. The older
MX libraries are not written to the same strict standards as MTASC
enforces. They're basically harmless.

Alias

On 21/10/2007, Marlin Mixon <marlin_mixon@...> wrote:

>
>
> Hi,
>
>  I'm trying to interpret the runtime messages I'm getting from the Flash
> Player Debugger.  I'm getting messages that seem to suggest my installation
> is sick, rather than the code I've written.
>
>  The error messages I'm receiving are:
>
>  Warning: addEventListener is not a function
> Warning: addEventListener is not a function
> Warning: createAccessibilityImplementation is not a
> function
> Warning: _endInit is not a function
> Warning: Reference to undeclared variable, 'UIComponent'
> Warning: 'UIComponent' has no property 'prototype'
> Warning: 'prototype' has no property 'clipParameters'
> Warning: 'mx' has no property 'setDataProvider'
> Warning: 'mx' has no property 'getDataProvider'
> Warning: 'mx' has no property 'addItem'
> Warning: 'mx' has no property 'addItemAt'
>     :
>     :
>
>  My environment is Windows, FlashDevelop, flashplayer_9_ax_debug.exe.  I'm
> using MX V2 components and I'm starting with an existing swf and having
> mtasc compile and inject (must be a more elegant way to describe that).
> Anyway, the error messages I'm getting look to me like some MM libraries are
> missing.
>
>  Any suggestions on what to check or change?  I'm able to cleanly build
> using mtasc.
>
>  Thanks!
>
>  Marlin Mixon
>
>
>
> ________________________________
> Climb to the top of the charts!  Play Star Shuffle:  the word scramble
> challenge with star power. Play Now!
> --
> MTASC : no more coffee break while compiling
>

--
MTASC : no more coffee break while compiling

Re: XMLSocket problems in mtasc (using SOS)

by Sšönke Rohde :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marlin Mixon wrote:

>
> On the SOS website the FAQ says:
>
>  
>
> -----------------
>
> How can I debug from an external server?
>
>  
>
> Take the IP from the SOS Computer as Host for your XMLSocket.
> With Flash as Client, a local Web server is necessary. The
> CrossDomainPolicy - XML file must admit the external server. Host must
> be "localhost".
>
>  
>
> -----------------
>
>  
>
> I think this is what I'm trying to do.  I'm hosting the swf on a
> remote server, but when I run the SWF, SOS communication fails.
>
>  
>
> The solution given, doesn't make sense where it says: With Flash as
> Client, a local Web server is necessary.  I'm somewhat familiar with
> CrossDomainPolicy files, but I'm not sure what they are suggesting as
> far as setting up a local Web Server.  Any Ideas?
>
>  
>
> Thanks.
>
>  
>
> Marlin
>
>      
>
>
> ------------------------------------------------------------------------
> Windows Live Hotmail and Microsoft Office Outlook – together at last.
> Get it now!
> <http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033>
Hi Martin,
you need the local webserver with the crossdomain.xml in the root
because SOS connects to localhost and as the remote swf is requested
this is crossdoman. For that purpose the crossdomain.xml on the
localhost is needed.

Cheers,
Sönke

--
MTASC : no more coffee break while compiling