<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Bei's Bits</title>
    <link>http://blog.beiontheweb.com/</link>
    <description>Design, Art, Programming</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.4.1 - http://www.s9y.org/</generator>
    <pubDate>Sat, 04 Jul 2009 20:40:16 GMT</pubDate>

    <image>
        <url>http://blog.beiontheweb.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Bei's Bits - Design, Art, Programming</title>
        <link>http://blog.beiontheweb.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Visually Interesting Ceilings</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/10-Visually-Interesting-Ceilings.html</link>
            <category>Design</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/10-Visually-Interesting-Ceilings.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=10</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=10</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    Every morning when you wake up, usually the first or second thing you see is the ceiling.  Most of us don&#039;t pay any attention to it all because more than often, it&#039;s usually quite plain.  Most of the time it&#039;s plain white ceiling and at most you may have some visual interest in the form of a ceiling fan.  Why start your day off with such boring design?  Check these crazy ceilings out featured on deputy dog.  &lt;br/&gt;&lt;br/&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://deputy-dog.com/2009/07/ceiling-porn.html&#039;&gt;&lt;!-- s9ymdb:9 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;740&quot; height=&quot;100&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Externals/ceiling.jpg&quot; alt=&quot;&quot; /&gt;&lt;br/&gt;&lt;br/&gt;link&lt;/a&gt;
&lt;br/&gt;

Most of these belong to giant cathedrals or office buildings, but what&#039;s stopping us from doing something creative with our won residential spaces?  Moreover, what about hospital beds?  Imagine how boring it is just to stare into plain white all day when your sick! 
    </content:encoded>

    <pubDate>Sat, 04 Jul 2009 15:19:17 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/10-guid.html</guid>
    
</item>
<item>
    <title>Oops Awards</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/9-Oops-Awards.html</link>
            <category>Design</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/9-Oops-Awards.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=9</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=9</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://oopsaward.jimdo.com/nominees-2009/&#039;&gt;&lt;!-- s9ymdb:8 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;120&quot; height=&quot;120&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Externals/mirrorChair.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;Many people say that there&#039;s a difference between art and design.  Design is suppose to serve a purpose... but sometimes designers get carried away and design things where form is definitely over any semblance of function.  Cool to look at, but definitely fitting the definition of &quot;ugly&quot; these designs definitely stand above the rest in their own right.  Check out the nominees for 2009&#039;s Oops Awards: the award from bad product design.&lt;br/&gt;&lt;br/&gt;

&lt;a href=&quot;http://oopsaward.jimdo.com/nominees-2009/&quot;&gt;Link&lt;/a&gt;

&lt;br/&gt;&lt;br/&gt;
My personal favorite is the Cozy Furniture Collection,designed by Hannes Grebin.
 
    </content:encoded>

    <pubDate>Sat, 04 Jul 2009 14:55:47 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/9-guid.html</guid>
    
</item>
<item>
    <title>The Thug</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/8-The-Thug.html</link>
            <category>Sketches</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/8-The-Thug.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=8</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=8</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/Thug.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/Thug.png&#039;,&#039;Zoom&#039;,&#039;height=537,width=815,top=264,left=440,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:7 --&gt;&lt;img class=&quot;serendipity_image_left&quot; width=&quot;110&quot; height=&quot;72&quot; style=&quot;float: left; border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/Thug.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
About an hour on a Wacom tablet.  This is from another &lt;a href=&quot;http://forums.cgsociety.org/showthread.php?f=130&amp;t=773282&quot;&gt;cgtalk daily sketch thread&lt;/a&gt;. 
    </content:encoded>

    <pubDate>Sun, 28 Jun 2009 14:47:48 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/8-guid.html</guid>
    
</item>
<item>
    <title>Free Maya Tutorials</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/7-Free-Maya-Tutorials.html</link>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/7-Free-Maya-Tutorials.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=7</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=7</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    For the last month, I&#039;ve been working on an online video series that is aimed at teaching Maya.  I want it to focus on good fundamental techniques as well as ease of understanding.  I would also like to include chapters about fundamentals of 3d graphics.  I often find that many 3d artists lack a solid understanding of what&#039;s going on under the hood of computer graphics.  With this additional information artists can take their art further faster.
&lt;br /&gt;&lt;br /&gt;
You can find it here: &lt;a href=&quot;http://www.beiontheweb.com/maya.html&quot;&gt;http://beiontheweb.com/maya.html&lt;/a&gt;
 
    </content:encoded>

    <pubDate>Sat, 27 Jun 2009 18:35:47 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/7-guid.html</guid>
    
</item>
<item>
    <title>Little Wheel by OneClickDog.com</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/6-Little-Wheel-by-OneClickDog.com.html</link>
            <category>Games</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/6-Little-Wheel-by-OneClickDog.com.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=6</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=6</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://fastgames.com/littlewheel.html&#039;&gt;&lt;!-- s9ymdb:6 --&gt;&lt;img width=&quot;49&quot; height=&quot;83&quot;  src=&quot;http://blog.beiontheweb.com/uploads/Externals/littleWheel.png&quot; alt=&quot;little wheel&quot; align=&quot;left&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot;/&gt;&lt;/a&gt;The game &quot;&lt;a href=&quot;http://fastgames.com/littlewheel.html&quot;&gt;Little Wheel&lt;/a&gt;&quot;  from &lt;a href=&quot;http://www.oneclickdog.com&quot;&gt;OneClickDog.com&lt;/a&gt; is a graphically beautiful game with simple story and nice soundtrack.  It&#039;s got some very well paced puzzles and has a good amount of hand holding so your not searching for what to click making this a very accessible game.  The puzzles certainly aren&#039;t the most original but they&#039;re well executed.  The whole game only takes about 5 minutes or so to finish but it&#039;s a very refined and polished game so that 5 minutes is very enjoyable.  Try it out.&lt;br /&gt;

&lt;br /&gt;Found also on &lt;a href=&quot;http://www.newgrounds.com/portal/view/498994&quot;&gt;Newgrounds&lt;/a&gt;
 
    </content:encoded>

    <pubDate>Fri, 19 Jun 2009 02:12:31 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/6-guid.html</guid>
    
</item>
<item>
    <title>First Love</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/5-First-Love.html</link>
            <category>Sketches</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/5-First-Love.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=5</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=5</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    &lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/firstlove.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/firstlove.png&#039;,&#039;Zoom&#039;,&#039;height=615,width=544,top=225,left=575.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:5 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;97&quot; height=&quot;110&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/firstlove.serendipityThumb.png&quot; alt=&quot;&quot; align=&quot;left&quot;/&gt;&lt;/a&gt;Titled first love, this is another CGTalk Daily Sketch topic.  This one is sort of autobiographical with some twists.  Wacom tablet about an hour this morning. &lt;a href=&quot;http://forums.cgsociety.org/showthread.php?f=130&amp;t=770926&quot; title=&quot;CGTalk Daily Sketch - First Love&quot;&gt;CGTalk thread.&lt;/a&gt;&lt;br/&gt; 
    </content:encoded>

    <pubDate>Sun, 14 Jun 2009 14:21:51 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/5-guid.html</guid>
    
</item>
<item>
    <title>Programmatically generated functions in Actionscript 3</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/4-Programmatically-generated-functions-in-Actionscript-3.html</link>
            <category>Programming</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/4-Programmatically-generated-functions-in-Actionscript-3.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=4</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=4</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    Many people know and use object oriented languages like C++ or Java.  However, functional languages like SML and Lisp are just plain cool.  Unfortunately, functional programming is a little hard to wrap your head around.  Many of today&#039;s great scripting languages supports both object oriented programming and functional programming.  
&lt;br /&gt;&lt;br /&gt;
Actionscript is no different.  It include one of the most useful programming features: function objects.  This is used extensively in the callback functions of event handling.  When you use a addEventListener, you pass in a function.
&lt;br /&gt;&lt;br /&gt;
Another really useful functional programming feature is the ability to have a function generate another function.  Just like a function returning an integer or a float, you can have a function return another function.  This is really useful when you need a bunch of similar functions.  Having a single function that generates other functions is far easier to maintain and modify.
&lt;br /&gt;&lt;br /&gt;
Check this AS3 example out:
&lt;textarea rows=&quot;38&quot; class=&quot;exampleCode&quot;&gt;
import fl.controls.Button;
import fl.controls.TextArea;

//Lets procedurally do everything... yah!
//this array will store all the button components
var buttonArray:Array = new Array(8);

//create a text area
var txtArea:TextArea = new TextArea();
txtArea.move(130,10);
txtArea.width = 150;
txtArea.height = 230;
addChild(txtArea);

//this is a function that will generate another function
//that can be used as a button event handler dpending on the string
function buttonEventGenerator(i:int):Function{
	//just like declaring a regular variable, we define a fucntion
	var returnValue:Function;
	returnValue = function(e:MouseEvent):void{
		txtArea.text += &quot;Button clicked: &quot; + i + &quot;\n&quot;;
	}
	return returnValue;
}

//make some buttons
for(var i:int=0; i &lt; 8; i++){
	//create a button
	var newButton = new Button();
	newButton.label = &quot;Button ID: &quot; + i;
	//move it to the correct location and added it to the movie
	newButton.move(10, 10+i*30);
	addChild(newButton);
	//add the event handler
	newButton.addEventListener( MouseEvent.CLICK, buttonEventGenerator(i));
	//cache it away
	buttonArray[i] = newButton;
}
&lt;/textarea&gt;
To use this example, you can either download the (.fla) or, since everything is generated procedurally in this example, you can simply copy and paste the code into frame 1 of a new Flash AS3 file.
&lt;br /&gt;&lt;br /&gt;
In this example, we generate button event handler functions with the function buttonEventGenerator.  It takes in an integer i and generates a new function that appends text to txtArea with i in the text.
&lt;br /&gt;&lt;br /&gt;
Now go fourth and save yourself some typing and generate some functions with functions.
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&quot;http://www.beiontheweb.com/sharedFiles/progEventHandlerExample.zip&quot;&gt;download the example&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
PS. In case your wondering, yes you can write functions that generate functions that generate other functions.
 
    </content:encoded>

    <pubDate>Tue, 09 Jun 2009 02:03:03 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/4-guid.html</guid>
    
</item>
<item>
    <title>wxPython with Flash Actionscript 3</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/3-wxPython-with-Flash-Actionscript-3.html</link>
            <category>Programming</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/3-wxPython-with-Flash-Actionscript-3.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=3</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=3</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    As programmer, I always try to avoid to using something just because it&#039;s what I know.  I&#039;m always trying to avoid the &quot;If you have a hammer, everything looks like a nail&quot; problem.  I always try to use the best tool for the job.  In the long run, it&#039;s almost always easier.  Of course, you can&#039;t always do this.  Sometimes in programming, the tools just don&#039;t plan talk to each other easily.  Fortunately, my two favorite tools do and it&#039;s relatively easily and clean!
&lt;br /&gt;&lt;br /&gt;
I&#039;m talking about Python and Flash/Actionscript.  Both tools are based on the &quot;batteries included&quot; mantra but were intended for different purposes.   Flash is great for multi-media related stuff.  Video, sound, animations, font management, and all user interface components are built right in.  On top of that, it&#039;s got a visual editor that&#039;s easy to use.  There&#039;s a lot that can be said about &quot;what you see is what you get.&quot;  Python, on the other hand, is a great multi-purpose programming language.  It&#039;s got built-in everything!  Sockets, serial communications, zip file manipulation, xml parsing, file management, threads, just to name a few, are all included and far easier to use than their C/C++ counterparts.
&lt;br /&gt;&lt;br /&gt;
So how to get them to talk to each other nicely?  Fortunately, python has the ability to create ActiveX objects through wxPython and Adobe (formerly Macromedia) has provided some nice hooks into flash that we can access.  
&lt;br /&gt;&lt;br /&gt;
Before the examples, there are few caveats.
&lt;ul&gt;  
&lt;li&gt;This will work for windows machines only since it works using ActiveX controls.&lt;/li&gt;
&lt;li&gt;This example is intended to be used with Actionscript 3.0 and not 2.0.&lt;/li&gt;
&lt;li&gt;This example is intended to be used with wxPython 2.8 or greater.  Since 2.8, wxPython has started using comtypes to access ActiveX controls.&lt;/li&gt;
&lt;li&gt;Since Python 3.0 is not compatible with 2.x, this example is for use with Python 2.x only.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Without further ado, here&#039;s the example. First, the example actionscript for flash:&lt;br /&gt;
&lt;textarea class=&quot;exampleCode&quot; rows=&quot;23&quot;&gt;
import fl.controls.Button;
import fl.controls.TextInput;
import flash.events.MouseEvent;
import flash.external.*;

//simple click handler from flash.  Just calls 
function clickHandler(event:MouseEvent):void {
	ExternalInterface.call(&quot;externCall&quot;, txtInput.text);
}

//external handler
int function externHandler(externalStr:String){
	txtStatus.text = &quot;External Command Received: &quot; + externalStr;
	return 1;
}

//make externHandler available to the outside world as &quot;ExternalReceiver&quot;
ExternalInterface.addCallback(&quot;ExternalReceiver&quot;,externHandler);

//Make sure the button does something
btSubmit.addEventListener(MouseEvent.CLICK, clickHandler); 
&lt;/textarea&gt;&lt;br /&gt;
As you can see for the example above, we are simply using the &quot;ExternalInterface&quot; class.  Basically, to get data out of flash, just use ExternalInterface.call() and design a receiver function on the python side to receive the data.  Conversely, to receive data within flash, we use the ExternalInterface.addCallback() to expose an actionscript function to python.
&lt;br /&gt;&lt;br /&gt;
Next the example code for python:
&lt;br /&gt;
&lt;textarea class=&quot;exampleCode&quot;  rows=&quot;50&quot;&gt;
#Flash example
#Author: Bei Yang
#Date: 6-2-09
#Description: Simple example of safe message
#passing to and from flash using a windows activeX control
#Since this depends on ActiveX controls, you can only use this on
#windows.
#
#Disclaimer: Use at your own risk

#depending on your install you may have either delete or modify the
#following 2 lines
import wxversion
wxversion.select(&#039;2.8&#039;)

#import the needed libraries
import wx
from wx.lib.flashwin import FlashWindow

#which file to load... assuming you put into c:\temp
DEFAULT_MOVIE_TO_LOAD = &quot;file://C:\\temp\\flashExample.swf&quot;

#An object, it really doesn&#039;t need to be, but it sure makes it easier
#Many people like to inherit a frame... it does make it easier to then
#drop your code into another wx app afterwards... but that&#039;s confusing
#in an example.  If your doing it for real, it&#039;s probably a good idea.
class FlashExample:
  def &lt;u&gt;_init_&lt;/u&gt;(self, parent, sort):
    self.makeWxWindow(parent, sort)
    self.loadMovie(DEFAULT_MOVIE_TO_LOAD)

    return

  # ----------- Initialization methods --------------------------------
  def makeWxWindow(self, parent, sort):
    &quot;&quot;&quot;
    Initialization for the making a window and some sizers to auto-
    matically exand the window to fit the flash app
    &quot;&quot;&quot;
    self.rootPanel = wx.Panel(parent, sort)

    #make a flash window
    self.flashWin = FlashWindow(self.rootPanel)
    #make a button and a text box
    self.txtBox = wx.TextCtrl(self.rootPanel, wx.NewId())
    self.btSend = wx.Button(self.rootPanel, wx.NewId(), &quot;Send Aove To Flash&quot;)
    
    #place them all in a sizer and vertically lay the out... not pretty but simple
    self.flashSizer = wx.BoxSizer(wx.VERTICAL)
    self.flashSizer.Add(self.flashWin,proportion=1, flag=wx.EXPAND)
    self.flashSizer.Add(self.txtBox, proportion=0.3, flag=wx.EXPAND|wx.ALL, border=2)
    self.flashSizer.Add(self.btSend, proportion=0.3, flag=wx.EXPAND|wx.ALL, border=2)

    #actually set the sizer to the root panel
    self.rootPanel.SetSizer(self.flashSizer)
    self.rootPanel.SetAutoLayout(True)

    #now that the flash component has been created we can tell the com object
    #to use this class as the event sink.  The flash activeX control has,
    #FlashCall, FSCommand, OnProgress, and OnReadyStateChange as events.
    #We just need to make functions that have the same name and they&#039;ll get
    #called when the event is triggered.
    self.flashWin.AddEventSink(self)

    #now for wxEvent handling.
    self.rootPanel.Bind(wx.EVT_BUTTON, self.sendToFlashHandler, self.btSend)
    return

  def loadMovie(self, moviePath):
    &quot;&quot;&quot;
    This can be called from the outside. It just loads a new swf movie.
    And then sets the window size to the newly load flash app size.
    &quot;&quot;&quot;
    self.flashWin.LoadMovie(0, moviePath)
    return

  # ----------- Event Sink handlers ------------------------------------------
  def FlashCall(self, xmlStr):
    &quot;&quot;&quot;
    This is an event sink handler.  The ActiveX control has several events,
    when they get triggered, they simply call a function with the same name
    In this case, we&#039;re catching the &quot;FlashCall&quot; event.  The argument will be
    an xml string from flash specifying which function should be called and
    which arguments to give it.  Docs for the xml format can be found at:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7caf.html
    &quot;&quot;&quot;
    print &quot;FlashCall:&quot;, xmlStr

  # ----------- WxPython Event handlers --------------------------------------
  def sendToFlashHandler(self, btEvent):
    &quot;&quot;&quot;
    Does handling of the &quot;send to flash&quot; button event.  When this key is pressed
    we&#039;ll take the string from the text box and pass it onto flash
    &quot;&quot;&quot;
    sendStr = self.txtBox.GetValue()
    #This is the string that was passed to ExternalInterface in flash. See
    #the .fla actionscript.
    flashFunctionName = &quot;ExternalReceiver&quot;
    #like the flashCall, calling a flash function also requires an xml string
    #we&#039;ll just generate one really quick.  Usually I&#039;d probably do an automatic
    #xml parser/caller, but for clarity sake, we&#039;ll just do our own really quick here
    xmlStr = &quot;&lt;invoke name=\&quot;&quot; + flashFunctionName + &quot;\&quot; returntype=\&quot;xml\&quot;&gt;&quot;
    xmlStr += &quot;&lt;arguments&gt;&quot;
    xmlStr += &quot;&lt;string&gt;&quot; + sendStr + &quot;&lt;/string&gt;&quot;
    xmlStr += &quot;&lt;/arguments&gt;&quot;
    xmlStr += &quot;&lt;/invoke&gt;&quot;
    
    #now to actually invoke it
    rValue = self.flashWin.ctrl.CallFunction(xmlStr)
    
    #you&#039;ll notice that you can get return values too.  This return value will
    #be in the same xml format.  For this example, we&#039;ll just print it.
    print &quot;XML return value: &quot;, rValue

#basic wx stuff
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, &quot;Flash Example&quot;)
example = FlashExample(frame, -1)
frame.Show(True)
app.MainLoop()
&lt;/textarea&gt;
&lt;br /&gt;
This is a bit more complicated.  If you use wxPython already, it&#039;s pretty straightfoward.  If you don&#039;t, learn a bit about wxPyhon.  It&#039;s a great user interface toolkit for flash.
&lt;ol&gt;
&lt;li&gt;First I create a with a wx.lib.flashwin.FlashWindow object inside it.  This object is the python representation of the ActiveX control for flash.  I simply use FlashWindow.LoadMovie to load a swf.  &lt;/li&gt;
&lt;li&gt;I use the AddEventSink function to target the class I just wrote to capture ActiveX events.  This means that the ActiveX control will try to find the function with the same name as it&#039;s internal events to call.  The flash player control has:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;FlashCall - Called when &quot;ExternalInterface.call()&quot; is used in Actionscript&lt;/li&gt;
&lt;li&gt;FSCommand - Called when fscommand() is used in Actionscript&lt;/li&gt;
&lt;li&gt;OnProgress - Called when a swf is being loaded&lt;/li&gt;
&lt;li&gt;OnReadyStageChange - Called when a swf either just started loading or just finished&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Lastly, I use the CallFunction method to invoke flash Actionscript functions that were exposed earlier using the ExternalInterface.addCallback() within flash.  However, to use this function, I must encode a string into an xml format that then Flash will interpret.  Further documentation, for the xml format can be found on the
&lt;a href=&quot;http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7caf.html&quot;&gt;Adobe online help site&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
With that, you should have two way communication between flash and python.  You can even pass arrays in between the too!  
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.beiontheweb.com/sharedFiles/wxPythonAndFlash.zip&quot;&gt;Download the Source (zip)&lt;/a&gt; Includes a .fla file as well as .py file.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.python.org/download/&quot;&gt;Python &lt;/a&gt;- If you don&#039;t have this, this tutorial was probably not for you ;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.wxpython.org/download.php&quot;&gt;wxPython &lt;/a&gt;- A pretty good GUI Library for python.  This should come with Python, but if you don&#039;t have it, you can get it here.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sourceforge.net/projects/comtypes/&quot;&gt;comtypes &lt;/a&gt;- This is what wxPython uses to access the ActiveX control.&lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Sun, 07 Jun 2009 18:19:50 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/3-guid.html</guid>
    
</item>
<item>
    <title>The Fleet</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/2-The-Fleet.html</link>
            <category>Sketches</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/2-The-Fleet.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    Really simple 45min sketch.  Topic is from CGTalk&#039;s daily sketch forum.  &quot;&lt;a href=&quot;http://forums.cgsociety.org/showthread.php?f=130&amp;t=767419&quot;&gt;The Fleet&lt;/a&gt;&quot;.  Throw back to Homeworld the game here...&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/fleet.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/fleet.png&#039;,&#039;Zoom&#039;,&#039;height=709,width=1015,top=178,left=340,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:4 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;76&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/fleet.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;

 
    </content:encoded>

    <pubDate>Mon, 25 May 2009 18:26:23 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/2-guid.html</guid>
    
</item>
<item>
    <title>Ink Style</title>
    <link>http://blog.beiontheweb.com/index.php?/archives/1-Ink-Style.html</link>
            <category>Sketches</category>
    
    <comments>http://blog.beiontheweb.com/index.php?/archives/1-Ink-Style.html#comments</comments>
    <wfw:comment>http://blog.beiontheweb.com/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://blog.beiontheweb.com/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>nospam@example.com (Bei Yang)</author>
    <content:encoded>
    Tried to do some stuff with an ink style.  These took about 10 minutes or less.&lt;br /&gt;
&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/gameController.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/gameController.png&#039;,&#039;Zoom&#039;,&#039;height=315,width=294,top=375,left=700.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:3 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;102&quot; height=&quot;110&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/gameController.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/cat.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/cat.png&#039;,&#039;Zoom&#039;,&#039;height=261,width=316,top=402,left=689.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:2 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;90&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/cat.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a class=&#039;serendipity_image_link&#039; href=&#039;http://blog.beiontheweb.com/uploads/Sketches/coy.png&#039; onclick=&quot;F1 = window.open(&#039;/uploads/Sketches/coy.png&#039;,&#039;Zoom&#039;,&#039;height=315,width=472,top=375,left=611.5,toolbar=no,menubar=no,location=no,resize=1,resizable=1,scrollbars=yes&#039;); return false;&quot;&gt;&lt;!-- s9ymdb:1 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;110&quot; height=&quot;72&quot; style=&quot;border: 0px; padding-left: 5px; padding-right: 5px;&quot; src=&quot;http://blog.beiontheweb.com/uploads/Sketches/coy.serendipityThumb.png&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; 
    </content:encoded>

    <pubDate>Tue, 19 May 2009 01:44:54 -0500</pubDate>
    <guid isPermaLink="false">http://blog.beiontheweb.com/index.php?/archives/1-guid.html</guid>
    
</item>

</channel>
</rss>
