Sign in to follow this  
Followers 0
amdead

How do i put flash into a GUI window?

16 posts in this topic

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

Share this post


Link to post
Share on other sites



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.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

Thank you.

Share this post


Link to post
Share on other sites

It says i have an error on line 2

$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")

$pRP = ERROR

Share this post


Link to post
Share on other sites

Update your version of AutoIt.

It says i have an error on line 2

$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")

$pRP = ERROR

Share this post


Link to post
Share on other sites

Thank you, it works :)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
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.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

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.

[center]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.[/center]

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I'll do that

Edit: I unitstalled, wiped the registry, reinstalled, same problem. I guess I'll just forget about this part of what I want to do.

Edited by Champak

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

This is just a guess but it could have something to do with the version of Flashplayer installed on the computer? I would make sure you have the latest version installed.

Mike


Share this post


Link to post
Share on other sites

yah that's what iwas thinking, update flashplayer


Share this post


Link to post
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
Sign in to follow this  
Followers 0