Easily make your own animated flash movie from PB
Posted: Tue Mar 03, 2009 3:09 pm
Thanks to Kiffi and srod help i finally find the errors on my code and now we can make flash movies from PB, in a very easy way.
Download and register the bukoo dll (im hosting it because cant find it online anymore since the sourceforge project seams to be dead) http://yenerich.com/swfobjs.rar
*I hope this dll can be hosted on PuraArea to avoid the risk of broken links, just a suggestion.
Example:
I know many of you will have much fun playing with this 
Download and register the bukoo dll (im hosting it because cant find it online anymore since the sourceforge project seams to be dead) http://yenerich.com/swfobjs.rar
*I hope this dll can be hosted on PuraArea to avoid the risk of broken links, just a suggestion.
Example:
Code: Select all
IncludePath "..\"
XIncludeFile "COMate.pbi"
Define Movie.COMateObject
Define pic.COMateObject
Define MyFont.COMateObject
Define Texto.COMateObject
Define MyRectangle.COMateObject
Fname.s = "PureBasicTest.swf"
;Make the main movie
Movie = COMate_CreateObject("swfobjs.swfMovie")
Movie\Invoke("SetSize(5325, 6000)")
Movie\Invoke("SetFrameBkColor(255, 255, 255)")
Movie\Invoke("SetFrameRate(20)")
MyRectangle = COMate_CreateObject("swfobjs.swfObject")
MyRectangle\Invoke("MakeRectangle(0, 0, 4000, 4680)")
MyRectangle\Invoke("SetRadialFill(255, 255, 255, 255, 255, 50, 224, 255)")
MyRectangle\Invoke("SetRadialFillCenter (3190, 1895)")
MyRectangle\Invoke("SetDepth(0)")
Debug COMate_GetLastErrorDescription()
Movie\Invoke("AddObject(" + Str(MyRectangle) + " As COMateObject)")
For i = 1 To 200
Movie\Invoke("GotoFrame(" + Str(i) + ")")
Movie\Invoke("RemoveObject(" + Str(MyRectangle) + " As COMateObject)")
MyRectangle\Invoke("Rotate(" + Str(655360 * i) + ")")
Movie\Invoke("AddObject(" + Str(MyRectangle) + " As COMateObject)")
Next
;We create a font
MyFont = COMate_CreateObject("swfobjs.swfObject")
MyFont\Invoke("MakeFont('Arial')")
;We create the text
Texto = COMate_CreateObject("swfobjs.swfObject")
Letra$ = "PureBasic"
MyFont\Invoke("AddGlyph('Arial', '" + Letra$ + "', " + Str(Asc("" + Letra$ + "")) + ")")
Texto\Invoke("MakeTextEx('" + Letra$ + "', " + Str(MyFont) + " As COMateObject, 10, 2650, 800)")
Texto\Invoke("SetSolidFill(100, 0, 100, 100)")
Movie\Invoke("GotoFrame(20)")
Movie\Invoke("AddObject(" + Str(Texto) + " As COMateObject)")
For i = 50 To 400
Movie\Invoke("GotoFrame(" + Str(i) + ")")
Movie\Invoke("RemoveObject(" + Str(Texto) + " As COMateObject)")
Texto\Invoke("Rotate(" + Str(-655360 * i) + ")")
Texto\Invoke("Scale(" + Str(655 * (i*2)) + "," + Str(655 * (i*2)) + ")")
Movie\Invoke("AddObject(" + Str(Texto) + " As COMateObject)")
Next
Movie\Invoke("AddObject(" + Str(Texto) + " As COMateObject)")
Movie\Invoke("WriteMovie('" + Fname + "')")
