IPrxFlashCallEventArgs.CreateArgs

Fore Syntax

CreateArgs(Name: String; Args: String);

Fore.NET Syntax

CreateArgs(Name: string; Args: string);

Parameters

Name. Name of the command called from Flash movie.

Args. String argument of the command called from Flash movie.

Description

The CreateArgs method creates arguments to pass them to the specified function of Flash movie handler.

Comments

An SWF movie used by a Flash object should be generated specifically taking into account its work via ExternalInterface.

Fore Example

To execute the example, create a unit with the Module identifier (the Message procedure, add links to the Ui, Tab, and Report assemblies):

Public Sub Message(Flash: IPrxFlash; Args: IPrxFlashCallEventArgs);
Var s: string;
    i: integer;
    j: integer;
    a: array;
Begin
    If Args.Arguments <> Null Then
        For i := 0 To Args.Arguments.Length - 1 Do
            If Args.Arguments[i] Is array Then
                a := Args.Arguments[i] As array;
                For j := 0 To a.Length - 1 Do
                    s := s + (a[j] As String) + (j < a.Length - 1 ? ", " : "; ");
                End For;
            Else
                s := s + (Args.Arguments[i] As String) + (i < Args.Arguments.Length - 1 ? "; " : "");
            End If;
        End For;
    End If;
    WinApplication.InformationBox((Flash As ITabObject).Id + " : " + Args.Name + " = " + s);
End Sub Message;

Create a regular report with the Report identifier, then add a Flash object which uses SWF movie supporting ExternalInterface. Add the created unit to report units.

Create a form, add the Button1 button to the form, the ReportBox component named ReportBox and the UiReport component named UiReport1. Describe the OnClick event for Button1 and the OnCreate event for the form. Add links to the Metabase, Report, Tab, Forms, Forms.Net (for Fore.NET example) system assemblies.

Class TestForm: Form
    UiReport1: UiReport;
    ReportBox1: ReportBox;
    Button1: Button;
    
    m_Rep: IPrxReport;
    m_Fl: IPrxFlash;

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var a: IPrxFlashCallEventArgs;
    ar: array Of variant;
Begin
    ar := New Variant[2];
    ar[0] := 0;
    ar[1] := "qwe";
    a := New PrxFlashCallEventArgs.Create;
    a.CreateArgs("New Call", ar);
    m_fl.DoFlashCallAction(a);
End Sub Button1OnClick;

Sub TestFormOnCreate(Sender: Object; Args: IEventArgs);
Begin
    m_Rep := MetabaseClass.Active.ItemById("OBJ36163").Edit As IPrxReport;
    UiReport1.Instance := m_Rep;
    m_fl := (m_Rep.ActiveSheet As IPRxTable).TabSheet.Objects.Item(0).Extension As IPrxFlash;
    m_fl.FlashCallAction := "Module.Message";
End Sub TestFormOnCreate;
End Class TestForm;

Clicking the button displays a message containing the name of the generated command and values of its arguments.

Fore.NET Example

To execute the example, create a unit and a regular report as described in the previous example. Fore.NET event handlers are not supported, as user macros in .NET units and .NET forms are described within a class.

Create a .NET form, add the Button1 button to the form, the ReportBoxNet component and the UiReportNet component named UiReportNet1 that is a data source for ReportBoxNet. Describe the Click event for Button1 and the Activated event for the form.

Imports System.Collections.Generic;
Imports System.ComponentModel;
Imports System.Data;
Imports System.Drawing;
Imports System.Text;
Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.NET;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;

Public Partial Class OBJ36179Form: Prognoz.Platform.Forms.NET.ForeNetForm
    m_Rep: IPrxReport;
    m_Fl: IPrxFlash;
        
Public Constructor OBJ36179Form();
Begin
    InitializeComponent();
End Constructor;

Private Sub OBJ36179Form_Activated(sender: System.Object; e: System.EventArgs);
Begin
    m_Rep := Self.Metabase.ItemById["Report"].Edit() As IPrxReport;
    uiReportNet1.ReportUi.Report := m_Rep;
    m_fl := (m_Rep.ActiveSheet As IPRxTable).TabSheet.Objects.Item[0].Extension As IPrxFlash;
    m_fl.FlashCallAction := "Module.Message";
End Sub;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    a: PrxFlashCallEventArgs;
    ar: array Of object;
Begin
    ar := New Object[2];
    ar[0] := 0;
    ar[1] := "qwe";
    a := New PrxFlashCallEventArgs.Create();
    a.CreateArgs("New Call", ar);
    m_fl.DoFlashCallAction(a);
End Sub;
End Class;

Clicking the button displays a message containing the name of the generated command and values of its arguments.

See also:

IPrxFlashCallEventArgs