Flash and VB - Working together
Condensed from
http://www.macromedia.com/devnet/mx/flash/articles/flash_vb.pdf
Boring grey desktop GUI's can be dramatically improved with Flash. This article tells you how to do it.
Flash rules User interfaces. VB tops in programmer productivity. If you merge these, you have a potent combination.
Flash with a lot of prebuilt components ( Textboc, listbox, scrool bars..) make building offline/online GUI's easy
Flash uses FS command to communicate with an outside application.
To view .swf files in VB you have to add flash components object. This is an activeX component permitting flash to be used with VB.
Flash integration is just permitting normal flash to be played inside VB. No special flash files need to be created for this.
When you call FSCommand in your ActionScript and if the Flash file is being played inside the Flash component, it will generate a FSCommand event in your VB program. If we write code inside the FSCommand in VB, this code will then execute.
Set/GetVariable functions are used to get data from VB to Flash.
Getting flash into VB
Insert a ShockwaveFlash component onto a VB form. Name the Flash component as swfFlashScreen. Now to load the Flash (.swf) file into this component use the following function:
Call swfFlashScreen.LoadMovie(0, filename)
The filename is the full path of the swf file. The first parameter signifies the level where Flash is to be loaded; we used 0 for root level.
Since strings are very large in VB6 (upto 2Gb) and strings can be passed back and forth between VB and Flash using FSCommand and SetVariable, all data interaction between VB and Flash can be achieved easily.
Another way of data-exchange would be through XML
XML files can be used as data source for Flash.
Flash can call VB. VB can't call flash. To simulate VB talking to flash, flash can set a variable in VB and periodically check if VB has changed the variable value. On change, it initiates a sequence of actions
If you have the default Flash MX as shipped by Dreamweaver, it will not work in VB.You need to update it to the first service release. The updated Flash.ocx comes along with the latest download of Flash viewer.
0 Comments:
Post a Comment
<< Home