| Package | net.guttershark.control |
| Class | public class DocumentController |
| Inheritance | DocumentController flash.display.Sprite |
By providing any of the following flash var properties, you initiate default functionality.
Available FlashVar Properties:
remotingManager, and initialize these endpoints. The remoting endpoints must be defined in a model file (see net.guttershark.model.Model for examples).FlashVar properties can be declared when running in the Flash IDE by overriding the flashvarsForStandalone()
method. Otherwise you need to put the flashvars on the flash object in HTML.
override protected function flashvarsForStandalone():Object
{
return {model:"model.xml",
initRemotingEndpoints:"amfphp",
sniffCPU:true,
sniffBandwidth:true,
onlineStatus:true
};
}
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("main.swf", "flaswf", "100%", "100%", "9", "#000");
so.addVariable("model","model.xml");
so.addVariable("sniffCPU",true);
so.addVariable("sniffBandwidth",true);
so.addVariable("akamaiHost","http://cp44952.edgefcs.net/");
so.addVariable("onlineStatus",true);
so.addVariable("onlineStatusPingFrequency",120000);
so.addVariable("initRemotingEndpoints","amfphp,rubyamf");
// ]]>
</script>
See the examples in from SVN in "examples/shells" for more examples of using different snippets of the default functionality.
| Property | Defined by | ||
|---|---|---|---|
| flashvars : Object
FlashVars on this movie.
| DocumentController | ||
| Instance : * [static][read-only]
The instance of the site controller.
| DocumentController | ||
| model : XML
The model XML.
| DocumentController | ||
| online : Boolean
Online indicator.
| DocumentController | ||
| queryString : QueryString
A query string object used for deeplink data reading.
| DocumentController | ||
| sharedObject : SharedObject
A shared object for this application.
| DocumentController | ||
| Method | Defined by | ||
|---|---|---|---|
|
Constructor for DocumentController instances.
| DocumentController | ||
|
flushSharedObject():String
A convenience method for flushing the sharedObject property on this
site controller to disk.
| DocumentController | ||
|
startOnlineStatus():void
Start the online status pinging.
| DocumentController | ||
|
stopOnlineStatus():void
Stop the online status pinging.
| DocumentController | ||
| Method | Defined by | ||
|---|---|---|---|
|
akamaiIdentComplete(ip:String):void
A method you can override to hook into the complete event from the akamai
ident hit.
| DocumentController | ||
|
applicationOffline():void
A method you can override to hook into the application offline event.
| DocumentController | ||
|
applicationOnline():void
A method you can override to hook into the application online event.
| DocumentController | ||
|
flashvarsForStandalone():Object
A method you can override when publishing from the flash IDE to provide
a default set of flash vars.
| DocumentController | ||
|
onBandwidthSniffComplete():void
A method you can override to hook into the bandwidth sniff
complete event.
| DocumentController | ||
|
queryStringForStandalone():Dictionary
A method you can override when publishing from the flash IDE to provide
a default set of querystring data.
| DocumentController | ||
|
restoreSharedObject():void
A method you can override to restore a shared object from disk.
| DocumentController | ||
|
setupComplete():void
A method you should override that provides the final hook in the
chain of setup method calls.
| DocumentController | ||
| flashvars | property |
public var flashvars:ObjectFlashVars on this movie.
| Instance | property |
Instance:* [read-only]The instance of the site controller. This will always return the lowest child in a chain of subclasses. If the DocumentController is extended by a class called Main, this would return an instance of Main.
Implementation public static function get Instance():*
| model | property |
public var model:XMLThe model XML. This comes from loading an xml file provided by flashvars.model property.
| online | property |
public var online:BooleanOnline indicator.
| queryString | property |
public var queryString:QueryStringA query string object used for deeplink data reading.
| sharedObject | property |
public var sharedObject:SharedObjectA shared object for this application.
| DocumentController | () | constructor |
public function DocumentController()Constructor for DocumentController instances. This should not be used directly, only subclassed.
| akamaiIdentComplete | () | method |
protected function akamaiIdentComplete(ip:String):void
A method you can override to hook into the complete event from the akamai
ident hit. This will only be called if you provided the akamaiHost
property in flashvars.
You should hook into this for two things.
AkamaiNCManager.FMS_IP = ip;VideoPlayer.iNCManager = "net.guttershark.akamai.AkamaiNCManager";ip:String — The IP that was found from the Ident service.
|
See also
| applicationOffline | () | method |
protected function applicationOffline():void
A method you can override to hook into the application offline event. This is only useful
if you've opted into the onlineStatus flashvar property.
| applicationOnline | () | method |
protected function applicationOnline():void
A method you can override to hook into the application online event. This is only useful
if you've opted into the onlineStatus flashvar property.
| flashvarsForStandalone | () | method |
protected function flashvarsForStandalone():ObjectA method you can override when publishing from the flash IDE to provide a default set of flash vars. This is because flashvars won't exist when publishing from the flash IDE.
ReturnsObject — A generic object with hard coded custom flashvar keys.
|
| flushSharedObject | () | method |
public function flushSharedObject():StringA convenience method for flushing the sharedObject property on this site controller to disk.
ReturnsString — A property from the SharedObjectFlushStatus class.
|
| onBandwidthSniffComplete | () | method |
protected function onBandwidthSniffComplete():voidA method you can override to hook into the bandwidth sniff complete event.
| queryStringForStandalone | () | method |
protected function queryStringForStandalone():Dictionary
A method you can override when publishing from the flash IDE to provide
a default set of querystring data. The custom data get's set on the
queryString property so you can continue to use that property
without worrying about if your in the IDE or not.
Dictionary — A dictionary with deeplink keys and values.
|
| restoreSharedObject | () | method |
protected function restoreSharedObject():voidA method you can override to restore a shared object from disk.
override protected function restoreSharedObject():void
{
sharedObject = SharedObject.getLocal("test");
}
| setupComplete | () | method |
protected function setupComplete():voidA method you should override that provides the final hook in the chain of setup method calls.
If a model file is being loaded, setupComplete will wait to be
called until after the xml is loaded. But will not wait for bandwidth sniff
or akamai ident hits. Use onBandwidthSniffComplete() and akamaiIdentComplete()
| startOnlineStatus | () | method |
public function startOnlineStatus():void
Start the online status pinging. The online status pinging will
start by default if you specify the onlineStatus flashvar
property. This should be used to restart the pinging if you stopped it
at some point.
| stopOnlineStatus | () | method |
public function stopOnlineStatus():voidStop the online status pinging.