1

Can you please let me know how to add flash object into the custom task pane using VSTO?

peSHIr
  • 6,279
  • 1
  • 34
  • 46

1 Answers1

1

You can add a "Shockwave flash object" control to your task pane or form region. You may have to find it in your user controls and add it in you tool box. You can then set the Movie property to the URI of the flash swf.

Marcus

Update

You can add you swf file to your project and set it to copy to output then you need to reference it in code.

add a helper property to you addin or copy the code out.

 static public string AssemblyDirectory { 
            get { 
                string codeBase = Assembly.GetExecutingAssembly().CodeBase; 
                UriBuilder uri = new UriBuilder(codeBase); 
                string path = Uri.UnescapeDataString(uri.Path); 
                return Path.GetDirectoryName(path); 
            } 
        }

Then in your taskpane showing/init event

String swfPath = AssemblyDirectory + Path.DirectorySeparatorChar + "menu.swf";
axShockwaveFlash1.LoadMovie(0, swfPath);
76mel
  • 3,993
  • 2
  • 22
  • 21
  • yes i did that but when i do setup the pulgin it will not have the flash object in it that is i tried to place the .swf (flash file) in project bin folder it didnt work but if i place flash file ouside the project folder and specify the path then it works fine even in that during setup .swf files are not copied –  Jul 15 '09 at 09:47
  • please help me how can i slove this –  Jul 15 '09 at 09:47
  • like in VB.NET when we are adding flash object into windows forms then we would save the .swf file in bin folder of the project and include the .swf file path like this :-flashobj.Movie=Application.StartupPath & "\movie.swf" like then when project set up is done it would include .swf files defaultly from taht path , but in VSTO its not working like taht since its exceute path is different we cant use Application.StartupPath to include the .swf file defaulty –  Jul 16 '09 at 03:10
  • please can i know to which folder of my project i must add .swf file –  Jul 16 '09 at 03:43
  • hi Marcus thanks for the post i tried as u specified i placed .swf file in project folder i.e in bin directory then i copied that into output directory and i added ur code but it works when it is executed but it will not work when application is run through setup please can i know how to make it work –  Jul 16 '09 at 04:25
  • divya, How are you seting this up as click once ? also can you see the swf file in you vsto cache folder ? it could be a number of things .. one that it not getting copied or 2 security is stopping it .. also ouput the path ... Assembly.GetExecutingAssembly().CodeBase should get you the manifest . – 76mel Jul 16 '09 at 08:52
  • You could also install the swf file in a known path on the client may be %app_data% – 76mel Jul 16 '09 at 09:04
  • ya i am trying to setup through click once .swf file is available in setup folder Application files>bin>debug but also its not taking no security issue but one more thing i s after deployment the file extension is getting change like i.e before deployment movie.swf and after deployemnet movie.swf.DEPLOY like this its changing i am not able to proceed really can be place flash object in custom pane??? –  Jul 16 '09 at 09:11
  • How shall i copy .swf file in the process of setup ?? and how shall install swf file through setup?? –  Jul 16 '09 at 09:15
  • 1
    Clickonce is a pain... when you click the vsto file its insatlls the addin into another location .. normally on XP c:\document and settings\\Local Settings\Apps\2.0 and normally under one of the sub dires there. take a look to see if you swf flie is bein installed into there. You could always do a good old msi install .. check out : http://code.msdn.microsoft.com/VSTO3MSI/Release/ProjectReleases.aspx?ReleaseId=729 – 76mel Jul 16 '09 at 09:35
  • yes it getting copyied to the c:\document and settings\\Local Settings\Apps\2.0 \flashexmp\bin\movie.swf to this location so can i give the path for this ,if yes then how can i give please help me –  Jul 16 '09 at 09:43
  • .swf is getting copied to the c:\document and settings\\Local Settings\Apps\2.0\99876512.. \flashexmp..\bin\movie.swf to this location so can i give the path for this ,if yes then how can i give please help me –  Jul 16 '09 at 09:48