Dynamic rich media component for ASP.Net Flash, Video and Audio controls for C# and VB.Net

ActionSpeak™ Object Reference:  ActionScript API

The ActionSpeak™ API for ActionScript becomes available by Installing ActionSpeak™ into your Flash Movie.

After copying ActionSpeak™ into the first frame of your FLA, these functions become immediately available.

 

ActionScript Talking to ASP.NET


Triggering Events

ActionSpeak.FormPostBack(commandName, argument)
(ASP.NET 2.0+ Only)

Allows ActionScript to call .NET code via a postback.

Fires an ASP.NET ActionScriptEvent in the ASPNetFlash Object. This Event is created by double clicking on the ASPNetFlash control in Design View, or by adding it using the event editor (lightning symbol) in the Properties Panel.

The commandName and argument strings are passed from ActionScript to the .NET event.

 

DataBinding

ActionSpeak.XML

ActionScript XML object containing all of the data from the ASPNetFlash WebControl's DataSource.

ActionSpeak.Recordset

If the ASPNetFlash WebControl's DataSource is an SQL or Access database, the DataBinding is available to ActionScript as a RecordSet object.

The RecordSet is accessed using ActionSpeak.Recordset.Records[index][fieldName]

The field names are listed in the array ActionSpeak.Recordset.Fields

 

ActionScript Calling JavaScript


ActionSpeak.CallJavaScript(expression)

Executes any JavaScript expression. This can include function calls, function declarations, getting variables and setting variables.

The return values of the expression are passed back into ActionScript.

 

Speaking with other Flash Movies


ActionSpeak.Remote.Target

This property sets a target ASPNetFlash WebControl to be remote controlled. The value should be set to match the runtime id property (ClientId) of the target ASPNetFlash WebControl e.g. "Flash1"

This property must be set before any other ActionSpeak.Remote functions can be called.

ActionSpeak.Remote. CallFlashFunction
(functionName [, param1][,param 2][...])

Calls any function in Target movie clip. The first parameter is the function name and path.

Any number of further arguments can be appended to add arguments to the function call.

e.g.:ActionSpeak.Remote.CallFlashFunction("_root.gotoAndStop",1)

ActionSpeak.Remote. SetFlashVariable (expression, value)

Sets the value of any variable or property in the target Flash Movie.

e.g.: ActionSpeak.Remote.SetFlashVariable ("_root.text", "Hello World")

ActionSpeak.Remote. GetFlashVariable (expression)

Returns the value of any variable or property in the target Flash Movie.

e.g.: var retVal = ActionSpeak.Remote.GetFlashVariable ("_root.text");

 

Speaking with the Web Page


Web Forms

ActionSpeak.SetFormValue(id,value)

Sets the value of an form field on the ASPX web page. Typically this such as a TextBox or HiddenField.

The id attribute should match the ClientId (runtime id property) of the control.

ActionSpeak.GetFormValue(id) Returns the value of an form field on the ASPX web page to ActionScript.

The id attribute should match the ClientId (runtime id property) of the control.

 

Cookies

ActionSpeak.SetCookie (name,value)

Sets or creates a named cookie and stores data there for later use.

This data is then available site-wide, and persists on return visits.

ActionSpeak.GetCookie(name)

Returns the value of a named cookie.

 

Manipulating the Flash Object

ActionSpeak.Float(style)

Causes the Flash Movie to float above other objects on the web page in a movable, transparent layer. The object will be moved to the top of the HTML page - over other HTML and Flash content.

Possible values of style are:

absolute - MoveTo uses absolute co-ordinates. The page collapses to fill the empty space.

relative - MoveTo uses relative co-ordinates which may be negative.

none - Ends the Float behavior.

ActionSpeak.MoveTo(x,y)

Moves the floating Flash Movie to the specified coordinates.
x and y can be defined in "px"(default) or "%".

ActionSpeak.ResizeTo (width, height) Resizes the Flash movie in the HTML.  width and height can be defined in pixels(default) or percentages.
ActionSpeak.LoadSWF(url) Loads a new SWF, replacing the existing content. The url is relative to the ASPX page, and cannot contain the tilde ("~/") expression.

 

Speaking with the Persistent State Objects


ViewState

ActionSpeak.SetViewState(value)

Saves a ViewState string for the Flash Movie. This string remains constant for a Flash Movie - even after page reloads and postbacks.

The ViewState is particularly useful to save variables such as the current frame of the Flash Movie to allow persistence after the page reloads reload.

ActionSpeak.GetViewState() Retrieves the ViewState value saved using ActionSpeak.SetViewState.

 

SessionState

ActionSpeak.SetSessionState(key,value)

Saves a key/value pair into the ActionSpeak SessionState object for later retrieval. This data persists across all Flash movies on the website, even upon return visits.

ActionSpeak.GetSessionState(key) Retrieves the SessionState value saved to a ActionSpeak.SetViewState key.

 

Speaking with the Live Debugger


ActionSpeak.Trace(message)

Sends a trace action to both the Flash output window, and the live Debugger window. Replaces the traditional trace() function.

ActionSpeak.ListVars Returns a string analogous the the Flash debugger action "List Variables".
ActionSpeak.ListObjects Returns a string analogous the the Flash debugger action "List Objects ".
ActionSpeak.ListGlobalVars Returns a string detailing the contents of the _global Flash context.
ActionSpeak.ListActionSpeak Returns a string detailing the ActionSpeak ActionScript object.