Grundgerüst für einen FLASH ScreenSaver
Verfasst: 23.03.2008 00:57
Grundgerüst für einen FLASH ScreenSaver.
Viel Spaß beim Testen ...
Lg. Legion
Download:FlashScreenSaver.zip
Viel Spaß beim Testen ...
Lg. Legion
Download:FlashScreenSaver.zip
Code: Alles auswählen
Interface IShockwaveFlash Extends IDispatch
get_ReadyState(a)
get_TotalFrames(a)
get_Playing(a)
put_Playing(a)
get_Quality(a)
put_Quality(a)
get_ScaleMode(a)
put_ScaleMode(a)
get_AlignMode(a)
put_AlignMode(a)
get_BackgroundColor(a)
put_BackgroundColor(a)
get_Loop(a)
put_Loop(a)
get_Movie(a)
put_Movie(a)
get_FrameNum(a)
put_FrameNum(a)
SetZoomRect(a,b,c,d)
Zoom(a)
Pan(a,b,c)
Play()
Stop()
Back()
Forward()
Rewind()
StopPlay()
GotoFrame(a)
CurrentFrame(a)
IsPlaying(a)
PercentLoaded(a)
FrameLoaded(a,b)
FlashVersion(a)
get_WMode(a)
put_WMode(a)
get_SAlign(a)
put_SAlign(a)
get_Menu(a)
put_Menu(a)
get_Base(a)
put_Base(a)
get_scale(a)
put_scale(a)
get_DeviceFont(a)
put_DeviceFont(a)
get_EmbedMovie(a)
put_EmbedMovie(a)
get_BGColor(a)
put_BGColor(a)
get_Quality2(a)
put_Quality2(a)
LoadMovie(a,b.p-bstr)
TGotoFrame(a,b)
TGotoLabel(a,b)
TCurrentFrame(a,b)
TCurrentLabel(a,b)
TPlay(a)
TStopPlay(a)
SetVariable(a,b.p-bstr)
GetVariable(a,b.p-bstr)
TSetProperty(a,b,c)
TGetProperty(a,b,c)
TCallFrame(a,b)
TCallLabel(a,b)
TSetPropertyNum(a,b,c)
TGetPropertyNum(a,b,c)
get_SWRemote(a)
put_SWRemote(a)
get_Stacking(a)
put_Stacking(a)
EndInterface
;--------------------------------------------------------------------------------------------------------------------------------------------
Prototype AtlAxWinInit()
Prototype AtlAxCreateControl(a.p-bstr,b.l,c.l,d.l)
Prototype AtlAxGetControl(a.l,b.l)
;--------------------------------------------------------------------------------------------------------------------------------------------
Procedure.l FlashLoadFromData(SwfStart.l,SwfEnd.l,*FlashObject.IShockwaveFlash)
FlashBuffer=AllocateMemory(SwfEnd-SwfStart+8)
If FlashBuffer
PokeL(FlashBuffer,$55665566)
PokeL(FlashBuffer + 4,SwfEnd-SwfStart)
CopyMemory(SwfStart,FlashBuffer + 8,SwfEnd-SwfStart)
If CreateStreamOnHGlobal_(FlashBuffer,#True,@FlashStream.IStream) = 0
*FlashObject\QueryInterface(?IID_IPersistStreamInit,@FlashPSI.IPersistStreamInit)
If FlashPSI
If FlashPSI\load(FlashStream) = 0
ReturnValue = 1
EndIf
FlashPSI\Release()
EndIf
FlashStream\Release()
EndIf
;FreeMemory(FlashBuffer) ;idem
EndIf
ProcedureReturn ReturnValue
EndProcedure
;--------------------------------------------------------------------------------------------------------------------------------------------
If OpenLibrary(0,"atl.dll")
AtlAxWinInit.AtlAxWinInit = GetFunction(0, "AtlAxWinInit")
AtlAxCreateControl.AtlAxCreateControl = GetFunction(0, "AtlAxCreateControl")
AtlAxGetControl.AtlAxGetControl = GetFunction(0, "AtlAxGetControl")
Else
MessageRequester("Fehler", "Fehler beim öffnen von atl.dll !")
End
EndIf
;--------------------------------------------------------------------------------------------------------------------------------------------
CoInitialize_(0)
ExamineDesktops()
;--------------------------------------------------------------------------------------------------------------------------------------------
If OpenWindow(0,0,0,DesktopWidth(DT),DesktopHeight(DT), "Demo",#PB_Window_BorderLess|#PB_Window_Maximize)
If AtlAxWinInit()
ShowCursor_(0)
AtlAxCreateControl("ShockwaveFlash.ShockwaveFlash", WindowID(0),0,@Container.IUnknown)
If Container
AtlAxGetControl(WindowID(0),@oFlash.IShockwaveFlash)
If oFlash
If oFlash\QueryInterface(?IID_ShockwaveFlash, @oFlash) = 0
;oFlash\LoadMovie(0, Movie$)
FlashLoadFromData(?FlashFileStart,?FlashFileEnd,oFlash)
oFlash\get_ReadyState(@state);0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete.
Select state
Case 4,3
;oFlash\Play()
oFlash\FlashVersion(@Version)
;oFlash\put_BackgroundColor($000000)
oFlash\get_BackgroundColor(@BackColor)
Default
MessageRequester("Fehler", "FlashMovie konnte nicht geladen werden")
EndSelect
;--------------------------------------------------------------------------------------------------------------------------------------------
oFlash\put_Quality(1)
oFlash\put_ScaleMode(3)
oFlash\put_BackgroundColor(0)
x = WindowMouseX(0)
y = WindowMouseY(0)
;--------------------------------------------------------------------------------------------------------------------------------------------
Repeat
Event = WaitWindowEvent()
WindowID = EventWindow()
GadgetID = EventGadget()
EventType = EventType()
If Event = #WM_KEYDOWN
EXITSTATUS = 1
Break
EndIf
If WindowMouseX(0) <> x Or WindowMouseY(0) <> y
EXITSTATUS = 1
Break
EndIf
oFlash\CurrentFrame(@frame)
Until Event = #PB_Event_CloseWindow
oFlash\Release()
EndIf
oFlash\Release()
EndIf
EndIf
EndIf
CloseWindow(0)
EndIf
CoUninitialize_()
End
;--------------------------------------------------------------------------------------------------------------------------------------------
DataSection
IID_ShockwaveFlash:
Data.q $11CFAE6DD27CDB6C,$000054534544B896
IID_IPersistStreamInit:
Data.l $7FD52380
Data.w $4E07,$101B
Data.b $AE,$2D,$08,$00,$2B,$2E,$C7,$13
FlashFileStart:
IncludeBinary "Hier deine Flashanimation (*.swf) einfügen"
FlashFileEnd:
EndDataSection
;--------------------------------------------------------------------------------------------------------------------------------------------