Jump to content

How do i put flash into a GUI window?


amdead
 Share

Recommended Posts

Hello, am a n00b at autoit, i would like help to put a SWF into a GUI window. Can somebody help?

Here is one I found by searching the forums

#include <GUIConstants.au3>
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
GUICreate ("PacMan", 820, 600, -1, -1)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580)

With $oRP; Object tag pool
    .bgcolor = "#000000"; change background color to white FFFFFF
    .Movie = 'http://www.80smusiclyrics.com/games/pacman/pacman.swf'; the wave file from inet / could be on disk
    .ScaleMode = 2
    .Loop = True
    .wmode = "Opaque"; Opaque / transparent
;.Stop / .Play
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

$oRP = 0; FREE THE OBJECT
GUIDelete ()
Exit

Not written by me.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • 2 months later...

I'm running this through beta run and am getting an error:

Line 6

With $oRP

Error: Illegal text at the end of statement (one statement per line)

Only Object-type variables allowed in a WITH statement!

Any help.

Edit: I dropped the $oRP to the next line after the "With" and now AutoIt3.exe has encountered a problem and needs to close. Now what?

Edited by Champak
Link to comment
Share on other sites

I have just tried running it with the latest Beta and get no errors. Please check that you have copied and pasted correctly.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Did it again and it is copied exactly. Could it be because I have both beta and release on the computers. They are in two different dir..

You have to make sure your running in Beta, In SciTe use Alt+F5 rather than just F5 or Tools / Beta Run. This is a most common mistake.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

That's what I did. Now I'm looking in the error at the bottom of the scite thing and this is what it says:

C:\Documents and Settings\Money\Desktop\Gui test\pacman.au3 (2) : ==> Unknown function name.: 
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") 
$oRP = ^ ERROR
->AutoIT3.exe ended.rc:1
>Exit code: 1   Time: 0.721

This is after I moved the oRP back, as it is in the original.

#include <GUIConstants.au3>
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
GUICreate ("PacMan", 820, 600, -1, -1)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580)

With $oRP; Object tag pool
    .bgcolor = "#000000"; change background color to white FFFFFF
    .Movie = 'http://www.80smusiclyrics.com/games/pacman/pacman.swf'; the wave file from inet / could be on disk
    .ScaleMode = 2
    .Loop = True
    .wmode = "Opaque"; Opaque / transparent
;.Stop / .Play
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

$oRP = 0; FREE THE OBJECT
GUIDelete ()
Exit
Edited by Champak
Link to comment
Share on other sites

  • Moderators

That's what I did. Now I'm looking in the error at the bottom of the scite thing and this is what it says:

C:\Documents and Settings\Money\Desktop\Gui test\pacman.au3 (2) : ==> Unknown function name.: 
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") 
$oRP = ^ ERROR
->AutoIT3.exe ended.rc:1
>Exit code: 1   Time: 0.721

This is after I moved the oRP back, as it is in the original.

#include <GUIConstants.au3>
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
GUICreate ("PacMan", 820, 600, -1, -1)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580)

With $oRP; Object tag pool
    .bgcolor = "#000000"; change background color to white FFFFFF
    .Movie = 'http://www.80smusiclyrics.com/games/pacman/pacman.swf'; the wave file from inet / could be on disk
    .ScaleMode = 2
    .Loop = True
    .wmode = "Opaque"; Opaque / transparent
;.Stop / .Play
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

$oRP = 0; FREE THE OBJECT
GUIDelete ()
Exit
Well I ran it for the first time using Beta 3.1.118 and 3.1.123 and it ran just fine just like this:
#include <GUIConstants.au3>
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
GUICreate ("PacMan", 820, 600, -1, -1)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580)

With $oRP; Object tag pool
    .bgcolor = "#000000"; change background color to white FFFFFF
    .Movie = 'http://www.80smusiclyrics.com/games/pacman/pacman.swf'; the wave file from inet / could be on disk
    .ScaleMode = 2
    .Loop = True
    .wmode = "Opaque"; Opaque / transparent
;.Stop / .Play
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

$oRP = 0; FREE THE OBJECT
GUIDelete ()
Exit

Edit:

You know, as many problems as you are having with Beta, I would suggest uninstalling AutoIt and doing a fresh install of both.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 1 month later...

this is a strange problem, someone has informed me they are experiencing this error, the thing is, they are using a compiled exe which works fine on my and other PC's...

any solutions been found yet?

Edited by possy_99
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...