DesktopX Journal: Day 8
Flash games and DesktopX
Sunday, March 13, 2005 by Frogboy | Discussion: DesktopX
Macromedia Flash is very popular on the Web. It's used for creating advertisements, multimedia presentations, and even games. It's designed to live on the web. But wouldn't it be cool to marry Flash's multimedia abilities with the customization powers seen in widgets? The answer is, you can with DesktopX. With DesktopX you can take a flash object and embed it into a DesktopX object and the two will work seamlessly.
For my quick example I'm gong to take a Tetris.swf file and combine it with a DesktopX object. Bear in mind, if you're going to use .swf files you need to make sure you have permission (or see if it's freely distributable) before you start distributing it around. So first you find your .swf (flash) file.
![]() So innocent, these two objects have no idea what's going to be happening to them soon... |
Now, you'll want to create two objects. The first one is your background, the second one is the one that will contain the .swf file. For the background, I've created a quickie Tetrisy like background. Remember, I suck when it comes to art. So I'm sure you can do better.
Oh the shame of my background. But let's not worry too much about how ugly my background. Pretend it was rendered and looks fantastic.
Now comes the really interesting part: Embedding files into a DesktopX object. On the summary page there is a "custom files" button. Press that button and add in your files:
So now I have the flash file in there. The next step is to make that object actually use them. So I go back to the general tab and press the "New" script button.
Once I'm in the script editor, I go to the script menu and select the Microsoft Web Browser ActiveX control. Then I add one line:
Control.Navigate2 Object.Directory & "tetris.swf" |
This line tells my Microsoft Web Browser control to navigate to the object directory (where DesktopX keeps embedded files) and open the tetris.swf file
At this point, I have an itty bitty Tetris game appearing. You manipulate ActiveX controls in DesktopX with the CTRL key (we'll be making this user definable in the future). So holding down the CTRL key I move and resize my object on top of my ugly background. Then I select them both and group them.
And voila:
Like I said, it's kind of ugly but you get the idea. Obviously the ultimate combination is if you know how to make Flash files as now you have an interesting way to embed them. Or if you don't want to embed them but rather use them to drive people to your site, you can have the browser object link to your web server that has the .swf file and then add controls onto your DesktopX widget that drives people to your website. This provides a whole new avenue for distributing Flash content. Of course, you could create the game with DesktopX using scripting. DesktopX doesn't currently support vector drawing natively but any sort of bitmap based game (Tetris, Pac-Man, etc.) could be done with DesktopX.
But the goal of DesktopX isn't to try to force developers into using a proprietary system but rather let them exploit their existing skills much more effectively.
You can get DesktopX at www.desktopx.net.
Reply #2 Wednesday, December 26, 2007 4:12 PM
I build there libraries Action Script 3 from Flex 3 and Flash CS3.
I try some new component by Flex Builder 3 onto DesktopX ( Visual Studio Basic Runtime )
Example: A button will to close this widget from DesktopX 3.0 and 3.x
For Flex Builder 3:
< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
< mx:Script >
< ![CDATA[
import com.freeweb7.snakemedia.desktopx.stardock.*;
private function closeBtnClick():void
{
dx_close();
}
]] >
< /mx:Script >
< mx:Button label="Close this Widget" click="closeBtnClick()" />
< /mx:Application >

dx_close() will to parse into Visual Basic Script Function like old Version of Screenweaver 3.x. It was worked Action Script 1 into Visual Basic or C++ Functions
Screenweaver has given Event for Visual Basic or C++ "sw_application.exit();"
I hope you understand. When i work final this libraries for DesktopX.
If i control into correct events by DesktopX than it works

Thank you for new update by me! If you take care about new Flex/ Flash into DesktopX

Bye Snakemedia
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!
Reply #1 Thursday, February 2, 2006 2:08 AM
Great article to stumble across,thanks again