How to reload the same swf file and play again?

.NET Edition of the F-IN-BOX
doubletw
Posts: 4
Joined: Thu Jan 14, 2010 8:17 am

How to reload the same swf file and play again?

Postby doubletw » Mon May 24, 2010 3:48 am

Hi Sir,

I use FlashMethod_LoadMovie() to load a swf file, and then the swf file will send a FS-Command to f_in_box__form automatically.

After executing FlashMethod_LoadMovie() and getting the FS-Command, I can receive the FS-Command again if I execute FlashMethod_LoadMovie() to load another duplicate swf file.

However, after executing FlashMethod_LoadMovie() and getting the FS-Command, if I try to call FlashMethod_LoadMovie() to load the same swf file again, the FS-Command is not received by f_in_box__form.

How do I load the same swf file and let the same swf file restart again?

Thanks a lot!!

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

Postby Softanics » Mon May 24, 2010 3:42 pm

Thank you for your question.

Within a handler of the FSCommand, create a timer with a small period.

In the timer handler put .FlashMethod_LoadMovie() and clear the timer.

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

doubletw
Posts: 4
Joined: Thu Jan 14, 2010 8:17 am

Postby doubletw » Tue May 25, 2010 5:31 am

Hi Sir,

I try to use code to explain my question.

public ref class Form1 : public f_in_box__lib::f_in_box__form
{
public:
Form1(void)
{
InitializeComponent();
this->timer1->Interval = 2000;
this->timer1->Tick += gcnew EventHandler(this, &Form1::TimerEventProcessor);
this->OnFSCommand += gcnew f_in_box__lib::f_in_box__form::OnFSCommandEventHandler(this, &Form1::MainForm_OnFSCommand);
this->FlashMethod_LoadMovie(0, "C:\\a.swf");
}
System::Void MainForm_OnFSCommand(System::Object^ sender, System::String^ command, System::String^ args)
{
if(command == "Init")
this->timer1->Enabled = true;
}
void TimerEventProcessor(Object^ myObject, EventArgs^ myEventArgs)
{
this->timer1->Enabled = false;
System::Windows::Forms::MessageBox::Show("a");
this->FlashMethod_LoadMovie(0, "C:\\a.swf");
}
}

MessageBox only shows one time.
It means that FlashMethod_LoadMovie doesn't work if using FlashMethod_LoadMovie to load a.swf again.

If I use FlashMethod_LoadMovie to load a.swf's duplicate, MessageBox can show two times.
It seems that FlashMethod_LoadMovie is only working when loading different flash file.

How do I load the same flash file again and let FlashMethod_LoadMovie work?

Thanks a lot!!

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

Postby Softanics » Tue May 25, 2010 7:01 am

Hello,

What if to change the code a little:

Code: Select all

void TimerEventProcessor(Object^ myObject, EventArgs^ myEventArgs)
{
   this->timer1->Enabled = false;
   System::Windows::Forms::MessageBox::Show("a");
   this->FlashMethod_LoadMovie(0, "__none__");
   this->FlashMethod_LoadMovie(0, "C:\\a.swf");
}


Please check it.

Thank you.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

doubletw
Posts: 4
Joined: Thu Jan 14, 2010 8:17 am

Postby doubletw » Tue May 25, 2010 8:23 am

It works.

Thank you very much!!


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 17 guests

cron