#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0

    creating an .EXE for a Python module wrapping Flash


    hi,

    I managed to get Python to be a wrapper for flash and they work well together but even after 3 days of working on it, I still cannot get py2exe to create a standalone.

    Has anyone successfully done this?
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Do tell, very intersted. How exactly do you mean wrapping flash? Anyway creating exe's with py2exe is usually very easy, or i've never had a problem with it... what exactly is the problem?

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    Originally Posted by netytan
    Do tell, very intersted. How exactly do you mean wrapping flash? Anyway creating exe's with py2exe is usually very easy, or i've never had a problem with it... what exactly is the problem?

    Mark.
    To use Flash as a standalone application, we need something more powerful to wrap Flash, treating Flash as a COM object. Flash can then use fscommands to talk to the wrapper, the wrapper can talk to the OS, do stuffs, then send back stuffs to Flash. The usual combination for this is using VB and Flash. I guess a better word usage is to have VB as the backend and Flash as the front-end? But you should get the idea by now...

    So I use Python as the wrapper for Flash and it works great in authoring. But having py2exe to create an executable is extremely problematic for me.

    First, it seems using "win32com.client.gencache.EnsureModule" call prevents proper importing of the flash object, so I tried a different approach of using makepy.py to make a Python equivalence of the Flash object and use the "import" call instead of the "win32com.client.gencache.EnsureModule" and sure enough, it works in authoring, and the "ImportError" is gone when I execute the resulting .EXE, but now, I get a:

    "Application Error : The instruction at "0x1e034336" referenced memory at "0x00000004". The memory could not be "read"."

    Now, I'm stuck.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    malnart, i am stuck with similar problems and i am wondering if by this time you have found a solution?

    I, too, am embeding a swf in a python program and while authoring everything works fine. Even when building with py2exe i get no problems, but when trying to run the .exe i get AttributeError: 'module' object has no attribute 'ShockwaveFlash'

    if anybody has found a working solution i would be really happy if you could share

    thank you.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    if anyone is interested, i finally found a way around this problem
    http://www.klaustrofobik.org/blog/archives/000236.html
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Looks great! I'll have to try and remember this for if i ever do any flash Python interaction ! Anyway one little thing i knowticed from you're blog. The last line 'flashControl = flash'...

    Code:
    if wxPlatform == '__WXMSW__':
        from wxPython.lib.activexwrapper import MakeActiveXClass
        import flash
        flashControl = flash
    could be writen like this using the as keyword in the import statment, which simply imports the 'flash' module and binds it to a different name...

    Code:
    if wxPlatform == '__WXMSW__':
        from wxPython.lib.activexwrapper import MakeActiveXClass
        import flash as flashControl
    Doesn't make much sence to me to have a copy of the 'flash' module (flashControle and flash) floating around in you're program but i may have missed something .

    Anyway have fun,

    Mark.
    programming language development: www.netytan.com Hula

  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    you're completely right Netytan
    <lame excuse>
    i just wanted to "illustrate" the thing that has changed and as i reference the flashControl later on i left it that way...
    </lame excuse>
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Posts
    3
    Rep Power
    0
    well, I downloaded and compiled your code and I got the exact same error as my code, that's when I figure I didnt do anything wrong code-wise. So I reinstalled Python and everything works. I think it's because I had ActivePython installed...

    Anyhow, it's time to get rid of VB!

IMN logo majestic logo threadwatch logo seochat tools logo