• 0

[DELPHI7] Flash player controll...


Question

Hi,

I am making a little "virtual pet" game for my brother and sister. I have been using the tflashplayer controll to display the flash movies but the component is shockwave flash version 1 and therefore does not support transparent stuff, like the shine in my bald pets head.

Is there a free alternative that supports transparency?

Thanks for helping.

ps. im on holiday for a week to ill check this again when i get back (so i wont reply to anything that fast!)

theres what it looks like:

:cry:

Link to comment
https://www.neowin.net/forum/topic/482720-delphi7-flash-player-controll/
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  ShokX said:

Hi,

I am making a little "virtual pet" game for my brother and sister. I have been using the tflashplayer controll to display the flash movies but the component is shockwave flash version 1 and therefore does not support transparent stuff, like the shine in my bald pets head.

Is there a free alternative that supports transparency?

Thanks for helping.

ps. im on holiday for a week to ill check this again when i get back (so i wont reply to anything that fast!)

theres what it looks like:

:cry:

May be this article can help you:

To make use of SWF files in your Delphi application you should have the swf plugin installed then follow these steps:

In the Delphi IDE

- click on "Component", "Import ActiveX Control"

- chose "Shockwave Flash" and click on "install".

Now you have a TShockwaveFlash component in your IDE on the ActiveX tabsheet. Place the TShockwaveFlash Component onto your form, resize it as needed but for now do not assign a movie to it.

You will need to register the ocx file if it is not installed on the target computer. So you should have a resource file with

- the swflash.ocx and your Flash ( *.swf) file.

- Copy swflash.ocx (from i.e. windows\system32\macromed\flash) and your custom swf file to your project path.

- Create a textfile with a code like this:

SHOCKWAVEFILE RCDATA yourfile.swf

SHOCKWAVEOCX RCDATA swflash.ocx

(Where yourfile.swf is your swf-file)

- Save this file as flash.rc

- Goto Commandline, change to your project dir and enter the line:

"Brcc32 -r flash.rc"

- Now you have your new resource as flash.res file

uses

ShockwaveFlashObjects_TLB; // will be used automatically

implementation

{$R *.DFM}

{$R flash.res} // your new created resource

{...}

procedure TForm1.FormCreate(Sender: TObject);

var

SystemDir: array[0..MAX_PATH] of Char;

SWFDir, AppDir: string;

Fres: TResourceStream;

Ffile: TFileStream;

begin

GetSystemDirectory(@SystemDir, MAX_PATH);

SWFDir := SystemDir + '\macromed\flash\';

GetDir(0, AppDir); // Get current directory

//check whether the sw-flash ocx is already installed

if FileExists(SWFDir + 'swflash.ocx') = False then

begin

//create directories if needed and extract file from resource.

{$i-} //compiler directive to suppress i/o error messages

MkDir(SystemDir + '\macromed');

MKDir(SystemDir + '\macromed\flash');

{$i+}

Fres := TResourceStream.Create(0, 'SHOCKWAVEOCX', RT_RCDATA);

Ffile := TFileStream.Create(SWFDir + 'swflash.ocx', fmCreate);

Ffile.CopyFrom(Fres, Fres.Size);

Fres.Free;

Ffile.Free;

//register ocx (simple but useful)

WinExec(PChar('regsvr32 /s ' + SWFDir + 'swflash.ocx'), SW_HIDE);

end;

// extract ShockwaveFile from resource to application directory

Fres := TResourceStream.Create(0, 'SHOCKWAVEFILE', RT_RCDATA);

Ffile := TFileStream.Create('flashmovie.swf', fmCreate);

Ffile.CopyFrom(Fres, Fres.Size);

Fres.Free;

Ffile.Free;

//Assign the extracted swf file to your TShockwaveFlash object

FlashMovie.Movie := AppDir + '\flashmovie.swf';

end;

(*

If you dont want to have the popup menu displayed on right click

you may chose menu property of TShockWave to false.

*)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Larry likes animals.  Mommy acts sh!t
    • vPro is a platform that has features aimed at companies, remote management, security, threats detection, drivers that are stable for 15 months, and many other things. And this includes Core, Core Ultra (which are excellent), and a set of Xeon. And this exists for years, and a Intel platform also includes networking Ethernet and WiFi (this requires years of development), a host of security features, power management, storage technologies, This does not exist in such a complete and coherent platform at AMD… And. please, no Windows 10 PC is going to turn into dust in a second, there is 3 years of extended support… for old laptops, there is no reason not to switch, and that backup feature is unrelated.
    • When will the US stop the monster ? They ###### everyone, customers, victims, employees, all the suppliers: the story behind every hw parts is the same, acquired, outsourced, but poaching employees is the cheapest way. The narrative arcs from the last 15 years, all partially or entirely deceptive: security (they stopped with that one, not sustainable), privacy, with the secure cloud ahah, the local AI ahah, selling the user base to Google, ahah, that’s the privacy you will enjoy. Innovations, it became a running gag, when everything is average and years late. The competition: on macOs all their crappy services, 20 apps, that you cannot even hide. They have business practices that no other company could adopt, they would be sued, Apple, on a pedestal for being the greatest parasite company (they capture a lot of wealth, give nothing back, except tens of billion in buybacks every year). Ah, the M socs, they hit a wall (long ago) and still market them as having AAA gaming abilities, they do not, one more fraud. At least there is some fun, Apple building fabs in cooperation with TSMC… ahahahah how are they involved ? Catering ? They provide the cloths ? It’s really sad to see that in the US corruption and mediocrity have reached a level so that companies like Apple or Tesla are getting so much help and support from the administrations, and other entities… that they do not even try to hide today. I wonder when will we know how much the news outlets are being paid to regurgitate anything Apple wants.. This is decay and it’s ugly.
    • it might be a work or school thing. at my work, a disclaimer pops up stating that "you should use google chrome or edge for the best possible experience." at my school, the disclaimer says just to use google chrome. i'm sure a lot of IT guys just want to make it easy and tell employees to use google chrome because of the apparent trends in web developers testing and all. i'm sure that can have big ramifications on browser usage for average users since "if my IT dep permits it, then it's good". i liked that my work also stated Edge, but i've seen "use google chrome" a lot more without mentioning edge. matter of fact, my employer removed firefox from all devices.
  • Recent Achievements

    • Week One Done
      Ricky Chan earned a badge
      Week One Done
    • Week One Done
      maimutza earned a badge
      Week One Done
    • Week One Done
      abortretryfail earned a badge
      Week One Done
    • First Post
      Mr bot earned a badge
      First Post
    • First Post
      Bkl211 earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      483
    2. 2
      +FloatingFatMan
      263
    3. 3
      snowy owl
      240
    4. 4
      ATLien_0
      227
    5. 5
      Edouard
      188
  • Tell a friend

    Love Neowin? Tell a friend!