CreateArgs(Name: String; Args: String);
CreateArgs(Name: string; Args: string);
Name. Name of the command called from Flash movie.
Args. String argument of the command called from Flash movie.
The CreateArgs method creates arguments to pass them to the specified handler processing Flash movie events.
An SWF movie used by a Flash object should be formed specifically taking into account its work via FsCommand.
To execute the example, create a unit with the Module identifier (the Message procedure, add links to the Ui, Tab, and Report system assemblies):
Public Sub Message(Flash: IPrxFlash; Args: IPrxFlashFSCommandEventArgs);
Begin
WinApplication.InformationBox((Flash As ITabObject).Id + " : " + Args.Name + " = " + Args.Arguments);
End Sub Message;
Create a regular report with the Report identifier, then add a Flash object, which uses SWF movie supporting fscommand. Add the created unit to report units.
Create a form, add the Button1 button and 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 Forms, Metabase, Report, Tab, Ui system assemblies.
Class TestForm: Form
UiReport1: UiReport;
ReportBox1: ReportBox;
Button1: Button;
m_Rep: IPrxReport;
m_Fl: IPrxFlash;
Sub TestFormOnCreate(Sender: Object; Args: IEventArgs);
Begin
m_Rep := MetabaseClass.Active.ItemById("Report").Edit As IPrxReport;
UiReport1.Instance := m_Rep;
m_fl := (m_Rep.ActiveSheet As IPRxTable).TabSheet.Objects.Item(0).Extension As IPrxFlash;
m_fl.FSCommandAction := "Module.Message";
End Sub TestFormOnCreate;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
a: IPrxFlashFSCommandEventArgs;
Begin
a := New PrxFlashFSCommandEventArgs.Create;
a.CreateArgs("New FS", "New FS Arguments");
m_fl.DoFSCommandAction(a);
End Sub Button1OnClick;
End Class TestForm;
Clicking the button displays a message containing the name of the generated command and values of its arguments.
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. Add links to the Forms.Net, Metabase, Report, Tab system assemblies.
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
a: PrxFlashFSCommandEventArgs;
Begin
a := New PrxFlashFSCommandEventArgs.Create();
a.CreateArgs("OnClick New FS", "New FS Arguments");
m_fl.DoFSCommandAction(a);
End Sub;
Private Sub OBJ65120Form_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.FSCommandAction := "Module.Message";
End Sub;
Clicking the button displays a message containing the name of the generated command and values of its arguments.
See also: