.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> WPF >> Post New QuestionBookmark and Share Subscribe to Forum

how to create flash file in WPF

Posted By: Rajesh     Posted Date: July 20, 2012    Points:5   Category :WPF
how to create flash file in WPF. did u any sample application please send me friends

Author: Narayanan             
Posted Date: July 29, 2012     Points: 20   
Author: Baimey Rajesh             
Posted Date: August 01, 2012     Points: 20   

Steps :-

1) Add a WindowsFormsHost to the window [http://msdn.microsoft.com/en-us/library/ms742875.aspx] .This is required to host the Flash .ocx file which is present @ c:\windows\system32\macromed\flash.
2) Run AxImp.exe from the .net sdk comman prompt on the Flash ocx to generate following files.
Syntax :
AxImp.exe "c:\windows\system32\macromed\flash\Flash<version> .ocx"

3) In Visual Studio, add the references to the AxShockwaveFlashObjects.dll and ShockwaveFlashObjects.dll generated by aximp

Add namespaces to the imports section
using AxShockwaveFlashObjects;
using ShockwaveFlashObjects;

4) Add this code to display SWF

AxShockwaveFlash axShockwaveFlash = new AxShockwaveFlash();
axShockwaveFlash.Location = new System.Drawing.Point(50, 50);
this.Controls.Child = axShockwaveFlash;
this.Show(); // Avoids InvalidActiveXStateException.
axShockwaveFlash.Movie = “D:\\test.swf”;
//* it is important to set Size after specifying Movie property
//* if Size is specified before, it is ignored
axShockwaveFlash.Size = new System.Drawing.Size(20, 20);

Note:While specifying the path for the movie file is that the path format has to match what the flash control wants. For the movie to work, the path had to be
absolute, the slashes had to be back slashes and the path had to start with file://. [http://www.pcreview.co.uk/forums/thread-2611270.php]

Author: Baimey Rajesh             
Posted Date: August 01, 2012     Points: 20   

In case you want to convert SWF file to XAML you can use the tool @ http://www.mikeswanson.com/swf2xaml/

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend