Unofficial Content

This is a simple example showing how to use the Flash Viewer User Control using Parameters and Variables with this flash movie. Suppose you use a mind map software such as Freemind and you want to display the maps in a Web Panel with a mindmap browser.

freemindSample01

How to do it...

  • Make sure you have installed the Flash Viewer User control.
  • Import the freemindSample.xpz file within the User Control installation (<genexusinstallation>\UserControls\FlashViewer\).
  • Copy the visorFreemind.swf and freeMindFlashBrowser.mm files to the WebServer (in this sample we copied them in the \FlashViewer\ folder under the Web Application)

You will notice the following objects were imported:

  • the freemindsample Web Panel with just a flash viewer control in the WebForm, which references the visorFreemind.swf  file.
  • the freemindsampleLoader Data Provider which references the freeMindFlashBrowser.mm file.

We changed the following properties to the flash control:

  • Width: 100%
  • Height: 100%
  • swfFile: ./FlashViewer/visorFreemind.swf
  • backgroundColor: #9999ff

To load all the properties the movie needs, we use a Data Provider; the Refresh event does the following:

Event Refresh
&flashviewerData = freemindsampleLoader() // load Flash object parameters
EndEvent

and the freemindsampleLoader Data Provider does the following:


// Variables and parameters used by the sample
// Check http://freemind.sourceforge.net/wiki/index.php/Main_Page for more information
FlashViewerData
{
&basePath = "./" // Use "./" for .Net and "../static/" for Java
Variables // Specific variables associated to the swf object
{
Variable
{
Item = "initLoadFile"
Value = &basePath + "FlashViewer/freeMindFlashBrowser.mm"
}
Variable
{
Item = "openUrl"
Value = "_blank"
}
Variable
{
Item = "startCollapsedToLevel"
Value = "3"
}
Variable
{
Item = "maxNodeWidth"
Value = "200"
}
Variable
{
Item = "mainNodeShape"
Value = "elipse"
}
Variable
{
Item = "justMap"
Value = "false"
}
Variable
{
Item = "defaultToolTipWordWrap"
Value = "200"
}
Variable
{
Item = "offsetX"
Value = "left"
}
Variable
{
Item = "offsetY"
Value = "top"
}
Variable
{
Item = "buttonsPos"
Value = "top"
}
Variable
{
Item = "min_alpha_buttons"
Value = "20"
}
Variable
{
Item = "max_alpha_buttons"
Value = "100"
}
Variable
{
Item = "scaleTooltips"
Value = "false"
}
}
Parameters
// Sample Parameters, Check http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=1 for more information
{
Parameter
{
Item = "menu"
Value = "true"
}
Parameter
{
Item = "wmode"
Value = "transparent"
}
Parameter
{
Item = "allowfullscreen"
Value = "true"
}
}
}

As you can see the first section loads specific parameters of the flash movie, and the second one loads just visualization properties. Once this is done, all of the variables you pass in will be available immediately inside the flash movie.

For this sample, you will need the files generated by the freemind software in this case we use the freeMindFlashBrowser.mm downloaded from here, but you could create your own files and load them using something similar.

When executing it, you should see the following:

freemindVideo01

Generally, when using diferent movies you will have to change the Variables section of the loader and some properties of the flash Control in the WebForm.

This should be enough to embeb flash movies in a Web Panel.

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant