[Flashcoders] Testing online and offline

2008-03-19 Thread Helmut Granda
I am testing an application extensibly localy and on the server,
there are just a comple of methods that I want them to run locally but they
need to be user initiated when running on the server.

At the moment if I post the files to the server then I comment out the
automatic calls and so forth...

I started testing the ApplicationDomain and
ApplicationDomain.currentDomain but that still turns undefined off line and
online...

// just for testing purposes:
import flash.system.ApplicationDomain;
this.applicationDomain = ApplicationDomain.currentDomain
trace(this.currentDomain );

any ideas of a different implementation or a different class that I
should be using?

I know there is a way to get the domain address
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Testing online and offline

2008-03-19 Thread Matthew Houliston

On 19/03/2008 20:28, Helmut Granda wrote:


I started testing the ApplicationDomain and
ApplicationDomain.currentDomain but that still turns undefined off line and
online...

// just for testing purposes:
import flash.system.ApplicationDomain;
this.applicationDomain = ApplicationDomain.currentDomain
trace(this.currentDomain );



ApplicationDomain isn't related to the server hostname - it's for 
managing classes in external swf files.


You can get the current hosting address with
trace(root.loaderInfo.loaderURL);


Even better, IMO, you can check system.Capabilities.playerType to see 
if it's running locally:


import flash.system.Capabilities;

trace(Capabilities.playerType); // 'External', when running in the IDE



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders