Original RMXP Tread Here
-Not recommended for Full Screen.-
-Warning you will need a Flash editor to put necessary Action Script-
-This means your Flash is original to you-
There are a lot of you that would like Flash put in with your game.
Not to mention that a flash file is small in size.
Well I asked a friend (malucifer) and he agreed it is beneficial to everyone here.
Download the Demo Here
All you Have to do is copy this code into Script Editor
Title it whateveruwant I called it Scene_Flash
CODE
$library_dir=(Dir.pwd).concat("/malib")
class Malib
def playFlash(fileName)
if(File.exist?((Dir.getwd).concat("/flash/").concat(fileName)))
tempDir=(0.chr)*255
Win32API.new("kernel32", "GetTempPath", ['L', 'P'], 'L').call(254, tempDir)
tempDir=tempDir.delete(0.chr)
tempDir=tempDir.tr("\\", "/")
filenum=1
tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
while(File.exist?(tempFileDel))
filenum+=1
tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
end#while
createTempFile=File.new(tempFileDel, "w+")
createTempFile.close
myLibShell=$library_dir+"/RMXPFlash.exe "+fileName
myLibShell+="malstrsplit"+tempFileDel
Win32API.new("kernel32", "WinExec", ['P', 'L'], 'L').call(myLibShell, 1)
flashWaitTimer=Thread.new do
loop do
if(File.exist?(tempFileDel))
Graphics.update
sleep(0.75)
else
flashWaitTimer.stop
end#if
end#loop
end#Thread
end#if
return
end#def
end#class
class Malib
def playFlash(fileName)
if(File.exist?((Dir.getwd).concat("/flash/").concat(fileName)))
tempDir=(0.chr)*255
Win32API.new("kernel32", "GetTempPath", ['L', 'P'], 'L').call(254, tempDir)
tempDir=tempDir.delete(0.chr)
tempDir=tempDir.tr("\\", "/")
filenum=1
tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
while(File.exist?(tempFileDel))
filenum+=1
tempFileDel=tempDir+"RMXPFS"+(filenum.to_s)+".maltmp"
end#while
createTempFile=File.new(tempFileDel, "w+")
createTempFile.close
myLibShell=$library_dir+"/RMXPFlash.exe "+fileName
myLibShell+="malstrsplit"+tempFileDel
Win32API.new("kernel32", "WinExec", ['P', 'L'], 'L').call(myLibShell, 1)
flashWaitTimer=Thread.new do
loop do
if(File.exist?(tempFileDel))
Graphics.update
sleep(0.75)
else
flashWaitTimer.stop
end#if
end#loop
end#Thread
end#if
return
end#def
end#class
[Show/Hide] Example
[ Malib ] & [ Flash ]
in your Game Directory
'MyDocument'/RM##/Project/'folders here'
Take(copy,move) 'RMXPFlash.exe' to the Malib Folder
#From the Demo or on the attachment here#
Now in the Flash Folder
Your Flash Projects go here (swf files)
You can delete the .fla files when you finish your game project
-If you don't your game will have a higher file size
##-!This is Necessary!-##
in your fla files (flash editing) you will have to put an action script on the first & last Frame.
First frame
CODE
fscommand("RMXPCommand", "nohang")
Last Frame
CODE
fscommand("flashFinished", "return")
Exact Character Keys and Capitalization required
##-!This is Necessary!-##
For 'last frame' you can use a button and put it anywhere in the frame timeline.
(if you make an arcade game and don't want to autoexit)
CODE
on (press) {fscommand("flashFinished", "return")}
See Step 4 on 2nd post for example
##---------------------------------------------------------------------------------------------##
OK to call a Flash Scene just call this script
CODE
(Malib.new).playFlash("intro.swf")
[Show/Hide] Example
Where intro.swf is the name of flash file plus its suffix.
To Call intro
In Script Editor on Main before begin call
CODE
(Malib.new).playFlash("intro.swf")
begin
Graphics.freeze
.....
begin
Graphics.freeze
.....
[Show/Hide] Example
##------------------------------------------------------------------------------------------------##
Download the Demo Here -or- Get exe & swf attachment here \/







