directx click

The directx object for mac flash does not have an onclick event. How would i make it act as on click ?

procedure TForm1.ShockwaveFlash1click(Sender: TObject);
begin
 SHOWMESSAGE('ddHI');
end;

doesnt work as there is no such event...

966Asked:
Who is Participating?
 
epasquierConnect With a Mentor Commented:
aaaahhhh ok !!!
That's not DirectX but ActiveX (one as nothing to do with the other).

Ok, once you have imported the activeX, you have a ShockwaveFlashObjects_TLB.pas file that you can alter to add support for the OnClick property (adding a windows message manager for the left mouse button up event)
Then recompile the package where yo put that imported unit, the OnClick event will appear (and work) in your project

I give you the modified file (imported with Delphi7)

If you have to do it for other Delphi versions, here are the mods I did :
// in interface
Uses ..., Messages; // Need to add Messages unit

  TShockwaveFlash = class(TOleControl)
   private
...
    FOnClick : TNotifyEvent; // HERE I ADDED THE EVENT PRIVATE MEMBER
...
  protected
// That is my simple button UP event message handler. 
// I don't manage DOWN/UP evts for all mouse buttons, just Left UP = Click
    procedure WMLButtonUp(var Message: TWMLButtonUp); message WM_LBUTTONUP;
...
  published
...
// This is my published property
    property  OnClick:TNotifyEvent read fOnClick write fOnClick;
...
  end;


// in implementation :

procedure TShockwaveFlash.WMLButtonUp(var Message: TWMLButtonUp);
begin
 if Assigned(FOnClick) Then FOnClick(Self);
end;

Open in new window

ShockwaveFlashObjects-TLB.pas
0
 
epasquierCommented:
can you tell us more about this directX / shockwave object ? where can we find it ? is it free or trial ?
0
 
966Author Commented:
i downloaded mac flash, then went to install directx component. Then found mac flash. Then it installed a component to direct X.
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
966Author Commented:
when i say it installed a component to directx i mean the directx tab.
0
 
epasquierCommented:
you're not very clear.
where do you downloaded that ?
0
 
966Author Commented:
I just followed that site, but there is no onclick event in the component installed,

http://delphi.about.com/od/graphics/l/aa040103a.htm
0
 
966Author Commented:
THANKYOU very much mate, but i get a problem when i try to install it like i normally do.

double click it, install component, then click install. Gives error: Its not a valid identifer
0
 
epasquierCommented:
you tend to be sloppy in the descriptions of your problems. In this case :

What invalid Indentifier ?
Which Delphi version ?
In my file ?
What line ?
0
 
966Author Commented:
incomplete. but works
0
All Courses

From novice to tech pro — start learning today.