Loading SWF and Form Visibility

F-IN-BOX for Delphi / Builder C++ / VCL
Posts: 2
Joined: Fri Jun 24, 2011 3:29 pm

Loading SWF and Form Visibility

Postby eflc » Fri Jun 24, 2011 3:38 pm

Here is what I am doing:
1. Set form Visible to false
2. Load the SWF
3. Once SWF is loaded and ready to display, set form Visible to true

The problem is that when the form has Visible set to false, it doesn't load "properly". For example the constructor of the class does get run, but a Timer which is supposed to send to the app a message once every second doesn't work. It looks as if Events are not fired, until Visible is set to true.

What works is setting Visible to true and then back immediately to false, right after loading the SWF, but it causes flicker and is not a good solution. Is this the intended behaviour or is a flash bug?

An alternative workaround would be to create the flash player on another form which can be set to visible and Top = -10000 to ensure it is off screen. Then, once everything is loaded, to move it to the correct form using aFlashPlayer.Parent = ProperForm. Unortunately, when I do that, all sequential flash calls fail. Is there a correct way to move the Flash Player control from one form/container to another, without reloading the movie?

Thanks in advance for your help. :)

Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg

Postby Softanics » Mon Jul 04, 2011 3:13 pm


What if to create TFlashPlayerControl with Left := -1, Top := -1 and Width := 0, Height := 0. Once movie is loaded, just change the size.

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

Return to “Delphi / Builder / VCL Edition”

Who is online

Users browsing this forum: No registered users and 4 guests