Page 1 of 1

Loading SWF and Form Visibility

Posted: Fri Jun 24, 2011 3:38 pm
by eflc
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. :)

Posted: Mon Jul 04, 2011 3:13 pm
by Softanics
Hello,

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.